Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local awesomeprojectileO = 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 = {...}
- local awesomeprojectile = awesomeprojectileO:Clone()
- awesomeprojectile.Parent = game.Workspace
- awesomeprojectile.CFrame = args[1].CFrame * CFrame.new(0,50,0)
- -- The projectile's position and rotation are set to match that
- -- of the boss, so they overlap perfectly. Then, it shifts 50
- -- studs in the y-direction. It is now 50 studs above the boss.
- awesomeprojectile.CFrame = awesomeprojectile.CFrame * CFrame.Angles(math.rad(90),0,0)
- -- The projectile's position and rotation are maintained. Then,
- -- it rotates 90 degrees along the x-axis, similar to a top rotating
- -- around its center. It is now facing in the direction I want.
- local bv = Instance.new("BodyVelocity", awesomeprojectile)
- bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- bv.Velocity = args[3]
- -- velocity shenans. Unrelated.
- end
- return Use
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement