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.

2 comments

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.

0

Hierarchy is Model>Barrels>MuzzleFlash. BarrelFlashEvent only makes particles appear. RaygunEvent makes the raycast for MuzzleFlash. Yep thats it, pretty simple.