Advertisement
Zyocride

Untitled

Jun 23rd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. repeat wait(1/44)
  2. until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild("Humanoid") and game.Players.LocalPlayer.Character:findFirstChild("Torso") and game.Players.LocalPlayer:GetMouse() and game.Workspace.CurrentCamera
  3. local mouse = game.Players.LocalPlayer:GetMouse()
  4. local torso = game.Players.LocalPlayer.Character.Torso
  5. local dir = {w = 0, s = 0, a = 0, d = 0}
  6. local spd = 2 mouse.KeyDown:connect(function(key)
  7. if key:lower() == "w" then
  8. dir.w = 1 elseif key:lower() == "s" then
  9. dir.s = 1 elseif key:lower() == "a" then
  10. dir.a = 1 elseif key:lower() == "d" then
  11. dir.d = 1 elseif key:lower() == "q" then spd = spd + 1 elseif key:lower() == "e" then
  12. spd = spd - 1
  13. end
  14. end)
  15. mouse.KeyUp:connect(function(key)
  16. if key:lower() == "w" then
  17. dir.w = 0 elseif key:lower() == "s" then
  18. dir.s = 0 elseif key:lower() == "a" then
  19. dir.a = 0 elseif key:lower() == "d" then
  20. dir.d = 0
  21. end
  22. end)
  23. torso.Anchored = true
  24. game.Players.LocalPlayer.Character.Humanoid.PlatformStand = true
  25. game.Players.LocalPlayer.Character.Humanoid.Changed:connect(function()
  26. game.Players.LocalPlayer.Character.Humanoid.PlatformStand = true
  27. end)
  28. repeat wait(1/44)
  29. torso.CFrame = CFrame.new(torso.Position, game.Workspace.CurrentCamera.CoordinateFrame.p) * CFrame.Angles(0,math.rad(180),0) * CFrame.new((dir.d-dir.a)*spd,0,(dir.s-dir.w)*spd) until nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement