No spaces in the name! You gotta choose from one of these. I believe that if you destroy some specific items, the humanoid instantly dies. (Probably head, torso, humanoidrootpart)
Yeah, you are using the correct names (oops forgot to check if there are any limbs at all, fixed)
Possibly fixed version:
script.Parent.ClickDetector.MouseClick:Connect(function(player)
if not player.Character then return end
local character = player.Character
local limbs = {
character:FindFirstChild("Left Arm");
character:FindFirstChild("Right Arm");
character:FindFirstChild("Left Leg");
character:FindFirstChild("Right Leg");
}
if #limbs < 1 then return end
local limb = limbs[math.random(1, #limbs)]
if limb then
limb:Destroy()
table.remove(limbs, table.find(limbs, limb))
end
end)
I believe that is correct. Once the limb has been removed, there is still a chance that the math.random() function may still choose the destroyed limb. You have to remove it from the table.
FindFirstChild will return nil if it found nothing, therefore it won’t break since Destroy has already got rid of it (setting a value to nil removes the value from the table as far as i know)