Eu tenho um pequeno problema, na hora de entrar no veículo depois de pegar o personagem, o veículo começa a voar, eu preciso de ajuda e se eu sou novo nesse Scripting.
Preciso de sua ajuda.
function AgarrarSoltar(source, target)
local ID = getElementData(target , config['serverInfo']['id']) or 0
local rotpX = 90
local rotpY = 0
local rotpZ = getElementRotation(target)
local rotvX,rotvY,rotvZ = getElementRotation(source)
local rotX = rotpX - rotvX
local rotY = rotpY - rotvY
local rotZ = rotpZ - rotvZ
local Agarrado = getElementData(target, "SS:Agarrado") or false
if Agarrado == false then
attachElementToElement(target, source, 0, 0.4 , 0.3 , rotX, rotY, rotZ)
setElementData(target,"SS:Agarrado",true)
setPedAnimation(source, "CARRY", "crry_prtial", 0, false, false, false, false)
setPedAnimation(target, "ped", "CAR_dead_LHS", false, false)
exports["CzInventory"]:sendNotification(source, "info", "Agarraste "..removeHex(getPlayerName(target)).." ["..(getElementData(target, config['serverInfo']['id']) or 0).."].")
else
detachElementFromElement(target, source, 0, 0.4 , 0.3 , rotX, rotY, rotZ)
setElementData(target,"SS:Agarrado",false)
setPedAnimation(target)
exports["CzInventory"]:sendNotification(source, "info", "Soltaste"..removeHex(getPlayerName(target)).." ["..(getElementData(target, config['serverInfo']['id']) or 0).."].")
end
end
addEvent ( "SS:Agarrar", true )
addEventHandler ( "SS:Agarrar", root, AgarrarSoltar)