Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

All barrels firing at once?

Asked by 5 years ago
Edited 5 years ago

Hello,

Im trying to get the 4 barrels of my cannon to work, display the particle effects, etc however, I can only get one to work.

Kindly redirect me?

local function CreateBullet(v)
    local Mouse = Player:GetMouse()
    if Active then
        for _,Cannons in pairs(Vehicleseat.Parent.Barrels.MuzzleFlash:GetChildren()) do
            BarrelFlashEvent:FireServer(Vehicleseat.Parent.Barrels)
            Vehicleseat.Parent.Barrels.MuzzleFlash:FindFirstChild("Fire".. math.random(3)):Play()
            RayGunEvent:FireServer(ConfigFolder.Bullets, Mouse.Hit.p, Vehicleseat.Parent.Barrels, BrickColor.new("Bright yellow"))
        end
    end 
end 

The three RemoteEvents I hope are self explanatory but ya, I can only get one barrel to fire particles and sound.

0
Can you give more information (such as photos or workspace, other scripts, etc.) of this? It would help to see how everything is set up. lazycoolboy500 597 — 5y
0
Hierarchy is Model>Barrels>MuzzleFlash. BarrelFlashEvent only makes particles appear. RaygunEvent makes the raycast for MuzzleFlash. Yep thats it, pretty simple. Decimaprism 65 — 5y

Answer this question