|
| 05 Jun 2017 02:42 PM |
--serverside
Rep.Events.Add:FireClient("update char", Amount)
--clientside
Rep.Events.Add.OnClientEvent:connect(function(Player,Type,Amount) print("This works")
the print does not fire. Please help. |
|
|
| Report Abuse |
|
|
|
| 05 Jun 2017 02:44 PM |
your unable to cast a value to an object.
#code print("oh no an errorz!") |
|
|
| Report Abuse |
|
|
|
| 05 Jun 2017 02:45 PM |
| i can see that, but can some please explain with reference to my code, what it is im doing wrong, thanks. |
|
|
| Report Abuse |
|
|
|
| 05 Jun 2017 02:45 PM |
"update char" is where it is wrong.
When you fire a single client with RemoteEvents, you have to specify the player. The player HAS to be an object, not a string (so not "Player1"; but, game.Players.Player1)
Sometimes, it's the people no one imagines anything of, who do the things that no one can imagine. |
|
|
| Report Abuse |
|
|
|
| 05 Jun 2017 02:46 PM |
--serverside
Rep.Events.Add:FireClient("update char", Amount)
--clientside
Rep.Events.Add.OnClientEvent:connect(function(Player,Type,Amount) print("This works")
You are expecting 3 arguments. The Player argument is only valid from client to server. So this should work. Or not I am not a pro ok. Lol. --serverside
Rep.Events.Add:FireClient("update char", Amount)
--clientside
Rep.Events.Add.OnClientEvent:connect(function(Type,Amount) print("This works") |
|
|
| Report Abuse |
|
|
|
| 05 Jun 2017 02:47 PM |
by specifiy the player like, game.Players:FindFirstChild(Player) [Given that i have their name only]?
|
|
|
| Report Abuse |
|
|
|
| 05 Jun 2017 02:50 PM |
Yes.
Order of parameters for RE:
RemoteEvent:FireClient(object Player, args) RemoteEvent:FireAllClients(args) -- This will fire to every single player in the game, so a player specified is not needed
Sometimes, it's the people no one imagines anything of, who do the things that no one can imagine. |
|
|
| Report Abuse |
|
|