Ok, so with FireClient, the first argument must be the player, right? Well, I'm having some issues. Ok, so lets say I run this in a server script
game.ReplicatedStorage.RemoteEvent:FireClient(plr,"one","two")
and in the localscript, the code would be
game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(plr,1,2) print(plr,1,2) end)
the output would be (one two nil) and if I try to remove player it fails to cast value (or something like that) and I really need it to pass player, which it isnt doing.. ive tested it in the normal command bar, studio solo mode, and Clients and Servers mode they all return plr nil. any help?
PLEASE DO NOT SPOON FEED ME.
Alright I'll try to make this quick and easy to understand
game.ReplicatedStorage.RemoteEvent:FireClient(plr,"one","two")
The first Parameter is the player for when you want to fire an event to a single player, that single player is in your code defined by "plr".
game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(plr,1,2) print(plr,1,2) end)
The plr is not sent to the function here, it's just a parameter the FireClient event uses to define which player to send "one", and "two".
instead you would want to write this
game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(1,2) print(game.Players.LocalPlayer,1,2) end)
game.Players.LocalPlayer gets the player that is running the LocalScript