Hey, i'm making a game with battles, and I am using IntValues for things like hp, its only in beta so it only has attacking and hp. It wont update the hp for some reason, no errors in console, it just wont update from the number 20 (the default value, not set as the original text for the labels) The attack button is changing values, so that isnt the error

while true do
	wait(0.00001)
	for i,v in pairs(game.Players:GetPlayers())do
		if v:FindFirstChild("battlestats") then
			game.StarterGui.ScreenGui.Frame.TextLabel.Text = tostring(v.battlestats["hp1"].Value)
			game.StarterGui.ScreenGui.Frame.TextLabel2.Text = tostring(v.battlestats["hp2"].Value)
			
		end
	end
end

2 comments

0

What type of script is this in?

0

Make sure its a localscript. You can also you can make your script faster by using heartbeat instead of whiletruedo https://pastebin.com/YHDL2Enx