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

Why wont this script add values to the leaderboard? [closed]

Asked by 6 years ago

This question already has an answer here:

**UPDATED** Why wont this script add values to leaderstats?

What the title says.


game.Players.PlayerAdded:Connect(function(plr) if game.Workspace.StarterItemsUpgraded.StarterMonitorUpgraded.SurfaceGui.Active == true then wait(math.random(1, 2)) print("Hi") game.Players:WaitForChild("leaderstats"):WaitForChild("Followers").Value = game.Players:WaitForChild("leaderstats", 120):WaitForChild("Followers").Value +1 elseif game.Players:WaitForChild("leaderstats").Followers.Value >130 then game.Players:WaitForChild("leaderstats").Followers.Value = game.Players:WaitForChild("leaderstats").Followers.Value + math.random(1,2) elseif game.Players:WaitForChild("leaderstats").Followers.Value >250 then game.Players:WaitForChild("leaderstats").Followers.Value = game.Players:WaitForChild("leaderstats").Followers.Value + math.random(1,3) elseif game.Players:WaitForChild("leaderstats").Followers.Value >350 then game.Players:WaitForChild("leaderstats").Followers.Value = game.Players:WaitForChild("leaderstats").Followers.Value + math.random(1,4) elseif game.Players:WaitForChild("leaderstats").Followers.Value >410 then game.Players:WaitForChild("leaderstats").Followers.Value = game.Players:WaitForChild("leaderstats").Followers.Value + math.random(2,4) elseif game.Players:WaitForChild("leaderstats").Followers.Value >500 then game.Players:WaitForChild("leaderstats").Followers.Value = game.Players:WaitForChild("leaderstats").Followers.Value + math.random(2,5) elseif game.Players:WaitForChild("leaderstats").Followers.Value >600 then game.Players:WaitForChild("leaderstats").Followers.Value = game.Players:WaitForChild("leaderstats").Followers.Value + math.random(2,6) elseif game.Players:WaitForChild("leaderstats").Followers.Value >700 then game.Players:WaitForChild("leaderstats").Followers.Value = game.Players:WaitForChild("leaderstats").Followers.Value + math.random(2,7) elseif game.Players:WaitForChild("leaderstats").Followers.Value >775 then game.Players:WaitForChild("leaderstats").Followers.Value = game.Players:WaitForChild("leaderstats").Followers.Value + math.random(3,7) elseif game.Players:WaitForChild("leaderstats").Followers.Value >845 then game.Players:WaitForChild("leaderstats").Followers.Value = game.Players:WaitForChild("leaderstats").Followers.Value + math.random(3,8) elseif game.Players:WaitForChild("leaderstats").Followers.Value >950 then game.Players:WaitForChild("leaderstats").Followers.Value = game.Players:WaitForChild("leaderstats").Followers.Value + math.random(3,9) elseif game.Players:WaitForChild("leaderstats").Followers.Value >1150 then game.Players:WaitForChild("leaderstats").Followers.Value = game.Players:WaitForChild("leaderstats").Followers.Value + math.random(3,10) elseif game.Players:WaitForChild("leaderstats").Followers.Value >1450 then game.Players:WaitForChild("leaderstats").Followers.Value = game.Players:WaitForChild("leaderstats").Followers.Value + math.random(3,11) elseif game.Players:WaitForChild("leaderstats").Followers.Value >1750 then game.Players:WaitForChild("leaderstats").Followers.Value = game.Players:WaitForChild("leaderstats").Followers.Value + math.random(3,12) elseif game.Players:WaitForChild("leaderstats").Followers.Value >2000 then game.Players:WaitForChild("leaderstats").Followers.Value = game.Players:WaitForChild("leaderstats").Followers.Value + math.random(4,12) elseif game.Players:WaitForChild("leaderstats").Followers.Value >2300 then game.Players:WaitForChild("leaderstats").Followers.Value = game.Players:WaitForChild("leaderstats").Followers.Value + math.random(4,13) elseif game.Workspace.StarterItemsUpgraded.StarterMonitorUpgraded.SurfaceGui.Active == false then print("It is not on.") end end)
0
Oh no. What is this? Make a variable for the Followers Value please. Vezious 310 — 6y
0
yeah... that would help a LOT in terms of simplicity. Stycon 30 — 6y

Marked as Duplicate by User#5423

This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.

Why was this question closed?