ReZurrecti0n Posted January 11, 2020 Posted January 11, 2020 I just discovered that client side events will trigger for everyone rather than just the one who triggers the event. So I need some way to check and run the code for only the one who triggered it. I'm currently having issues with one player pressing the F1 key (OnClientKey) to open a menu (custom PlayerMenu()) and everyone is getting that menu when it is only meant for the player who triggers it. How would I work this out to make it so only the triggering player gets the menu? Check using localPlayer? But what would I check against? How exactly does it all work?
ReZurrecti0n Posted January 11, 2020 Author Posted January 11, 2020 It could possibly have been how I was using all my triggerClientEvent functions, the very first "optional" argument was missing, therefore triggering the client events for everyone... However, its difficult to test since I need more than myself to confirm I've even fixed this issue...
Moderators IIYAMA Posted January 11, 2020 Moderators Posted January 11, 2020 2 hours ago, ReZurrecti0n said: the very first "optional" argument was missing That is mostlikely the issue. 1 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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