So, so far I have my script made in a way, that when I step on the part it randomly chooses a part in "myArray". Now, I want it that when you "wait(2)", the part that was chosen is destroyed Here's my script:
local part = script.Parent
local db = false
function burn(hit)
local p1 = hit.Parent:FindFirstChild("Left Arm")
local p2 = hit.Parent:FindFirstChild("Right Arm")
local p3 = hit.Parent:FindFirstChild("Left Leg")
local p4 = hit.Parent:FindFirstChild("Right Leg")
local p5 = hit.Parent:FindFirstChild("Torso")
local fire = Instance.new("Fire")
local human = hit.Parent:FindFirstChild("Humanoid")
local myArray = {p1, p2, p3, p4, p5}
if human then
if not db then
db = true
part.Sound:Play()
fire:Clone().Parent = myArray [math.random(1,5)]
wait(2)
--chosenpart:Destroy()
db = false
end
end
end
part.Touched:connect(burn)
All help is appreciated!

5 comments
this script chooses multiple parts.
It takes one of the parts "math.random" chose. Now, I just want to know how to call the part that was chosen. I just don't know what to call it.
part = myArray[math.random(#myArray)]
Thanks! Works great. So basically, I need to create a variable using math.random BEFORE I tell it what it's parent is?
Yea, sure.