On this page (http://wiki.roblox.com/index.php?title=RemoteFunction_and_RemoteEvent_Tutorial) tried page, I tried using this sample:
game.Players.LocalPlayer:WaitForChild("MyClientEvent").OnClientEvent:connect(function() print("EventHappened") end)
However, I get this error:
Infinite yield possible on 'Players.Player1:WaitForChild("MyClientEvent")'
Why is this? If I have a ChildAdded event it is triggered, but this doesnt work.
Also, separate question. I'm using remote events for the server to send data to specific clients. But, when I instantiate the event inside of a player, the event shows up on that player but in all clients. Could someone theoretically cheat to see that the even says?
You must have an event in every player called "MyClientEvent", which is what it waits for. I strongly recommend not having an event for every player though. Remote events have a FireClient function anyway.
And yeah, exploiters can see all of the arguments of the events, and even FireServer at will. You can probably ignore it. If you are super worried, you can do simple checks on the server to see if the client info fits your game context.