Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This one, I will be simply making four projectiles shoot from
- -- around the boss. Right, backwards, left, forward, in that
- -- order. (This will be done using a "for" loop)
- local cooolerprojectileO = game.ServerStorage.Items.SickProjecitle
- -- This does not actually exist in the game's code. I assume that
- -- I have a cool projectile with ideal traits, such as CanCollide
- -- set to false, Anchored set to false, etc., just for example.
- function Use(...)
- local args = {...}
- for i = 1,4 do
- local coolerprojectile = cooolerprojectileO:Clone()
- coolerprojectile.Parent = game.Workspace
- coolerprojectile.CFrame = args[1].CFrame
- -- We want the projectile to align with the boss, since it
- -- will shoot from the boss.
- coolerprojectile.CFrame = coolerprojectile.CFrame * CFrame.Angles(0,math.rad(i*90),0)
- -- The projectile is rotated 90 degrees clockwise. Depending
- -- on which projectile number it is, the rotation will be
- -- more "extreme". It forms a + (plus) shape if you take an
- -- image of when they all spawn.
- -- (first at 90 deg, second at 180 deg, third at 270 deg, fourth at 360 deg aka 0 deg)
- local bv = Instance.new("BodyVelocity", awesomeprojectile)
- bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- bv.Velocity = coolerprojectile.CFrame.lookVector * 50
- -- Velocity shenans. You may notice that we use CFrame.lookVector!
- -- CFrame.lookVector is the direction that the CFrame is facing in,
- -- and it is exactly 1 stud in magnitude (basically "length").
- -- If you multiply it by 90 then it will be a vector that
- -- extends 90 studs in the direction that the subject is facing!
- -- This makes the projectile travel forward at 90 studs per second.
- end
- end
- return Use
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement