So, I'm making a script. What it does, is when I step on a brick, my player's bodypart(left leg, right leg, left arm, right arm) catches fire for 2 seconds and then is destroyed. What I want to do, is to make the bodyparts chosen randomly to catch fire. On top of this, I also, want it to sense if a previous body part is even there. Here's what I have:
local part = script.Parent
local db = true
function burn(hit)
local bodypart1 = hit.Parent:FindFirstChild("Left Arm")
local bodypart2 = hit.Parent:FindFirstChild("Right Arm")
local bodypart3 = hit.Parent:FindFirstChild("Left Leg")
local bodypart4 = hit.Parent:FindFirstChild("Right Leg")
local fire = Instance.new("Fire")
local human = hit.Parent:FindFirstChild("Humanoid")
if human then
db = false
fire.Parent = bodypart1
wait(2)
bodypart1:Destroy()
if bodypart1 = nil then
fire.Parent = bodypart2
wait(2)
bodypart2:Destroy()
end
end
part.Touched:connect(burn)
Some how, my script doesn't work. Any ideas? All help is appreciated!
