Part = script.Parent Part.Touched:Connect(function(hit) if hit.Parent == hit.Parent:FindFirstChild("Humanoid") then hit.Parent.Health = 0 end Part.CFrame = CFrame.new(0, 0, 15) end)
local Part = script.Parent Part.Touched:Connect(function(hit) local human = hit.Parent:FindFirstChildOfClass("Humanoid") if human then human.Health = 0 Part.CFrame = CFrame.new(0, 0, 15) end end)
try this... local Part = script.Parent
local function onPartTouch(otherPart) local partParent = otherPart.Parent local humanoid = partParent:FindFirstChildWhichIsA("Humanoid") if humanoid then humanoid.Health = 0 end end Part.Touched:Connect(onPartTouch)