Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why doesn't this leaderstats script work? (reposted due to no correct answer being posted before)

This is my leaderstats script. If the value of one of the leaderstats is less than 10, it is supposed to add the value of another leaderstat to the value of another leaderstat. It doesn't work for whatever reason. Does anyone know why? Here is my code: where the code gets cut off it says player.leaderstats.Videos.Value

1 comment

0

Great. The link didn't work. It's http://prntscr.com/huolde

2 answers

✓ Accepted answer

You need another end for one, you also forgot a dot and said playerLeaderstats, and lastly, you never gave it a number to add to the views. That’s all that I saw but there could be plenty more.

2 comments

0

The number it is supposed to add to the views is the value of Videos. On line 5 where some of the code got cut off, it said player.leaderstats.Videos.Value

0

It WORKED!! Thanks dude.

I noticed a few things that were just simple errors

while wait(3) do
for _,player in pairs(game.Players:GetChildren()) do
if player:FindFirstChild("leaderstats") ~= nil then
if player.leaderstats.Views.Value <= 10 then
player.leaderstats.Views.Value = player.leaderstats.Views.Value = player.leaderstats.Views.Value + player.leaderstats.Views.Value
end
end
end
end

2 comments

0

That does not fix anything. Also, what was the need for two equal signs in line 5?

0

Oops my bad

This discussion is preserved as it was. New answers, comments, and votes are closed.