#invalid argument 2 (string expected, got Instance)

5 messages · Page 1 of 1 (latest)

shut elm
#

Error code from my script

#
game.Players.PlayerAdded:Connect(function(plr)
    
    while true and wait(1) do
        game.Players[plr].leaderstats["Time(Secs)"].Value = game.Players[plr].Data.Time.Value
    end
end)```
muted pumice
#

On the line game.Players[plr] you use the plr variable, however the plr variable is the player itself, so an instance, not the name of the connected player

#

You either do plr.Name or change the whole part to just plr

shut elm
#

oh thx