PiojitoS Posted October 9, 2020 Share Posted October 9, 2020 (edited) Hi, I need help with this function is for a Trucker job. I want the player to enter the truck to have ghostmode activated with other players, the problem is that only the local player recognizes me and I don't know how to make everyone see the ghostmode. I wrote this: **The problem is that the Ghost Mode is only activated for the local player who is in the truck, it is not activated for the server players. -----------------------------------CLIENT ----------------------------------- ----GHOSTMODE function ghostmodeTRUCKER(Trailertruck) --Trailertruck is a TRAILER in Server.lua local playerVehicle = getPedOccupiedVehicle(localPlayer) -- Get the players vehicle if playerVehicle then -- Check the return value. for i,v in pairs(getElementsByType("vehicle")) do --LOOP through all vehicles setElementCollidableWith(v, playerVehicle, false) -- Set the collison off with the other vehicles. setElementCollidableWith(v, Trailertruck, false) --A la inversa setElementCollidableWith(playerVehicle, v, false) setElementCollidableWith(Trailertruck, v, false) end end end addEvent( "ghostModeTRUCK", true ) addEventHandler("ghostModeTRUCK", getRootElement(), ghostmodeTRUCKER) Edited October 9, 2020 by PiojitoS Link to comment
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