Tool script not working

I came across this error when I tried to make the weight give hydration but it gave this error

This is the line in which it is saying an error

So what do you think is the problem?

2 Likes

Try:

if strength then
   strength.Value += 10
end

Also, are you sure there’s a value called “Strength” in player.leaderstats?

1 Like

Have you ever created Strength?

1 Like

judging from what the error is saying, it seems like you never had a member named “Strength” in the Folder object.
would you mind showing us a screenshot of your hierarchy?

Why are you creating a variable for it but end up not using it anyway? And yeah, you should check if “Strength” actually exists in the leaderstats folder. Do you create this on a PlayerAdded event?

Yep it is there but not showing in the leaderboard of the game
image
It is not showing here
image

Cuz u put 2 leaderstats change that one

But I want the hydration one that’s the correct one so should I remove the strength and coins folder?

Change that leaderstats that has strength into
leaderstats1

And do this

strength.Value += 10

Yep I did that but I don’t want the strength to become more I want the hydration to, as you can see here
image

So I guess I have to change this to hydration
image
strength to hydration right?

Again w8 whats ur problem so u want the strength put into leaderboard?

Nope I want to remove it from the leaderboard and their should be only Hydration and coins

First change ur other leaderstats into other name
And then do like this

Example u change the name of ur leaderstats into strengthValue

plr.strengthValue.Strength.Value += 10

The folder with the strength or the folder with the hydration

The folder with the strength and chage the name of the folder with the strength

Uhm I tried this but It gave this error on the same line
Error:


Code:

@sausagerate said earlier to change the name of the folder with Strength to strengthValue, that might be the problem because you are looking for strength in 2 different places (leaderstats and strengthValue)

You said that you want the weight to give hydration, but the picture is showing strength value changing script instead of weight and hydration script? If you want us to help with the right problem, at least show the correct script or label your problem correctly

I remembered changing it when I am playing testing it (because that’s the time when it shows the player option) then I stopped to change the script and when I play tested it again its leaderstats again