so im trying to make it where when you click the part you die but it keeps saying players inst a valide meber of players heres the code:
local ClickDetector = script.Parent
function onClicked(mouse) local player = mouse.Player local humanoid = player.Character:FindFirstChild("Humanoid") if humanoid then humanoid.Die() end end
ClickDetector.MouseClick:Connect(onClicked)
