Heres the script:
local Teleport = "Tele4"
function Touch(hit)
if script.Parent.Locked == false and script.Parent.Parent:findFirstChild(Teleport).Locked == false then
script.Parent.Locked = true
script.Parent.Parent:findFirstChild(Teleport).Locked = true
local Pos = script.Parent.Parent:findFirstChild(Teleport)
hit.Parent:moveTo(Pos.Position) wait(1) script.Parent.Locked = false script.Parent.Parent:findFirstChild(Teleport).Locked = false
end
end
script.Parent.Touched:connect(Touch)
What I'm trying to do is make it if the players health is 0 (dead) then this script will not teleport them anywhere. Can someone help me with this?

2 comments
Since it's a void function, you could just do "if humanoid.Health > 0 then" because you're not returning anything, so the "else return" is unnecessary
Thanks to both of you I got it working the way I need