function kill(part)
local h = part.Parent:findFirstChild("Humanoid")
if h then
wait(.1)
h.WalkSpeed = 0
local a = Instance.new("Part")
a.Parent = game.Workspace
a.CFrame = h.Parent.Torso.CFrame+Vector3.new(0,1,0)
a.CanCollide = false
a.Size = Vector3.new(5,7,5)
a.Anchored = true
a.BrickColor = BrickColor.Blue()
a.Transparency = .5
a.Reflectance = .5
a.TopSurface = "Smooth"
a.BottomSurface = "Smooth"
game.Players.LocalPlayer.Character.Humanoid.Changed:connect(function(jumpy) if jumpy == "Jump" then game.Players.LocalPlayer.Character.Humanoid.Jump = false end end
)h.Parent.Torso.Anchored = false
for i = 1,110 do
wait()
h.Health = h.Health - 1
h.Parent.Health.Disabled = true
end
if h.Health == 0 then
wait(5)
a:Destroy()
end
end
end
script.Parent.Touched:connect(kill)
When you touch it, it is supposed to insert a new part, that looks like ice and slowly kill you. It does everything in-game just not the killing part, which means the player can not move until he/she resets. Help? Also when you die, it inserts new parts... how do I prevent that from happening?

1 comment
I made it a local script, but it now doesn't work at all