Bigao Smoke Posted April 23, 2020 Posted April 23, 2020 (edited) Eu queria um script de trancar carro e, quando o carro está trancado e você está dentro dele, não pode sair quando você o destrancar. Edited April 23, 2020 by Bigao Smoke
DNL291 Posted April 24, 2020 Posted April 24, 2020 Quando utilizar o fórum, certifique-se de criar o tópico no local certo @Bigao Smoke https://forum.multitheftauto.com/forum/127-programação-em-Lua/ < Dá próxima vez poste aqui. 1
Bigao Smoke Posted April 24, 2020 Author Posted April 24, 2020 9 hours ago, DNL291 said: Quando utilizar o fórum, crie um tópico no local certo @Bigao Smoke https://forum.multitheftauto.com/forum/127-programação-em-Lua/ <Dá próxima vez poste aqui. Certo, sou novo aqui, foi mal .
Bigao Smoke Posted April 24, 2020 Author Posted April 24, 2020 6 hours ago, ErichBSV said: Eu consegui fazer, mas acho que pq n sou bom jkjkkj ❤️"> pode me mandar no meu discord ? Big Smoke#8362 agradeceria muito
Herc Posted April 24, 2020 Posted April 24, 2020 Opa, então man, como eu disse, não funcionou, acho pq eu n sei mexer em script, mas ele está aqui: function lockcar ( thePlayer ) playervehicle = getPlayerOccupiedVehicle ( thePlayer ) -- define 'playervehicle' as the vehicle the player is in if ( playervehicle ) then -- if a player is in a vehicle if isVehicleLocked ( playervehicle ) then -- and if the vehicle is already locked setVehicleLocked ( playervehicle, false ) -- unlock it else -- otherwise (if it isn't locked) setVehicleLocked ( playervehicle, true ) -- lock it end end end function bindLockOnSpawn ( theSpawnpoint ) -- when a player spawns bindKey ( source, "l", "down", lockcar ) -- bind the 'l' key to the 'lockcar' function end addEventHandler ( "onPlayerSpawn", getRootElement(), bindLockOnSpawn ) -- call 'stopVehicleEntry' whenever hunterPlayer is about to enter a vehicle: function stopVehicleEntry ( theplayer, seat, jacked ) cancelEvent() -- stop the event, the player will can't enter in vehicle end addEventHandler("onVehicleStartEnter", getRootElement(), stopVehicleEntry) function exitVehicle (thePlayer, seat, jacked) if (isVehicleLocked (source)) then outputChatBox ("The door is locked! You can't exit the vehicle!", thePlayer) cancelEvent() end end addEventHandler ("onVehicleStartExit", root, exitVehicle) Caso queira arrumar, está aí, se conseguir, me fale onde errei
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now