Advertisement
IHATEMICROWAVEOVEN

example1

Sep 27th, 2021
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. local awesomeprojectileO = game.ServerStorage.Items.SickProjecitle
  2. -- This does not actually exist in the game's code. I assume that
  3. -- I have a cool projectile with ideal traits, such as CanCollide
  4. -- set to false, Anchored set to false, etc., just for example.
  5.  
  6. function Use(...)
  7. local args = {...}
  8. local awesomeprojectile = awesomeprojectileO:Clone()
  9. awesomeprojectile.Parent = game.Workspace
  10.  
  11. awesomeprojectile.CFrame = args[1].CFrame * CFrame.new(0,50,0)
  12. -- The projectile's position and rotation are set to match that
  13. -- of the boss, so they overlap perfectly. Then, it shifts 50
  14. -- studs in the y-direction. It is now 50 studs above the boss.
  15.  
  16. awesomeprojectile.CFrame = awesomeprojectile.CFrame * CFrame.Angles(math.rad(90),0,0)
  17. -- The projectile's position and rotation are maintained. Then,
  18. -- it rotates 90 degrees along the x-axis, similar to a top rotating
  19. -- around its center. It is now facing in the direction I want.
  20.  
  21. local bv = Instance.new("BodyVelocity", awesomeprojectile)
  22. bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  23. bv.Velocity = args[3]
  24. -- velocity shenans. Unrelated.
  25. end
  26.  
  27. return Use
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement