Asked by cooldeath49 0 45 minutes ago Hi helpers, I know I'm really amateur and I suck at scripting, but I currently made a target for target practice that changes its color dependent on its health. However, once it dies, it respawns as normal, but after the second death, it duplicates and two targets appear instead. Help would be appreciated. The script is inside a humanoid root part, which is then inside a model, alongside a whole bunch of other body parts. (ignore the whole color and repeated chunk)
local Target = script.Parent.Parent
local backup = Target:Clone()
while true do
local Hmd = Target.Humanoid.Health
Torso.Color = Color3.new(1 - (Hmd * 0.01), Hmd * 0.01, 0)
Head.Color = Color3.new(1 - (Hmd * 0.01), Hmd * 0.01, 0)
RL.Color = Color3.new(1 - (Hmd * 0.01), Hmd * 0.01, 0)
LL.Color = Color3.new(1 - (Hmd * 0.01), Hmd * 0.01, 0)
RA.Color = Color3.new(1 - (Hmd * 0.01), Hmd * 0.01, 0)
LA.Color = Color3.new(1 - (Hmd * 0.01), Hmd * 0.01, 0)
if Target.Humanoid.Health == 0 then
wait(2)
Target:Destroy()
wait(0.5)
Target = backup:Clone()
Target.Parent = game.Workspace
end
wait(0.1)
end

6 comments
yes
Also you state before the while loop to clone it.. then in the while loop you clone it again so..
Wait i think because you say Target = backup:Clone() but backup is already cloned
OHH i know its because the if Target.Humanoid.Health == 0 then is constantly running
ok
thx for your response, I used a lil bit of it.