A jak ustawi? rotacj? bo jest ustawione g?r? do do?u?
Dzi?kuj? dzia?a Wilq ten client
Dodano: 2020-04-07, 15:45
Mam taki o to skrypt na nosze:
c.lua
-- USEFUL FUNCTION
function isEventHandlerAdded( sEventName, pElementAttachedTo, func )
if
type( sEventName ) == 'string' and
isElement( pElementAttachedTo ) and
type( func ) == 'function'
then
local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo )
if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then
for i, v in ipairs( aAttachedFunctions ) do
if v == func then
return true
end
end
end
end
return false
end
--
local data = {object = nil, player = nil}
function deleteRotation()
if isEventHandlerAdded( 'onClientPreRender', root, changeRotation ) then
removeEventHandler( 'onClientPreRender', root, changeRotation )
end
end
addEvent("iyw_samd_stretcher:deleteRotation", true)
addEventHandler("iyw_samd_stretcher:deleteRotation", root, deleteRotation)
function changeRotation()
if not data.player then deleteRotation() end
if not data.object then deleteRotation() end
local rotation = {getElementRotation(data.object)}
data.player.rotation = Vector3(rotation[1], rotation[2], rotation[3]+90)
end
addEvent("iyw_samd_stretcher:rotation", true)
addEventHandler("iyw_samd_stretcher:rotation", root, function(player, object)
data.object = object
data.player = player
addEventHandler("onClientPreRende... |