There was an error when I wanted to pass getchildren in fireclient, and it said "FireClient: Player argument must be a player object". I changed the data to just Score which was in player (which I already declared via other remote events) because I thought since it was a descendant from player it would be considered a player object. WRONG. What do I do?
COMMUNITY QUESTION
What is a player object?
1 answer
The way you can solve this is in the following code:
--Script
local remoteEvent = game.ReplicatedStorage:WaitForChild("RemoteEvent")
game.Players.PlayerAdded:Connect(function(player) --this parameter is the player object
remoteEvent:FireClient(player)
end)
-- ==========================================
--LocalScript
local remoteEvent = game.ReplicatedStorage.RemoteEvent
local player = game.Players.LocalPlayer
remoteEvent.OnClientEvent:Connect(function()
--YourCode
end)
If this works for you, make this the solution.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
A player object is the player themselves.