I've tried scripting a kill part but no success. My code is:
local part = script.Parent part.Touched:Connect(function() local player = game.Players.LocalPlayer local character = player.Character local hum = character:FindFirstChild("Humanoid") if hum then hum.Health = 0 end end)
local Part = script.Parent function onTouched(hit) if hit and hit.Parent then local humanoid = hit.Parent:FindFirstChildOfClass("Humanoid") if humanoid then humanoid:TakeDamage(0) --Change this number to your damage with each touch end end end Part.Touched:Connect(onTouched)
Sorry, I'm bad at explaining. You have to be sure that this is a server script and not a local one.
Since there are godmode exploit scripts out there, I'd recommend doing it this way:
script.Parent.Touched:Connect(function(hit) --Checks if the part has been touched if hit and hit.Parent:FindFirstChild("Humanoid") then --If the thing that touched it has a Humanoid, it'll fire script below. local NeckBind = hit.Parent:FindFirstChild("Head"):FindFirstChildWhichIsA("Motor6D") --Checks for the Motor6D that connects the Head to the Neck. if NeckBind and NeckBind.Name == "Neck" then --If there's a Motor6D called Neck then NeckBind:Destroy() --Destroys Neck Motor6D else --If there's no Neck Motor6D hit.Parent.Humanoid.Health = 0 --Changes health to 0, Kills player. end) end) end)
I don't know if this will work, I will check later and edit this with a working script.
In a part put that script:
script.Parent.Touched:connect(function(hit) if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then hit.Parent.Humanoid.Health = 0 end end)