Error:Strength is not a valid member of Folder

I made a sell system and I made a IntValue called Strength but its returning an error that
image
This is the line where it is returning an error
image
This is where I created the Strength value
image
I created two folders and I tried removing one in current server so it saves but it seems to not
image
Can anyone tell whats the problem here

1 Like

I assume you parent the leaderstats first and then the Strength inside of it, so use :WaitForChild().

1 Like

Ok so where exactly should I use

WaitForChild()

in this code

plr.leaderstats.Strength.Value = plr.leaderstats.Strength.Value + 10
1 Like
local strength = plr.leaderstats:FindFirstChild("Strength") or plr.leaderstats:WaitForChild("Strength") -- if there's no strength inside already then wait for it
strength.Value += 10 -- use += if you want to increment
1 Like

So both will work right? and let me check if it works

1 Like