Firespider Posted July 2, 2023 Share Posted July 2, 2023 Hello, I would like to make sure that I have a gate created on the server side and I don't want it to be broken, e.g. with a car, when you go to it. I tried with triggerClientEvent but it is not good, it says that the event is not found on the client side, can anyone help? Link to comment
Spakye Posted July 5, 2023 Share Posted July 5, 2023 hello can you share the code you have so far? Link to comment
DiSaMe Posted July 10, 2023 Share Posted July 10, 2023 Let me guess, you're calling triggerClientEvent from onPlayerJoin. But onPlayerJoin is triggered before the client scripts have been downloaded and started so it won't work. You have to call triggerClientEvent when you know the client-side script has started. In the older days, we would use triggerServerEvent from the client-side script to let the server know. Now there's onPlayerResourceStart event for that. Link to comment
FallenGod Posted July 13, 2023 Share Posted July 13, 2023 Hey Bro , I Hope I Can Help You You Can Use https://wiki.multitheftauto.com/wiki/OnClientObjectDamage Event To Canceling Damage (GodMode The Gate) I Write Part Of Example Code : local gate = createObject(19912,x,y,z) -- 19912 is Example Gate ID You Can Replace Your Gate ID , And x,y,z is The Pos Of Gate addEventHandler("onClientObjectDamage",gate,function() -- The Event To Know When Object Get Damage From Any Element cancelEvent() -- Canceling Event For Canceling Damage (GodMode Gate) end) You Can Use This And Enjoy 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