Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function OnClick(player)
- if player then
- if not player.Backpack:findFirstChild("Gear") then
- script.Gear:Clone().Parent = player.Backpack
- end
- end
- end
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local Folder = script:WaitForChild("Events")
- local ODMGEvent = Folder:WaitForChild("EquipODMG")
- local ReloadEvent = Folder:WaitForChild("BladeReload")
- local DropBlades = Folder:WaitForChild("DropBlades")
- local AttackingEvent = Folder:WaitForChild("AttackingEvent")
- local Player = game:GetService("Players").LocalPlayer
- local Character = Player.Character
- local Mouse = Player:GetMouse()
- local UserInputService = game:GetService("UserInputService")
- ODMGEvent:FireServer()
- wait(1)
- local Speed = script.Config.Speed.Value
- local GasLeft = script.Config.GasLeft.Value
- local BladesLeft = script.Config.BladesLeft.Value
- local Blades = false
- local mouse = Player:GetMouse()
- local canAttack = false
- local attackDebounce = false
- local leftBlade = Character["Left Arm"]:waitForChild("Blade")
- local rightBlade = Character["Right Arm"]:waitForChild("Blade")
- local BladesGui = script.BladeGui:Clone()
- BladesGui.Parent = Player.PlayerGui
- local TextL = BladesGui.TextLabel
- TextL.Text = "Blades: "..BladesLeft
- local GasGui = script.GasGui:Clone()
- GasGui.Parent = Player.PlayerGui
- local TextLa = GasGui.TextLabel
- TextLa.Text = "Gas: "..GasLeft
- local player = game.Players.LocalPlayer
- local mouse = player:GetMouse()
- local cannotGrappleon = {
- Baseplate = true,
- ["HumanoidRootPart"] = true,
- Hill1 = true,
- Hill2 = true,
- Hill3 = true,
- Hill4 = true,
- Hill5 = true,
- Hill = true,
- ground = true,
- path = true,
- flat = true,
- BasePlate = true,
- Terrain = true,
- }
- local hatsfixed = {}
- local function MassUpdate(child)
- if child then if child:IsA("StringValue") then return end end
- for n,i in pairs(hatsfixed) do if i == child then return end end
- local Mass = 0
- for n,i in pairs(Character:GetChildren()) do
- if i:IsA("Part") then
- Mass = Mass + i:GetMass()
- elseif i:IsA("Hat") then
- hatsfixed[#hatsfixed+1] = i
- i.Parent = game.Lighting
- i.Handle.FormFactor = "Custom"
- i.Handle.Size = Vector3.new(.2,.2,.2)
- i.Parent = Character
- end
- end
- end
- local Stalling = false
- local StallingDistance = 0
- local StallingDirectionDown = false
- local StallingDirectionUp = false
- local Anim = Character.Humanoid:LoadAnimation(script.Animations.Grapple)
- local LAnim = Character.Humanoid:LoadAnimation(script.Animations.LGrapple)
- local RAnim = Character.Humanoid:LoadAnimation(script.Animations.RGrapple)
- local B1 = Character.Humanoid:LoadAnimation(script.Animations.Break1)
- local B2 = Character.Humanoid:LoadAnimation(script.Animations.Break2)
- local Gas = false
- local DriftEnabled = false
- local JumpRecoil = 2
- local DriftRight = false
- local DriftLeft = false
- local Force = 5000
- local CastSpeed = 4
- local RecoilTime = 4.5
- local RefillAnim = 4710657238 --When you are refilling at the "Refiller", change the number to your animation id.
- local RightGoal = CFrame.new()
- local LeftGoal = CFrame.new()
- local RightGoalLocal = CFrame.new()
- local LeftGoalLocal = CFrame.new()
- local RightGoalTarget = nil
- local LeftGoalTarget = nil
- local RightFirePosition = CFrame.new(1.05001497, -0.824505806, -0.600113869)
- local LeftFirePosition = CFrame.new(-1.04998493, -0.824505806, -0.600113869)
- local Velocity = Instance.new("BodyVelocity")
- Velocity.Name = "Velocity"
- Velocity.P = 20000
- Velocity.maxForce = Vector3.new()
- Velocity.Parent = Character.HumanoidRootPart
- local Rotation = Instance.new("BodyGyro")
- Rotation.Name = "Rotation"
- Rotation.P = 5000
- Rotation.maxTorque = Vector3.new()
- Rotation.D = 500
- Rotation.Parent = Character.HumanoidRootPart
- local RGrappleBool = Instance.new("BoolValue",Character)
- RGrappleBool.Name = "Right Grapple"
- RGrappleBool.Value = false
- local RGoalVal = Instance.new("Vector3Value",RGrappleBool)
- RGoalVal.Name = "RightGoal"
- local LGrappleBool = Instance.new("BoolValue",Character)
- LGrappleBool.Name = "Left Grapple"
- LGrappleBool.Value = false
- local LGoalVal = Instance.new("Vector3Value",LGrappleBool)
- LGoalVal.Name = "LeftGoal"
- local GrappleBin = Instance.new("Model",workspace.CurrentCamera)
- GrappleBin.Name = "Grapples"
- game.Players.LocalPlayer:GetMouse().TargetFilter = GrappleBin
- local RightGrapple = Instance.new("Part",GrappleBin)
- RightGrapple.Name = "Right Grapple"
- RightGrapple.BrickColor = BrickColor.new("Really black")
- RightGrapple.Anchored = true
- RightGrapple.FormFactor = Enum.FormFactor.Custom
- RightGrapple.Transparency = 1
- RightGrapple.CanCollide = false
- local RightMesh = Instance.new("BlockMesh",RightGrapple)
- RightMesh.Scale = Vector3.new(0.05,0.05,1)
- local LeftGrapple = Instance.new("Part",GrappleBin)
- LeftGrapple.Name = "Left Grapple"
- LeftGrapple.BrickColor = BrickColor.new("Really black")
- LeftGrapple.Anchored = true
- LeftGrapple.FormFactor = Enum.FormFactor.Custom
- LeftGrapple.Transparency = 1
- LeftGrapple.CanCollide = false
- local LeftMesh = Instance.new("BlockMesh",LeftGrapple)
- LeftMesh.Scale = Vector3.new(0.05,0.05,1)
- local Frl = Instance.new("Part",Character)
- Frl.Name = "FakeRL"
- Frl.Size = Vector3.new(1,2,1)
- Frl.Transparency = 1
- Frl.BottomSurface = "Smooth"
- Frl.TopSurface = "Smooth"
- Frl.CanCollide = false
- local FrlWeld = Instance.new("ManualWeld",Frl)
- FrlWeld.Part0 = Character["Right Leg"]
- FrlWeld.Part1 = Frl
- local Fll = Instance.new("Part",Character)
- Fll.Name = "FakeLL"
- Fll.Size = Vector3.new(1,2,1)
- Fll.Transparency = 1
- Fll.BottomSurface = "Smooth"
- Fll.TopSurface = "Smooth"
- Fll.CanCollide = false
- local FllWeld = Instance.new("ManualWeld",Fll)
- FllWeld.Part0 = Character["Left Leg"]
- FllWeld.Part1 = Fll
- local Keys = {}
- local Keys2 = {}
- local grappleevent = script:WaitForChild("Grapple")
- local function CastRightGrapple(Goal,Part)
- grappleevent:FireServer()
- Keys2["e"] = nil
- local Point = Vector3.new()
- local LoopNo = 0
- RightGrapple.Transparency = 0
- local Goal2 = Goal.p
- repeat
- game:GetService("RunService").RenderStepped:wait()
- if not Part then break end
- if not Part.Parent then break end
- LoopNo = LoopNo+1
- local FirePos = (Character.HumanoidRootPart.CFrame*RightFirePosition).p
- local Progression = LoopNo/((Goal2-FirePos).magnitude/CastSpeed)
- if Progression > 1 then Progression = 1 end
- local Point = FirePos+(Goal2-FirePos)*Progression
- RightGrapple.Size = Vector3.new(1, 1, (FirePos-Point).magnitude)
- RightGrapple.CFrame = CFrame.new(FirePos+(Point-FirePos)/2, Goal2)
- until(Point-Goal2).magnitude < 5 or not Keys["e"]
- Keys2["e"] = true
- if not Keys["e"] then Keys2["e"] = false return false end
- return true
- end
- CanRefill = true
- Character.Torso.Touched:connect(function(part)
- local CheckVal = part:FindFirstChild("GasRefiller")
- local Part = part
- if CanRefill ==true then
- if CheckVal ~= nil and CheckVal.Value == true then
- GasLeft = 5000
- BladesLeft = 8
- TextLa.Text = "Gas: "..GasLeft
- TextL.Text = "Blades: "..BladesLeft
- CanRefill = false
- Character.HumanoidRootPart.Anchored = true
- Character.Humanoid.WalkSpeed = 0
- Character.Humanoid.JumpPower = 0
- spawn(function()
- local Anim = Instance.new("Animation")
- Anim.AnimationId = "rbxassetid://"..RefillAnim
- Anim.Parent = Character
- local AnimationTrek = Character.Humanoid:LoadAnimation(Anim)
- AnimationTrek:Play()
- AnimationTrek.Stopped:connect(function()
- Anim:Destroy()
- AnimationTrek:Destroy()
- end)
- end)
- wait(4)
- Character.HumanoidRootPart.Anchored = false
- Character.Humanoid.WalkSpeed = 15
- Character.Humanoid.JumpPower = 65
- print("Gas Refilled!!")
- GasLeft = 5000
- wait(3)
- CanRefill = true
- end
- end
- end)
- local function CastLeftGrapple(Goal,Part)
- Keys2["q"] = nil
- local Point = Vector3.new()
- local LoopNo = 0
- LeftGrapple.Transparency = 0
- local Goal2 = Goal.p
- repeat
- game:GetService("RunService").RenderStepped:wait()
- if not Part then break end
- if not Part.Parent then break end
- Goal2 = (LeftGoalTarget.CFrame*(LeftGoalLocal:inverse())).p
- LoopNo = LoopNo+1
- local FirePos = (Character.HumanoidRootPart.CFrame*LeftFirePosition).p
- local Progression = LoopNo/((Goal2-FirePos).magnitude/CastSpeed)
- if Progression > 1 then Progression = 1 end
- local Point = FirePos+(Goal2-FirePos)*Progression
- LeftGrapple.Size = Vector3.new(1, 1, (FirePos-Point).magnitude)
- LeftGrapple.CFrame = CFrame.new(FirePos+(Point-FirePos)/2, Goal2)
- until (Point-Goal2).magnitude < 5 or not Keys["q"]
- Keys2["q"] = true
- if not Keys["q"] then Keys2["q"] = false return false end
- return true
- end
- Mouse.KeyDown:connect(function(key)
- if key == "r" and Blades == false then
- if BladesLeft <= 0 then return end
- local ChangeBlade = Character.Humanoid:LoadAnimation(script.Animations.ChangeBlade)
- ChangeBlade:Play()
- BladesLeft = BladesLeft - 1
- print(BladesLeft)
- TextL.Text = "Blades: "..BladesLeft
- wait(.5)
- ReloadEvent:FireServer()
- Blades = true
- canAttack = true
- elseif key == "r" and Blades == true then
- DropBlades:FireServer()
- canAttack = false
- wait(1)
- Blades = false
- end
- end)
- UserInputService.InputBegan:connect(function(Input, GME)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 then
- if not GME and canAttack then
- if not attackDebounce then
- attackDebounce = true
- local AnimRandom = math.random(1,2)
- if AnimRandom == 1 then
- local AttackAnim = Character.Humanoid:LoadAnimation(script.Animations.AttackAnim)
- AttackAnim:Play()
- AttackingEvent:FireServer()
- wait(1)
- attackDebounce = false
- elseif AnimRandom == 2 then
- AttackingEvent:FireServer()
- local AttackAnim2 = Character.Humanoid:LoadAnimation(script.Animations.AttackAnim2)
- AttackAnim2:Play()
- AttackingEvent:FireServer()
- wait(1)
- attackDebounce = false
- end
- end
- end
- end
- end)
- local Mouse = game:GetService("Players").LocalPlayer:GetMouse()
- SpaceButtonDown = false
- Mouse.KeyDown:connect(function(key)
- if key == " " then
- SpaceButtonDown = true
- if DriftEnabled == true then
- repeat
- wait(0.05)
- if GasLeft > 0 then
- GasLeft = GasLeft -1
- TextLa.Text = "Gas: "..GasLeft
- print(GasLeft)
- end
- until SpaceButtonDown == false
- end
- end
- end)
- Mouse.KeyUp:connect(function(key)
- if key == " " then
- SpaceButtonDown = false
- Character.Torso.DESTROY:Destroy()
- end
- end)
- local Kd = game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(k)
- if k == "e" and GasLeft > 0.00 then
- if (game.Players.LocalPlayer:GetMouse().Hit.p-Character.HumanoidRootPart.Position).magnitude > 700 then RightGoal = Vector3.new() return end
- local targ,hit = mouse.Target,mouse.Hit
- if targ then
- if cannotGrappleon[targ.Name] then
- print("cannot grapple")
- return end
- end
- Character.Humanoid.PlatformStand = true
- DriftEnabled = true
- Anim:Play()
- a = Instance.new("Sound")
- a.SoundId = "http://www.roblox.com/asset/?id=193202512"
- a.Volume = 3
- a.Pitch = 1
- a.Parent = Character.HumanoidRootPart
- a:play()
- GasLeft = GasLeft - 1
- TextLa.Text = "Gas: "..GasLeft
- game.Debris:AddItem(a,0.5)
- Frl.CanCollide = true
- Fll.CanCollide = true
- RightGoal = CFrame.new(game.Players.LocalPlayer:GetMouse().Hit.p)
- RightGoalLocal = RightGoal:inverse()*game.Players.LocalPlayer:GetMouse().Target.CFrame
- RightGoalTarget = game.Players.LocalPlayer:GetMouse().Target
- Keys["e"] = true
- Velocity.maxForce = Vector3.new(Force, Force, Force)
- Rotation.maxTorque = Vector3.new(Force, Force, Force)
- for i = 1,5 do
- game.Workspace.CurrentCamera.FieldOfView = (70+(i*2))
- wait()
- end
- local ret = CastRightGrapple(RightGoal,game.Players.LocalPlayer:GetMouse().Target)
- if not ret then return end
- elseif k == "q" and GasLeft > 0.00 then
- if (game.Players.LocalPlayer:GetMouse().Hit.p-Character.HumanoidRootPart.Position).magnitude > 700 then LeftGoal = Vector3.new() return end
- local targ,hit = mouse.Target,mouse.Hit
- if targ then
- if cannotGrappleon[targ.Name] then
- print("cannot grapple")
- return end
- end
- Character.Humanoid.PlatformStand = true
- DriftEnabled = true
- Anim:Play()
- a = Instance.new("Sound")
- a.SoundId = "http://www.roblox.com/asset/?id=193202512"
- a.Volume = 3
- a.Pitch = 1
- a.Parent = Character.HumanoidRootPart
- a:play()
- GasLeft = GasLeft - 1
- TextLa.Text = "Gas: "..GasLeft
- game.Debris:AddItem(a,0.5)
- Frl.CanCollide = true
- Fll.CanCollide = true
- LeftGoal = CFrame.new(game.Players.LocalPlayer:GetMouse().Hit.p)
- LeftGoalLocal = LeftGoal:inverse()*game.Players.LocalPlayer:GetMouse().Target.CFrame
- LeftGoalTarget = game.Players.LocalPlayer:GetMouse().Target
- Keys["q"] = true
- Velocity.maxForce = Vector3.new(Force, Force, Force)
- Rotation.maxTorque = Vector3.new(Force, Force, Force)
- for i = 1,5 do
- game.Workspace.CurrentCamera.FieldOfView = (70+(i*2))
- wait()
- end
- local ret = CastLeftGrapple(LeftGoal,game.Players.LocalPlayer:GetMouse().Target)
- if not ret then return end
- elseif k == " " and DriftEnabled then
- a2 = Instance.new("Sound")
- a2.Name = "DESTROY"
- a2.SoundId = "http://www.roblox.com/asset/?id=378270721"
- a2.Volume = 1
- a2.Pitch = 1
- a2.Parent = Character.Torso
- a2.Looped = true
- a2:Play()
- Gas = true
- Character.Torso.Ejector.Gas.Enabled = true
- elseif k == "d" and DriftEnabled == true then
- DriftRight = true
- a = Instance.new("Sound")
- a.SoundId = "http://www.roblox.com/asset/?id=378283155"
- a.Volume = 1
- a.Pitch = 1
- a.Parent = Character.HumanoidRootPart
- a:play()
- Character.Torso.Ejector.Gas.Enabled = true
- wait(0.2)
- Character.Torso.Ejector.Gas.Enabled = false
- RAnim:Play()
- elseif k == "a" and DriftEnabled == true then
- DriftLeft = true
- a = Instance.new("Sound")
- a.SoundId = "http://www.roblox.com/asset/?id=378283155"
- a.Volume = 1
- a.Pitch = 1
- a.Parent = Character.Torso
- a:play()
- LAnim:Play()
- elseif k == " " and DriftEnabled and GasLeft > 0.00 then
- Gas = true
- a2 = Instance.new("Sound")
- a2.Name = "DESTROY"
- a2.SoundId = "http://www.roblox.com/asset/?id=378270721"
- a2.Volume = 1
- a2.Pitch = 1
- a2.Parent = Character.Torso
- a2.Looped = true
- a2:Play()
- Character.Torso.Ejector.Gas.Enabled = true
- for i = 1,5 do
- wait()
- end
- while wait() and Character.Torso.Ejector.Gas.Enabled == true and GasLeft > 0.00 do
- end
- elseif k == "" and (Keys["q"] or Keys["e"]) then
- end
- end)
- game:GetService("UserInputService").InputEnded:connect(function(Io)
- if Io.KeyCode == Enum.KeyCode.D then
- DriftRight = false
- RAnim:Stop()
- end
- if Io.KeyCode == Enum.KeyCode.A then
- DriftLeft = false
- LAnim:Stop()
- end
- end)
- local Ku = game.Players.LocalPlayer:GetMouse().KeyUp:connect(function(k)
- local dorecoil = false
- if (Keys["e"] and k == "e") or (Keys["q"] and k == "q") then
- Anim:Stop()
- dorecoil = true
- local Break = math.random(1,2)
- if Break == 1 then
- B1:Play()
- elseif Break == 2 then
- B2:Play()
- end
- a = Instance.new("Sound")
- a.SoundId = "http://www.roblox.com/asset/?id=193202522"
- a.Volume = 1
- a.Pitch = 1
- a.Parent = Character.HumanoidRootPart
- a:play()
- game.Debris:AddItem(a,0.5)
- for i = 1,5 do
- game.Workspace.CurrentCamera.FieldOfView = (80-(i*2))
- wait()
- end
- end
- Keys[k] = nil
- Keys2[k] = nil
- if not Keys["q"] and not Keys["e"] and (k == "q" or k == "e") then
- DriftEnabled = false
- local LastVelocity = Character.HumanoidRootPart.Velocity
- Velocity.maxForce = Vector3.new()
- Rotation.maxTorque = Vector3.new()
- Character.Humanoid.PlatformStand = false
- Frl.CanCollide = false
- Fll.CanCollide = false
- Stalling = false
- if RightGoal.p ~= Vector3.new() or LeftGoal.p ~= Vector3.new() then
- end
- Character.HumanoidRootPart.Velocity = LastVelocity
- RightGoal = CFrame.new()
- LeftGoal = CFrame.new()
- end
- if dorecoil then
- JumpRecoil = workspace.DistributedGameTime
- end
- if not Keys["e"] then
- RightGrapple.Transparency = 1
- end
- if not Keys["q"] then
- LeftGrapple.Transparency = 1
- end
- if k == " " then
- Gas = false
- Character.Torso.Ejector.Gas.Enabled = false
- end
- end)
- local function UpdateVelocities()
- if not Character then return end
- if not Character.HumanoidRootPart.Parent == Character then return end
- local Goal = Vector3.new()
- if not Keys["q"] and Keys["e"] then RightGoal = RightGoalTarget.CFrame*(RightGoalLocal:inverse()) Goal = RightGoal.p
- elseif not Keys["e"] and Keys["q"] then LeftGoal = LeftGoalTarget.CFrame*(LeftGoalLocal:inverse()) Goal = LeftGoal.p
- elseif Keys["q"] and Keys["e"] then RightGoal = RightGoalTarget.CFrame*(RightGoalLocal:inverse()) LeftGoal = LeftGoalTarget.CFrame*(LeftGoalLocal:inverse()) Goal = LeftGoal.p+(RightGoal.p-LeftGoal.p)/2
- end
- local Multiplier = 1
- if Gas then
- Multiplier = 2.5
- game.Debris:AddItem(a,0.5)
- end
- local OrbitVelocity = Vector3.new()
- if DriftRight and not DriftLeft then
- local MultiplierOrbit = Speed*.5*Multiplier
- if Keys["q"] or Keys["e"] then MultiplierOrbit = Speed*1.25 end
- local Dir = (Character.HumanoidRootPart.CFrame*CFrame.Angles(0, -math.rad(90), 0)).lookVector
- OrbitVelocity = Dir*MultiplierOrbit
- elseif DriftLeft and not DriftRight then
- local MultiplierOrbit = Speed*.5*Multiplier
- if Keys["e"] or Keys["q"] then MultiplierOrbit = Speed*1.25 end
- local Dir = (Character.HumanoidRootPart.CFrame*CFrame.Angles(0, math.rad(90), 0)).lookVector
- OrbitVelocity = Dir*MultiplierOrbit
- end
- if not Stalling then
- StallingDistance = (Character.HumanoidRootPart.Position-Goal).magnitude
- Velocity.velocity = CFrame.new(Character.HumanoidRootPart.Position, Goal).lookVector*Speed*Multiplier+OrbitVelocity
- Rotation.cframe = CFrame.new(Character.HumanoidRootPart.Position, Goal)
- elseif Stalling then
- StallingDistance = (Character.HumanoidRootPart.Position-Goal).magnitude
- local DownPos = Goal-Vector3.new(0,StallingDistance,0)
- local DownArcVelocity = Vector3.new()
- if (Character.Torso.HumanoidRootPart-DownPos).magnitude > 3.5 then
- DownArcVelocity = (Character.HumanoidRootPart.CFrame*CFrame.Angles(-math.rad(90),0,0)).lookVector*50
- end
- local Maintain = Vector3.new(0,0,0)
- if StallingDirectionDown and not StallingDirectionUp then
- Maintain = Vector3.new(0,-10,0)
- elseif StallingDirectionUp and not StallingDirectionDown then
- Maintain = Vector3.new(0,10,0)
- end
- Velocity.velocity = DownArcVelocity+Maintain
- Rotation.cframe = CFrame.new((Character.HumanoidRootPart.CFrame*CFrame.new(0,5,0)).p, Goal)
- end
- end
- local function UpdateGrapples()
- RGoalVal.Value = RightGoal.p
- LGoalVal.Value = LeftGoal.p
- if Keys2["e"] then
- RGrappleBool.Value = true
- RightGrapple.Transparency = 0
- local FirePos = (Character.HumanoidRootPart.CFrame*RightFirePosition).p
- RightGrapple.Size = Vector3.new(1, 1, (FirePos-RightGoal.p).magnitude)
- RightGrapple.CFrame = CFrame.new(FirePos+(RightGoal.p-FirePos)/2, RightGoal.p)
- else
- RGrappleBool.Value = false
- end
- if Keys2["q"] then
- LGrappleBool.Value = true
- LeftGrapple.Transparency = 0
- local FirePos = (Character.HumanoidRootPart.CFrame*LeftFirePosition).p
- LeftGrapple.Size = Vector3.new(1, 1, (FirePos-LeftGoal.p).magnitude)
- LeftGrapple.CFrame = CFrame.new(FirePos+(LeftGoal.p-FirePos)/2, LeftGoal.p)
- else
- LGrappleBool.Value = false
- end
- end
- game:GetService("RunService").RenderStepped:connect(UpdateGrapples)
- game:GetService("RunService").Stepped:connect(UpdateVelocities)
- wait(1)
- B2:Stop()
- B1:Stop()
- MassUpdate()
- wait(1)
- Character.ChildAdded:connect(MassUpdate)
- Character.ChildRemoved:connect(MassUpdate)
- Character.Humanoid.Died:connect(function()
- Kd:disconnect()
- Ku:disconnect()
- RightGrapple:remove()
- LeftGrapple:remove()
- end)
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local Folder = script.Parent.Events
- local ODMGEvent = Folder:WaitForChild("EquipODMG")
- local ReloadEvent = Folder:WaitForChild("BladeReload")
- local DropBlades = Folder:WaitForChild("DropBlades")
- local AttackingEvent = Folder:WaitForChild("AttackingEvent")
- local Blades = false
- ODMGEvent.OnServerEvent:connect(function(player)
- local EquipOMDG = player.Character.Humanoid:LoadAnimation(script.EquipODMG)
- EquipOMDG:Play()
- player.Character.Humanoid.WalkSpeed = 0
- player.Character.Humanoid.JumpPower = 0
- for a, p in ipairs(game.ReplicatedStorage.Nat.Welds["Left Container"]:GetChildren()) do
- if p:isA("Part") or p:isA("BasePart") then
- local part = p:clone()
- part.Anchored = false
- part.CanCollide = false
- part.Parent = player.Character["Left Leg"]
- local weld = Instance.new("Weld",part)
- weld.Part0 = player.Character["Left Leg"]
- weld.Part1 = part
- weld.C1 = p.CFrame:inverse()*game.ReplicatedStorage.Nat["Left Leg"].CFrame
- end
- end
- for a, p in ipairs(game.ReplicatedStorage.Nat.Welds["3DMG"]:GetChildren()) do
- if p:isA("Part") or p:isA("BasePart") then
- local part = p:clone()
- part.Anchored = false
- part.CanCollide = false
- part.Parent = player.Character["Torso"]
- local weld = Instance.new("Weld",part)
- weld.Part0 = player.Character["Torso"]
- weld.Part1 = part
- weld.C1 = p.CFrame:inverse()*game.ReplicatedStorage.Nat["Torso"].CFrame
- end
- end
- for a, p in ipairs(game.ReplicatedStorage.Nat.Welds["Right Container"]:GetChildren()) do
- if p:isA("Part") or p:isA("BasePart") then
- local part = p:clone()
- part.Anchored = false
- part.CanCollide = false
- part.Parent = player.Character["Right Leg"]
- local weld = Instance.new("Weld",part)
- weld.Part0 = player.Character["Right Leg"]
- weld.Part1 = part
- weld.C1 = p.CFrame:inverse()*game.ReplicatedStorage.Nat["Right Leg"].CFrame
- end
- end
- for a, p in ipairs(game.ReplicatedStorage.Nat.Welds["Right Blade"]:GetChildren()) do
- if p:isA("Part") or p:isA("BasePart") then
- local part = p:clone()
- part.Anchored = false
- part.CanCollide = false
- part.Parent = player.Character["Right Arm"]
- local weld = Instance.new("Weld",part)
- weld.Part0 = player.Character["Right Arm"]
- weld.Part1 = part
- weld.C1 = p.CFrame:inverse()*game.ReplicatedStorage.Nat["Right Arm"].CFrame
- end
- end
- for a, p in ipairs(game.ReplicatedStorage.Nat.Welds["Left Blade"]:GetChildren()) do
- if p:isA("Part") or p:isA("BasePart") then
- local part = p:clone()
- part.Anchored = false
- part.CanCollide = false
- part.Parent = player.Character["Left Arm"]
- local weld = Instance.new("Weld",part)
- weld.Part0 = player.Character["Left Arm"]
- weld.Part1 = part
- weld.C1 = p.CFrame:inverse()*game.ReplicatedStorage.Nat["Left Arm"].CFrame
- end
- local leftBlade = player.Character["Left Arm"]:waitForChild("Blade")
- local rightBlade = player.Character["Right Arm"]:waitForChild("Blade")
- rightBlade.Transparency = 1
- leftBlade.Transparency = 1
- player.Character.Humanoid.WalkSpeed = 16
- player.Character.Humanoid.JumpPower = 65
- wait()
- rightBlade.Transparency = 1
- leftBlade.Transparency = 1
- end
- end)
- ReloadEvent.OnServerEvent:connect(function(player)
- if Blades == true then return end
- local leftBlade = player.Character["Left Arm"]:waitForChild("Blade")
- local rightBlade = player.Character["Right Arm"]:waitForChild("Blade")
- rightBlade.Transparency = 0
- leftBlade.Transparency = 0
- Blades = true
- local a = Instance.new("Sound")
- a.SoundId = "http://www.roblox.com/asset/?id=130785405"
- a.Volume = 1
- a.Pitch = 2
- a.MaxDistance = 50
- a.Parent = player.Character.HumanoidRootPart
- a:play()
- game.Debris:AddItem(a,0.5)
- end)
- DropBlades.OnServerEvent:connect(function(player)
- if Blades == true then
- local leftBlade = player.Character["Left Arm"]:waitForChild("Blade")
- local rightBlade = player.Character["Right Arm"]:waitForChild("Blade")
- local RClone = game.ReplicatedStorage.Nat.Welds["Right Blade"].Blade:Clone()
- RClone.CanCollide = true
- RClone.Parent = game.Workspace
- RClone.Anchored = false
- RClone.CFrame = rightBlade.CFrame
- local LClone = game.ReplicatedStorage.Nat.Welds["Left Blade"].Blade:Clone()
- LClone.CanCollide = true
- LClone.Parent = game.Workspace
- LClone.Anchored = false
- LClone.CFrame = leftBlade.CFrame
- rightBlade.Transparency = 1
- leftBlade.Transparency = 1
- game.Debris:AddItem(RClone, 2)
- game.Debris:AddItem(LClone, 2)
- wait(.25)
- Blades = false
- end
- end)
- AttackingEvent.OnServerEvent:connect(function(player, hit)
- local attacking = false
- local leftBlade = player.Character["Left Arm"]:waitForChild("Blade")
- local rightBlade = player.Character["Right Arm"]:waitForChild("Blade")
- local a = Instance.new("Sound")
- a.SoundId = "http://www.roblox.com/asset/?id=147722227"
- a.Volume = 0.3
- a.Pitch = math.random(1.5,2.5)
- a.Parent = player.Character.HumanoidRootPart
- a:play()
- local blade = leftBlade or rightBlade
- local attacking = false
- blade.Touched:connect(function(hit)
- if hit.Parent:findFirstChild("Humanoid") and hit.Parent.Name ~= player.Name then
- if not attacking and not hit.Parent:findFirstChild("Nape") and not hit.Parent:findFirstChild("Ragdoller") then
- attacking = true
- hit.Parent.Humanoid:takeDamage(25)
- end
- end
- if hit.Name == "Nape" and not attacking then
- attacking = true
- local hitv = Instance.new("ObjectValue")
- hitv.Name = "HitRequest"
- hitv.Value = player
- hit.Parent:findFirstChildOfClass("Humanoid"):TakeDamage(100000000000)
- end
- end)
- wait(.5)
- attacking = true
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement