function Teleporter(hit) if hit.Parent and hit.Parent:FindFirstChild("Humanoid") then hit.Parent:MoveTo(game.Workspace.SpawnLocation2.Position + Vector3.new(0,5,0)) end end script.Parent.Touched:connect(Teleporter)
This script works and all, but I was testing my Obby and well When I died, my body landed on the teleporter. And I got a error. So is there a way for the button not to run when you touch it with 0 health?
Yeah, In your if statement add a and hit.Parent.Humanoid.Health > 0 then