do Humanoid = Instance.new("Humanoid",script.Parent)
wait (.1)
Humanoid.Health = 100
Humanoid.MaxHealth = 100
Humanoid.WalkSpeed = 0
wait (.1)
script:Destroy()

end

So I'm making a Holotraining, and am trying to have something with a humanoid in one of the Holos. Before, every time I loaded the holo with the humanoids in them, they would die the second they were cloned into Workspace. I made this script to insert a humanoid AFTER the holo is loaded, but it seems that while this does work in Studio, it doesnt work in game. How can I fix this? Also, will the humanoid that is inserted be effected by the following script that is already in the holo? If not, how can I connect them?

local x = script.Parent.Parent.YellowTerminal

script.Parent.Humanoid.Died:connect(function()

           msg = Instance.new("Message",Workspace)

           msg.Text = "The Yellow Team Has Won!"

           x:Destroy()
           Game.Debris:AddItem(msg,5)

           wait(5)

           script.Parent:remove()

end)