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

How do I fix my Life Gui and Value?

Asked by 3 years ago

I have a code for my stats Gui and the value won't go down and my Gui won't change Here is my Script

local LifeValue = script.Parent.Lives.Value
local Number = 1

game.Players.PlayerAdded:Connect(function(Player) -- Detects when a player joins
    Player.CharacterAdded:Connect(function(Character) -- Detects when his character is addded
        Character:WaitForChild("Humanoid").Died:Connect(function() -- And when he died it will kick him
            LifeValue =- Number
        end)
    end)
end)


Here is my local script

while true do
    if script.Parent.Lives.Value == 4 then
        script.Parent.Life.Text = ("4")
    end
    if script.Parent.Lives.Value == 3 then
        script.Parent.Life.Text = ("3") 
        script.Parent.Life.TextColor.RGB = ("255, 255, 0")
    end
    if script.Parent.Lives.Value == 2 then
        script.Parent.Life.TextColor.RGB = ("255, 0, 0")
        script.Parent.Life.Text = ("2") 

    end
    if script.Parent.Lives.Value == 1 then
        script.Parent.Life.Text = ("1") 

    end

end


local PN = game.Players.LocalPlayer.Name

script.Parent.N.Text = (PN)
0
You are supposed to use -= instead of =- to subtract. RazzyPlayz 497 — 3y

Answer this question