I am trying to recreate the flamethrower from the classic brickbattle games and I’ve got it to clone a part but it just keeps repositioning the same clone
So basically I need to make many clones of one part
this is my current code
tool = script.Parent
on = false
spoor = tool.Handle.gas
counter = tool.Handle.SurfaceGui.TextLabel.Text
flames = game.ReplicatedStorage.flava:Clone()
ammo = 200
tool.Activated:Connect(function()
if on == false then
on = true
repeat
boom()
task.wait()
until on == false
print(on)
elseif on == true then
on = false
print(on)
end
end)
tool.Unequipped:Connect(function()
on = false
end)
tool.Activated:Connect(function()
end)
flames.Touched:Connect(function(guy)
if guy:IsA("Humanoid") then
guy.Health -= 8
end
end)
function boom()
if ammo > 1 then
flames.Color = Color3.fromRGB(math.random(160,255), math.random(60,100),0)
flames.Position = spoor.Position
flames.Orientation = spoor.Orientation
flames.Parent = workspace
ammo -= 1
tool.Handle.SurfaceGui.TextLabel.Text = ammo
wait(.1)
end
end
also the damage part doesn’t work but dslkfjsdklfsdkhfohefhrgjk