Advertisement
SxScripting

Block Local Script

Jan 14th, 2021
7,089
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. local UIS = game:GetService("UserInputService")
  2. local RS = game:GetService("ReplicatedStorage")
  3.  
  4. local Player = game.Players.LocalPlayer
  5. local Character = Player.Character or Player.CharacterAdded:Wait()
  6. local IsBlocking = Character:WaitForChild("Data").IsBlocking.Value
  7. local BlockAnimation = Character.Humanoid:LoadAnimation(game.ReplicatedStorage.Animations.Block)
  8.  
  9. local function Speed(Value, NextValue)
  10. Character.Humanoid.WalkSpeed = Value
  11. Character.Humanoid.JumpPower = NextValue
  12. end
  13.  
  14. UIS.InputBegan:Connect(function(Input, IsTyping)
  15. if IsTyping then return end
  16. if Input.KeyCode == Enum.KeyCode.F then
  17. Speed(0,0)
  18. BlockAnimation:Play()
  19. RS.Block:FireServer("On")
  20. end
  21. end)
  22.  
  23. UIS.InputEnded:Connect(function(Input, IsTyping)
  24. if IsTyping then return end
  25. if Input.KeyCode == Enum.KeyCode.F then
  26. Speed(16,50)
  27. BlockAnimation:Stop()
  28. RS.Block:FireServer("Off")
  29. end
  30. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement