Currently, I'm making an FPS game, and I made this health GUI that looks like this: https://i.imgur.com/7wohCie.png
I want to make the decal change to a red one I made when the player's health is low.
Here's my code so far:
while true do wait(0) script.Parent.Text = "" ..math.floor(script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health) end
Pretty simple
-- Declaration Section local player = game:GetService("Players").LocalPlayer local character = player.Character or player.CharacterAdded:wait() local humanoid = character.Humanoid local playerGui = player.PlayerGui local healthIndicator = playerGui.Health.HealthIndicator -- Processing Section humanoid.Changed:Connect(function() if humanoid.Health <= 50 then healthIndicator.BackgroundColor3 = Color3.new(255/255, 0/255, 0/255) print ("Low Health!") else healthIndicator.BackgroundColor3 = Color3.new(66/255, 138/255, 66/255) print("You are alive!") end end)