local character = script.Parent
local head = character:FindFirstChild(“Head”)
local face = head:FindFirstChild(“face”)
local humanoid = character:FindFirstChild(“Humanoid”)
local animation = game.ReplicatedStorage:FindFirstChild(“LowHealthAnim”)
local loadedAnimation = humanoid:LoadAnimation(animation)
while wait() do
if humanoid.Health <= 40 then
loadedAnimation:Play()
face:Destroy()
local newFace = Instance.new("Decal", head)
newFace.Texture = "rbxassetid://434152481"
else
loadedAnimation:Stop()
end
end*
So i have this script that shoud play a anim and remove your face and put other everything works fine but we get an infinite number of faces and after your health is higher they don’t disappear.
Maybe make a debounce when the health is lower or equal than 40 then debounce = true and when its more than 40 then if debounce == true then debounce = false ? (and you forget to put all your script with ```lua)
Yeah, declare a variable for it and if it isn’t assigned then assign it.
--top of script
local faceId --placeholder for later
--later in script
if not faceId then faceId = value end --if value not assigned then assign a value