I'm trying to figure out how to make a scoreboard that doesn't stop counting until you die.
wait() local a = 0 local c = script.Parent.Text game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(char) if char:FindFirstChild("Humanoid").Health >= 100 then while true do a = a+1 c = "High Score: "..a end elseif char:FindFirstChild("Humanoid").Health == 0 then script.Parent.Text = a end end) end)
Hello, SnakeInTheBoots!
I made some little changes in your script:
wait() local a = 0 local c = script.Parent.Text game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(char) if char:FindFirstChild("Humanoid").Health >= 100 then while true do -- I think you forgot a wait() somewhere here.... a = a+1 c = "High Score: "..a if char.Humanoid.Health == 0 then break end -- Breaks the Loop if the health is equals to 0 end -- Removed some not needed lines... script.Parent.Text = a end) end)
Good Luck with your games
--make sure it is a local script and in the right place to fit "c" --shouldn't be in workspace wait() local a = 0 local c = script.Parent.Text local plr = game.Players.LocalPlayer repeat wait()until plr.Character repeat a = a + 1 wait(1) -- number of seconds to wait until 1 is added to a c = "High Score" ..a -- I don't understand but you're making the script so we'll keep it until plr.Character.Humanoid.Health == 0 script.Parent.Text = a -- please tell me if it doesn't work and I'll try improving it