Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local UserInputService = game:GetService("UserInputService")
- local Player = game.Players.LocalPlayer
- local Mouse = Player:GetMouse()
- local Key = Enum.KeyCode.LeftControl
- function GetCharacter()
- return Player.Character
- end
- function Teleport(Position)
- local Char = GetCharacter()
- if Char then
- Char:MoveTo(Position)
- end
- end
- UserInputService.InputBegan:Connect(function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 and UserInputService:IsKeyDown(Key) then
- Teleport(Mouse.Hit.p)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement