Advertisement
DrawingJhon

ClickTeleport

Jul 18th, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.26 KB | None | 0 0
  1. local plr = game.Players.LocalPlayer
  2. local mouse = plr:GetMouse()
  3.  
  4. local tool = Instance.new("Tool", plr.Backpack)
  5. tool.Name = "ClickTeleport"
  6. tool.RequiresHandle = false
  7.  
  8. local connection
  9. tool.Equipped:Connect(function()
  10.     connection = tool.Activated:Connect(function()
  11.         if plr.Character then
  12.             plr.Character:MoveTo(mouse.Hit.Position)
  13.         end
  14.     end)
  15. end)
  16.  
  17. tool.Unequipped:Connect(function()
  18.     connection:Disconnect()
  19. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement