Xeonmeister Posted February 17, 2016 Share Posted February 17, 2016 Hi! First of all, sorry for asking stupid things like this. I just can't understand how to trigger an event and give parameters. For example i wanted to try to make a clientside command, where i get the player's coordinates and trigger a server event which puts the coordinates out in the chat. How can i keep the variables? Edit: Okay i do know now how to trigger a server event. But i'm in trouble trying to trigger a client event for everyone. Can anyone give me an example? Link to comment
Dimos7 Posted February 17, 2016 Share Posted February 17, 2016 Clinet function location() local x, y, z = getElementPosition(localPlayer) end addEvent("area", true) addEventHandler("area", localPlayer, location) Server function playerArea(thePlayer, x, y, z, _) triggerClientEvent(root, "area", root, x, y, z) outputChatBox("The Player is on"..x.." "..y.." "..z.., thePlayer, 255, 255, 0) end addCommandHandler("loc", playerArea) 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