Advertisement
IHATEMICROWAVEOVEN

short melee

Apr 11th, 2023 (edited)
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. -- EASE OF ACCESS SETTINGS
  2. local inColor = Color3.new(0.6, 0.95, 0.9)
  3. local outColor = Color3.new(0.6, 0.6, 0.65)
  4. local inTrans = 0.4
  5. local outTrans = 0.7
  6. local inSize = Vector3.new(6, 6, 6)
  7. local outSize = Vector3.new(7, 7, 7)
  8. local inMaterial = "SmoothPlastic"
  9. local outMaterial = "SmoothPlastic"
  10.  
  11. local baseDamage = 60
  12. local lifetime = 2
  13.  
  14. local foo = task
  15.  
  16. --[[
  17.  
  18. Below is the attack function.
  19.  
  20. DESC: Basic melee.
  21.  
  22. --]]
  23. local function Use(...)
  24. local args = {...}
  25. local char = args[1].Character
  26. local torso = char.Torso
  27. local damage = math.random(1, 10) == 1 and baseDamage*2 or baseDamage
  28.  
  29. -- Part creation
  30. local inner = Instance.new("Part")
  31. inner.Color, inner.Size, inner.Transparency, inner.Material, inner.Massless, inner.CanCollide, inner.CFrame =
  32. inColor, inSize, inTrans, inMaterial, true, false, torso.CFrame
  33. inner.Parent = workspace
  34. local outer = Instance.new("Part")
  35. outer.Color, outer.Size, outer.Transparency, outer.Material, outer.Massless, outer.CanCollide, outer.CFrame =
  36. outColor, outSize, outTrans, outMaterial, true, false, torso.CFrame
  37. outer.Parent = workspace
  38.  
  39. local oplib = require(game.ServerScriptService.Libraries.Optimalization)
  40. oplib(outer)
  41.  
  42. local weld = Instance.new("Weld")
  43. weld.Part0, weld.Part1 =
  44. torso, inner
  45. weld.Parent = inner
  46. weld = Instance.new("Weld")
  47. weld.Part0, weld.Part1 =
  48. torso, outer
  49. weld.Parent = outer
  50.  
  51.  
  52.  
  53. -- Speed and DMG
  54. local hum = char.Humanoid
  55. local Stats = require(game:GetService("ServerScriptService").Stats)
  56. local myLevel = Stats.GetStat(args[1], char.BaseStat.Value)
  57. local mySpeed = char.BaseSpeed
  58. coroutine.wrap(function()
  59. for i = 0, lifetime * 10 do
  60. hum.WalkSpeed = mySpeed.Value*2 * (myLevel*0.0025 + 0.25)
  61. foo.wait(0.1)
  62. end
  63. hum.WalkSpeed = mySpeed.Value * (myLevel*0.0025 + 0.25)
  64. end)()
  65. local Debris = game:GetService("Debris")
  66. local DamageMod = require(game:GetService("ServerScriptService").Libraries.DamageService)
  67. DamageMod:RegisterWeaponPart(args[1], {inner, outer}, damage)
  68. Debris:AddItem(inner, lifetime)
  69. Debris:AddItem(outer, lifetime)
  70. end
  71.  
  72. return Use
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement