Sorato Posted April 13, 2013 Share Posted April 13, 2013 Hello, The following function should be a Client function: function chat(hitPlayer, matchingDimension) outputChatBox("Test123") end addEventHandler("onClientMarkerHit", getRootElement(), chat) Why does it get triggered for a Client when another Client runs into the Marker? (Every player gets the chat message ) Link to comment
DiSaMe Posted April 13, 2013 Share Posted April 13, 2013 Because the client is aware of other players entering the marker. Link to comment
TAPL Posted April 13, 2013 Share Posted April 13, 2013 You need to check that the hit player is the local player. if hitPlayer == localPlayer then Link to comment
Sorato Posted April 13, 2013 Author Share Posted April 13, 2013 But why? If i use Client Events shouldn't they specifically be made for the Client? What's the sense or the use of the Client being aware of other Clients? Link to comment
Puma Posted April 13, 2013 Share Posted April 13, 2013 No. For example, you want to display a text on your screen when a player enters a marker. A lot of things, like displaying text, are only clientside available (simply because the server is just passing through and modifying data between clients and not rendering anything), so you do a clientside script using onClientMarkerHit. Link to comment
DiSaMe Posted April 13, 2013 Share Posted April 13, 2013 Client-side script means a script that runs on the client's computer, not something that doesn't work with multiple clients. If client was unaware of other clients, it wouldn't be multiplayer. 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