Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- BELOW IS THE CLIENT SCRIPT. [menacing]
- -- BELOW IS THE CLIENT SCRIPT. [menacing]
- -- BELOW IS THE CLIENT SCRIPT. [menacing]
- -- BELOW IS THE CLIENT SCRIPT. [menacing]
- -- BELOW IS THE CLIENT SCRIPT. [menacing]
- -- SETTINGS
- local reload = 9
- local name = "DragonHammer"
- -- SCRIPT
- local debounce = true
- function Use(plr, device, CS, CWS)
- if debounce then
- debounce = false
- CWS("RunWeapon", name)
- task.wait(0.5)
- debounce = true
- end
- end
- return {Use, reload}
- -- BELOW IS THE SERVER SCRIPT. [menacing]
- -- BELOW IS THE SERVER SCRIPT. [menacing]
- -- BELOW IS THE SERVER SCRIPT. [menacing]
- -- BELOW IS THE SERVER SCRIPT. [menacing]
- -- BELOW IS THE SERVER SCRIPT. [menacing]
- -- EASE OF ACCESS SETTINGS
- local inColor = Color3.new(0.2, 0.2, 0.6)
- local outColor = Color3.new(0.7, 0, 0.7)
- local inTrans = 0
- local outTrans = 0.5
- local inSize = Vector3.new(7, 7, 7)
- local outSize = Vector3.new(10, 10, 10)
- local inMaterial = "SmoothPlastic"
- local outMaterial = "SmoothPlastic"
- local secColor = Color3.new(0.1, 0.17, 0.21)
- local secMaterial = "Glass"
- local secSize = Vector3.new(9, 9, 9)
- local baseDamage = 90
- local lifetime = 2
- -- Lifetime of part 2 is 50% of this
- local foo = task
- --[[
- Below is the attack function.
- DESC: Melee with two parts. First part initiates a stun on hit players (they drop to the ground instead of being
- anchored, however). Second part provides greatly increased speed for a brief period and deals damage.
- --]]
- local function Use(...)
- local args = {...}
- local char = args[1].Character
- local torso = char.Torso
- local damage = math.random(1, 10) == 1 and baseDamage*2 or baseDamage
- -- Part creation
- local inner = Instance.new("Part")
- inner.Color, inner.Size, inner.Transparency, inner.Material, inner.Massless, inner.CanCollide, inner.CFrame =
- inColor, inSize, inTrans, inMaterial, true, false, torso.CFrame
- inner.Parent = workspace
- local outer = Instance.new("Part")
- outer.Color, outer.Size, outer.Transparency, outer.Material, outer.Massless, outer.CanCollide, outer.CFrame =
- outColor, outSize, outTrans, outMaterial, true, false, torso.CFrame
- outer.Parent = workspace
- local oplib = require(game.ServerScriptService.Libraries.Optimalization)
- oplib(outer)
- local weld = Instance.new("Weld")
- weld.Part0, weld.Part1 =
- torso, inner
- weld.Parent = inner
- weld = Instance.new("Weld")
- weld.Part0, weld.Part1 =
- torso, outer
- weld.Parent = outer
- -- Speed and attack part 1
- local hum = char.Humanoid
- local Stats = require(game:GetService("ServerScriptService").Stats)
- local myLevel = Stats.GetStat(args[1], char.BaseStat.Value)
- local mySpeed = char.BaseSpeed
- coroutine.wrap(function()
- for i = 0, lifetime * 10 do
- hum.WalkSpeed = mySpeed.Value*0.5 * (myLevel*0.01 + 1)
- task.wait(0.1)
- end
- hum.WalkSpeed = mySpeed.Value*0.25 * (myLevel*0.01 + 1)
- end)()
- -- PART 1 of attack ("stun")
- local last = nil -- stores last hit player by first part
- local DamageMod = require(game:GetService("ServerScriptService").Libraries.DamageService)
- DamageMod:RegisterWeaponPart(args[1], {inner, outer}, 0, function(hit)
- if hit:IsA("Player") then
- last = hit
- local hitChar = hit.Character
- Stats.SetStat(hit, "SLP", 1)
- local saveBS = hitChar.BaseSpeed.Value
- local saveJP = hitChar.Humanoid.JumpPower
- hitChar.BaseSpeed.Value = 0
- hitChar.Humanoid.JumpPower = 0
- hitChar.Humanoid.WalkSpeed = 0
- foo.wait(4)
- hitChar.BaseSpeed.Value += saveBS
- hitChar.Humanoid.JumpPower += saveJP
- hitChar.Humanoid.WalkSpeed = saveBS*0.25 * (Stats.GetStat(hit, hitChar.BaseStat.Value)*0.01 + 1)
- Stats.SetStat(hit, "SLP", 0)
- else
- DamageMod:RegisterDamage(args[1], hit, damage)
- end
- end)
- foo.wait(lifetime)
- inner:Destroy()
- outer:Destroy()
- -- If you hit something, then it's time for part 2 (damage)
- if last then
- foo.wait(0.7)
- mySpeed.Value *= 3
- hum.WalkSpeed = mySpeed.Value*0.25 * (myLevel*0.01 + 1)
- local sec = Instance.new("Part")
- sec.Color, sec.Size, sec.Transparency, sec.Material, sec.Massless, sec.CanCollide, sec.CFrame =
- secColor, secSize, 0, secMaterial, true, false, torso.CFrame
- sec.Parent = workspace
- weld = Instance.new("Weld")
- weld.Part0, weld.Part1 =
- torso, sec
- weld.Parent = sec
- local Debris = game:GetService("Debris")
- DamageMod:RegisterWeaponPart(args[1], {sec}, damage, function(hit)
- local explosion = Instance.new("Explosion", args[1].Character)
- local hitTorso = hit:FindFirstChild("Character") and hit.Character.Torso or hit.Torso
- explosion.DestroyJointRadiusPercent, explosion.BlastPressure, explosion.Position =
- 0, 0, hitTorso.Position
- Debris:AddItem(explosion, 1)
- end)
- foo.wait(lifetime*.5)
- mySpeed.Value /= 3
- hum.WalkSpeed = mySpeed.Value*0.25 * (myLevel*0.01 + 1)
- sec:Destroy()
- end
- end
- return Use
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement