So i'm trying to make a part that when you click on it you just flat out die. I tried asking the discord but they're like busy answering other peoples questions but even when I ask mine when all the questions are over they don't read it or just ignore it? I would consider they didn't see but idk maybe nobody on there really likes me maybe.
So I search on Google how to make a "part that kills you when you click it" and "How to get humanoid from MouseClick"
I go on the websites and type the examples in my own way but it doesn't show errors and it just doesn't work and I assume they might be outdated or something, here's what I typed:
local player = game.Players.LocalPlayer
local character = player.Character
local Part = game.Workspace.DeathPart
Part.ClickDetector.MouseClick:Connect(function(playerWhoClicked)
playerWhoClicked.Character.Humanoid.Health = 0
end)

1 comment
Make a part, and insert a click detector, then insert a script inside the detector and write: script.Parent.MouseClick:Connect(function(Player) local Character = game.Workspace:FindFirstChild(Player.Name) if Character ~= nil and Character:IsA('Model') then Character.Humanoid.Health = 0 end end)