Advertisement
Guest User

Untitled

a guest
May 16th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. local Mouse = Player:GetMouse()
  3. local Enabled = false
  4.  
  5. local Body = Instance.new("BodyPosition")
  6. Body.MaxForce = Vector3.new(15000, 15000, 15000)
  7. Body.Parent = nil
  8.  
  9. Mouse.Button1Down:connect(function()
  10. if Mouse.Target ~= nil and Enabled == true then
  11. Body.Parent = Player.Character.HumanoidRootPart
  12. Body.Position = Vector3.new(Mouse.Hit.X, Mouse.Hit.Y + 5, Mouse.Hit.Z)
  13. end
  14. end)
  15.  
  16. Mouse.KeyDown:connect(function(key)
  17. if key == "w" then
  18. Body.Parent = nil
  19. elseif key == "s" then
  20. Body.Parent = nil
  21. elseif key == "a" then
  22. Body.Parent = nil
  23. elseif key == "d" then
  24. Body.Parent = nil
  25. end
  26. end)
  27.  
  28. Mouse.KeyDown:connect(function(key)
  29. if key == "q" then
  30. if Enabled == false then
  31. Enabled = true
  32. else
  33. Enabled = false
  34. end
  35. end
  36. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement