Hi, i wanted to make a script. when i sit in Savanna vehicle i press O and the script add a roof to my car and when i press it again it is delete it
but my debugscript says that: tetoad.lua:2: bad argument @ 'isPedInVehicle'
Thank you for help, i am a begginer
function tetoad()
if (isPedInVehicle(targetPlayer)) then
if not(succes == nil) then
setTimer(tetoveg, 5000, 1)
else
destroyElement(succes)
end
else
outputChatBox("Rossz")
end
end
function gomb()
bindKey("p", "down", tetoad)
end
addEventHandler("onClientResourceStart", getRootElement(), gomb)
function tetoveg()
theVehicle = getPedOccupiedVehicle(targetPlayer)
success = addVehicleUpgrade(theVehicle, 1131)
end