Issue: invalid argument #2 (string expected, got Instance)

I’m kinda new to scripting and I got this error (title)
it is in line with local Leaderstats…
I looked at other posts like this but couldnt find anything useful aswell.
If I set Player to a Player Name by " " it works.
Script is located in Players Character

local Player = script.Parent
local Player = Players:GetPlayerFromCharacter(Player)
local Leaderstats = Players[Player].leaderstats
local Strength = Leaderstats.Strength
local Leaderstats = Players[Player.Name].leaderstats
1 Like

You should also use different names for these 2 variables, makes the code more readable then

You can just do Player.leaderstats here

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.