So... I want to make a Flamethrower, which burns parts, and breaks the joints of models stuck together, like a mech. And umm, I already got the basis of the flamethrower and the joint breaker, but, I can't seem to apply the joint breaker to the flames that the script makes the fire... Can anyone help me?
switch = script.Parent
on = switch.isOn
bin = switch.Parent
spawn = bin.Pilot
deb = false
switch.BrickColor = BrickColor.new("Bright red")
on.Value = false
while true do
wait(0.1)
if on.Value == true then
p = Instance.new("Part")
p.Name = "Fire"
p.Size = Vector3.new(3,3,3)
p.Shape = "Ball"
p.TopSurface = "Smooth"
p.BottomSurface = "Smooth"
p.Transparency = 0.5
p.Anchored = false
p.CanCollide = false
p.CFrame = spawn.CFrame
script.Move:Clone().Parent = p
---
rand = math.random(1,3)
if rand == 1 then p.BrickColor = BrickColor.new("Bright red")
elseif rand == 2 then p.BrickColor = BrickColor.new("Bright orange")
elseif rand == 3 then p.BrickColor = BrickColor.new("Bright yellow")
end
---
function onTouched(part)
part:BreakJoints()
end
---
script.Parent.Touched:connect(onTouched) -- This is the bit I'm stuck on
---
p.Parent = game.Workspace
end
end
Thanks!
