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

Why wont my label update after using the attack button?

Asked by 5 years ago

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
0
What type of script is this in? deth836231 142 — 5y
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 MachoPiggies 526 — 5y

Answer this question