So, I made the following script, the output did not give any errors, but when my cash value is changed, it does not change my billboard gui nor destroys it...
game.Players.PlayerAdded:Connect(function(plr) local cash = plr:WaitForChild("leaderstats").Cash local s = game:GetService("ServerStorage") local rank = s.Ranks local char = plr.Character or workspace.ChildAdded:Wait() if plr:WaitForChild("leaderstats").Cash.Value >= rank.Noob.Requirement.Value then local noob = rank.Noob:Clone() noob.Parent = char.Head cash.Changed:Connect(function() wait() if cash.Value >= rank.Fine.Requirement.Value then local fine = rank.Fine:Clone() fine.Parent = char.Head noob:Destroy() cash.Changed:Connect(function() wait() if cash.Value >= rank.Good.Requirement.Value then local good = rank.Good:Clone() good.Parent = char.Head cash.Changed:Connect(function() fine:Destroy() wait() if cash.Value >= rank.Pro.Value then local pro = rank.Pro:Clone() pro.Parent = char.Head good:Destroy() end end) end end) end end) end end)
so it should look something like this (I had to add some stuff to it to test if it works so just ignore them)
game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(char) local l = Instance.new("Folder",plr) l.Name = "leaderstats" local cash1 = Instance.new("IntValue",l) cash1.Name = "Cash" local cash = plr:WaitForChild("leaderstats").Cash local s = game:GetService("ServerStorage") local rank = s.Ranks local char = plr.Character cash.Changed:Connect(function() if plr:FindFirstChild("leaderstats").Cash.Value >= 100 then local noob = rank.Noob:Clone() noob.Parent = char.Head if cash.Value >= 200 then local fine = rank.Fine:Clone() fine.Parent = char.Head noob:Destroy() if cash.Value >= 300 then local good = rank.Good:Clone() good.Parent = char.Head fine:Destroy() if cash.Value >= 400 then local pro = rank.Pro:Clone() pro.Parent = char.Head good:Destroy() end end end end end) end) end)