What the title says. Also how do I make it instead of when the player is added, its when the player clicks on the monitor. Surface GUI with clickdetector script is already done
What I am trying to do is make it when a person clicks on the startermonitorupgraded, it activates the surfaceGUI(it does) but it dosent add the values that I have set in the script.
game.Players.PlayerAdded:Connect(function(plr) if game.Workspace.StarterItemsUpgraded.StarterMonitorUpgraded.SurfaceGui.Active == true then wait(math.random(1, 2)) print("Hi") game.Players.LocalPlayer:WaitForChild("leaderstats"):WaitForChild("Followers").Value = game.Players.LocalPlayer:WaitForChild("leaderstats", 120):WaitForChild("Followers").Value +1 elseif game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value >130 then game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value = game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value + math.random(1,2) elseif game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value >250 then game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value = game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value + math.random(1,3) elseif game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value >350 then game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value = game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value + math.random(1,4) elseif game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value >410 then game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value = game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value + math.random(2,4) elseif game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value >500 then game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value = game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value + math.random(2,5) elseif game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value >600 then game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value = game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value + math.random(2,6) elseif game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value >700 then game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value = game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value + math.random(2,7) elseif game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value >775 then game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value = game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value + math.random(3,7) elseif game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value >845 then game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value = game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value + math.random(3,8) elseif game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value >950 then game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value = game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value + math.random(3,9) elseif game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value >1150 then game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value = game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value + math.random(3,10) elseif game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value >1450 then game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value = game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value + math.random(3,11) elseif game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value >1750 then game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value = game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value + math.random(3,12) elseif game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value >2000 then game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value = game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value + math.random(4,12) elseif game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value >2300 then game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value = game.Players.LocalPlayer:WaitForChild("leaderstats").Followers.Value + math.random(4,13) elseif game.Workspace.StarterItemsUpgraded.StarterMonitorUpgraded.SurfaceGui.Active == false then return nil end end)
Marked as Duplicate by Vezious, User#21908, User#5423, and minikitkat
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?