Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- game.Players.LocalPlayer:GetMouse().Button1Down:Connect(function()
- if debounce==true then return end
- local oldWalk=game.Players.LocalPlayer.Character.Humanoid.WalkSpeed
- local oldJump=game.Players.LocalPlayer.Character.Humanoid.JumpPower
- if hitstun==0 then
- local now = (tick() - lastClick)
- if now>=1 then
- Light=1
- lastClick=tick()
- elseif now<1 then
- lastClick=tick()
- end
- if game.Players.LocalPlayer.Character.CD.Value==false and game.Players.LocalPlayer.Character.Blocking.Value==false then
- debounce=true
- if mode ~="Ranged" then
- game.Players.LocalPlayer.Character.Humanoid.WalkSpeed=10
- game.Players.LocalPlayer.Character.Humanoid.JumpPower=0
- game.ReplicatedStorage.Remotes.Attack:InvokeServer(game.Players.LocalPlayer:GetMouse().hit, Light, mode,false)
- animations()
- print(Light)
- Light=Light+1
- elseif mode== "Ranged" and Light==2 then
- animations()
- Light=1
- elseif mode == "Ranged" and Light==1 then
- animations()
- Light=Light+1
- end
- if Light==6 then
- Light=1
- wait(0.5)
- end
- if mode=="Sword" then
- local sound = Instance.new("Sound",game.Players.LocalPlayer.Character.HumanoidRootPart)
- sound.SoundId="rbxassetid://8680211166"
- sound:Play()
- game:GetService("Debris"):AddItem(sound,2)
- wait(attackWait)
- if game.Players.LocalPlayer.Character.Humanoid.WalkSpeed~=SwordWalkSpeed then
- game.Players.LocalPlayer.Character.Humanoid.JumpPower=oldJump
- game.Players.LocalPlayer.Character.Humanoid.WalkSpeed=SwordWalkSpeed
- end
- elseif mode=="Ranged" then
- print("Worked")
- game.ReplicatedStorage.Remotes.Attack:InvokeServer(game.Players.LocalPlayer:GetMouse().hit, Light, mode,false)
- wait(0.05)
- if game.Players.LocalPlayer.Character.Humanoid.WalkSpeed~=RangedWalkSpeed then
- game.Players.LocalPlayer.Character.Humanoid.JumpPower=50
- game.Players.LocalPlayer.Character.Humanoid.WalkSpeed=RangedWalkSpeed
- elseif not game.Players.LocalPlayer.Character.Humanoid.JumpPower==50 then
- game.Players.LocalPlayer.Character.Humanoid.JumpPower=50
- game.Players.LocalPlayer.Character.Humanoid.WalkSpeed=RangedWalkSpeed
- end
- end
- print("ended")
- debounce=false
- end
- end
- end)
- game.Players.LocalPlayer:GetMouse().Button2Down:Connect(function()
- if hitstun==0 then
- if debounce==true then return end
- if heavyReady==true then
- if game.Players.LocalPlayer.Character.CD.Value==false and game.Players.LocalPlayer.Character.Blocking.Value==false then
- if mode=="Sword" then
- debounce=true
- local oldWalk=game.Players.LocalPlayer.Character.Humanoid.WalkSpeed
- local oldJump=game.Players.LocalPlayer.Character.Humanoid.JumpPower
- game.Players.LocalPlayer.Character.Humanoid.WalkSpeed=10
- game.Players.LocalPlayer.Character.Humanoid.JumpPower=0
- heavyReady=false
- HeavyAnim()
- game.ReplicatedStorage.Remotes.Attack:InvokeServer(game.Players.LocalPlayer:GetMouse().hit, 0, mode,true)
- local sound = Instance.new("Sound",game.Players.LocalPlayer.Character.HumanoidRootPart)
- sound.SoundId="rbxassetid://7545764969"
- sound:Play()
- game:GetService("Debris"):AddItem(sound,2)
- wait(attackWait)
- if game.Players.LocalPlayer.Character.Humanoid.WalkSpeed~=SwordWalkSpeed then
- if game.Players.LocalPlayer.Character.Humanoid.JumpPower~=oldJump then
- game.Players.LocalPlayer.Character.Humanoid.JumpPower=50
- game.Players.LocalPlayer.Character.Humanoid.WalkSpeed=SwordWalkSpeed
- end
- end
- debounce=false
- wait(3)
- heavyReady=true
- elseif mode=="Ranged" then
- if heavyReady2==true then
- debounce=true
- HeavyAnim()
- local oldWalk=game.Players.LocalPlayer.Character.Humanoid.WalkSpeed
- local oldJump=game.Players.LocalPlayer.Character.Humanoid.JumpPower
- game.Players.LocalPlayer.Character.Humanoid.WalkSpeed=0
- game.Players.LocalPlayer.Character.Humanoid.JumpPower=0
- game.Players.LocalPlayer.Character.HumanoidRootPart.Anchored=true
- heavyReady2=false
- game.ReplicatedStorage.Remotes.Attack:InvokeServer(game.Players.LocalPlayer:GetMouse().hit, 0, mode,true)
- wait(1.75)
- game.Players.LocalPlayer.Character.HumanoidRootPart.Anchored=false
- if game.Players.LocalPlayer.Character.Humanoid.WalkSpeed~=RangedWalkSpeed then
- game.Players.LocalPlayer.Character.Humanoid.JumpPower=50
- game.Players.LocalPlayer.Character.Humanoid.WalkSpeed=RangedWalkSpeed
- end
- debounce=false
- wait(10)
- heavyReady2=true
- end
- end
- end
- end
- end
- end)
- game:GetService("UserInputService").InputBegan:Connect(function(key,IsTyping)
- if debounce==true then return end
- if hitstun==0 then
- if IsTyping==false then
- if key.KeyCode== Enum.KeyCode.Q then
- debounce=true
- if mode=="Ranged" then
- mode="Sword"
- game.ReplicatedStorage.Remotes.WeaponChange:InvokeServer(mode, SwordWalkSpeed, RangedWalkSpeed)
- Light=1
- print("Yes")
- elseif mode=="Sword" then
- mode="Ranged"
- print("Yes")
- Light=1
- game.ReplicatedStorage.Remotes.WeaponChange:InvokeServer(mode, SwordWalkSpeed, RangedWalkSpeed)
- end
- wait(ChangeModeWait)
- print(mode)
- debounce=false
- end
- end
- end
- end)
- game.ReplicatedStorage.Remotes.Blocking.OnClientEvent:Connect(function(enemy,status)
- if status=="Blocked" then
- local blockVFX = game.ReplicatedStorage.InsertParts.BlockSteelEffect:Clone()
- for i, v in pairs(blockVFX:GetChildren()) do
- spawn(function()
- v.Parent=enemy
- v.CFrame = enemy:FindFirstChild("Sword").CFrame * CFrame.Angles(0,0,0)
- game:GetService("Debris"):AddItem(v,0.5)
- local goal4 = {Transparency=1}
- local goal3
- if v.Name=="SteelEffect1" then
- local goal3 = {Size= Vector3.new(2.315, 1.641, 2.19)}
- local sound = Instance.new("Sound",enemy.HumanoidRootPart)
- sound.SoundId="rbxassetid://5763723309"
- sound:Play()
- game:GetService("Debris"):AddItem(sound,2)
- game:GetService("TweenService"):Create(v,TweenInfo.new(0.45),goal3):Play()
- elseif v.Name=="SteelEffect2" then
- local goal3 = {Size= Vector3.new(3.692, 4.005, 3.958)}
- game:GetService("TweenService"):Create(v,TweenInfo.new(0.45),goal3):Play()
- end
- game:GetService("TweenService"):Create(v, TweenInfo.new(0.45),goal4):Play()
- end)
- end
- end
- end)
- game:GetService("UserInputService").InputBegan:Connect(function(key,IsTyping)
- if IsTyping==false then
- if hitstun==0 then
- if mode~="Ranged" then
- if key.KeyCode==Enum.KeyCode.F then
- if debounce==true then return end
- if game.Players.LocalPlayer.Character.Blocking.Value==false and game.Players.LocalPlayer.Character.CD.Value==false then
- debounce=true
- blocking=true
- BlockingAnim:Play()
- game.Players.LocalPlayer.Character.Humanoid.WalkSpeed=8
- game.Players.LocalPlayer.Character.Humanoid.JumpPower=0
- game.ReplicatedStorage.Remotes.Blocking:FireServer(true)
- end
- end
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment