Hello, i’m currently having an issue with the Players:GetPlayers function. When i call it, it returns userdata and not player object which create an error when i try to fire client.
The error stats that it is expecting a player object for fire client.
Players:GetPlayers() returns an array containing all the players, not a single player, you have to loop through the array to apply code for each player:
for _, player in pairs(Players:GetPlayers()) do
print(player.Name)
end
local TestRemote = Instance.new('RemoteEvent', game.ReplicatedStorage)
repeat wait(1) until #game.Players:GetPlayers() ~= 0 -- waiting until there's at least 1 player
TestRemote:FireClient(game.Players:GetPlayers()[1])