So ive been trying to make a part kill you using clickdetector by myself first, but all my attempts were unusuccesful
local players = game:GetService("Players")
local ClickDetector = game.Workspace.clickpart.ClickDetector
local clickpart = script.Parent
clickpart.ClickDetector.MouseClick:Connect(function(hit)
local player = players:GetPlayerFromCharacter(hit.Parent)
if player then
local humanoid = hit.Parent:FindFirstChildWhichIsA("Humanoid")
if humanoid.Health > 0 then
humanoid.Health = 0
end
end
end)

1 comment
dude i never thought it would be that simple with just 3 lines of code, thank you