Advertisement
IHATEMICROWAVEOVEN

short projectile

Apr 11th, 2023
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. -- EASE OF ACCESS SETTINGS
  2. local color = Color3.new(0.6, 1, 1)
  3. local trans = 0.8
  4. local size = Vector3.new(14, 14, 14)
  5. local material = "Neon"
  6. local lifetime = 5
  7.  
  8. local baseDamage = 70
  9.  
  10. --[[
  11.  
  12. Below is the attack function.
  13.  
  14. DESC: Basic projectile.
  15.  
  16. --]]
  17. local function Use(...)
  18. local args = {...}
  19. local damage = math.random(1, 10) == 1 and baseDamage*2 or baseDamage
  20.  
  21. -- Projectile itself
  22. local part = Instance.new("Part")
  23. part.Color, part.Transparency, part.Size, part.Material, part.CanCollide, part.CFrame =
  24. color, trans, size, material, false, args[1].Character.Torso.CFrame * CFrame.new(Vector3.new(0, 0, -7))
  25. part.Parent = workspace
  26. local sparkles = Instance.new("Sparkles")
  27. sparkles.SparkleColor, sparkles.Enabled =
  28. Color3.new(0.6, 1, 1)
  29. sparkles.Parent = part
  30. local light = Instance.new("PointLight")
  31. light.Brightness, light.Range, light.Color, light.Enabled, light.Shadows =
  32. 8, 8, Color3.new(0.2, 0.6, 0.7), true, false
  33. light.Parent = part
  34.  
  35.  
  36.  
  37. -- Movement shenans and damage
  38. local att0 = Instance.new("Attachment", part)
  39. local bv = Instance.new("LinearVelocity")
  40. bv.Attachment0, bv.MaxForce, bv.VectorVelocity =
  41. att0, math.huge, args[3]
  42. bv.Parent = part
  43.  
  44. local bg = Instance.new("AlignOrientation", part)
  45. local sub = Instance.new("Part")
  46. local att1 = Instance.new("Attachment", sub)
  47. sub.CanCollide, sub.Anchored, sub.Transparency =
  48. false, true, 1
  49. sub.Parent = workspace
  50. bg.Attachment0, bg.Attachment1, bg.Mode, bg.MaxTorque =
  51. att0, att1, Enum.OrientationAlignmentMode.TwoAttachment, math.huge
  52.  
  53. local DamageMod = require(game.ServerScriptService.Libraries.DamageService)
  54. DamageMod:RegisterWeaponPart(args[1], {part}, damage)
  55. game:GetService("Debris"):AddItem(part, lifetime)
  56. game:GetService("Debris"):AddItem(sub, lifetime)
  57. end
  58.  
  59. return Use
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement