Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 7 years ago

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

0
Great. The link didn't work. It's http://prntscr.com/huolde sesamert16 31 — 7y

2 answers

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

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.

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 sesamert16 31 — 7y
0
It WORKED!! Thanks dude. sesamert16 31 — 7y
Ad
Log in to vote
0
Answered by 7 years ago

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
0
That does not fix anything. Also, what was the need for two equal signs in line 5? sesamert16 31 — 7y
0
Oops my bad RequiredModule 38 — 7y

Answer this question