of     1   

1Juice1
#140881963Saturday, July 19, 2014 9:55 PM GMT

I'm trying to make this gun fire 3 different bullets in a slightly random direction, and I have no idea how. Here is the fire script: local Tool = script.Parent enabled = true function fire(v) local vCharacter = Tool.Parent local vPlayer = game.Players:playerFromCharacter(vCharacter) local Torso = vCharacter.Torso local spawnPos = Torso.Position spawnPos = spawnPos + (v * 3) for i = 1,3 do local missile = Instance.new("Part") missile.Position = spawnPos missile.Size = Vector3.new(0.6,0.6,0.6) missile.Velocity = v * 300 missile.BrickColor = BrickColor.new("Dark stone grey") missile.Shape = "Ball" missile.BottomSurface = "Smooth" missile.TopSurface = "Smooth" missile.Name = "Bullet" missile.Elasticity = 0 missile.Reflectance = 0 missile.Friction = .9 missile.Parent = game.Workspace local DmgScript = script.Parent.BulletDamage:Clone() DmgScript.Disabled = false DmgScript.Parent = missile local Delay = script.Parent.DelayedRemover:Clone() Delay.Disabled = false Delay.Parent = missile local force = Instance.new("BodyForce") force.force = Vector3.new(0,100,0) force.Parent = missile end end function onActivate() if enabled == true then enabled = false local character = Tool.Parent local humanoid = character.Humanoid local targetPos = humanoid.TargetPoint local lookAt = (targetPos - character.Head.Position).unit script.Parent.Handle.Sound:Play() fire(lookAt) wait(0.6) enabled = true end end script.Parent.Activated:connect(onActivate)
LegendaryAccount
#140882035Saturday, July 19, 2014 9:56 PM GMT

wrong thread go to scripter helpers
1Juice1
#140882198Saturday, July 19, 2014 9:57 PM GMT

This is scripting helpers...
LegendaryAccount
#140882490Saturday, July 19, 2014 10:00 PM GMT

use a = math.random(10) bullet.rotation = vector.new(a,a,a) this should work if the body force goes in the direction it is facing
LegendaryAccount
#140882562Saturday, July 19, 2014 10:01 PM GMT

Sorry I thought this was atr
1Juice1
#140882650Saturday, July 19, 2014 10:01 PM GMT

Honest mistake, it's okay. I'm testing it right now.
LegendaryAccount
#140883207Saturday, July 19, 2014 10:07 PM GMT

put the varible inside the for loop
LegendaryAccount
#140883422Saturday, July 19, 2014 10:09 PM GMT

and I forgot to cap some things like vector

    of     1