repeat wait() until game.Players.LocalPlayer.Character
-
local plr = game.Players.LocalPlayer
local MyBody = plr.Character
local mouse = plr:GetMouse()
script.Parent.Activated:connect(function()
local hit = mouse.Hit
MyBody:MoveTo(hit.p)
end)
COMMUNITY QUESTION
how do i make a keybind for this teleport script?
1 answer
use userinputservice, there is a page for it
or
plr:GetMouse().Button1Down:Connect(function(k)
--comapre the keycodes
end)
--the above is deprecated, but should still work fine
This discussion is preserved as it was. New answers, comments, and votes are closed.

6 comments
for userinput service use inputbegan
can you correct the script cuz idk where i should put ur script and i already tried it but idk how to actually use it
use the api
@soreno2468 https://developer.roblox.com/en-us/api-reference/class/UserInputService
also check out https://developer.roblox.com/en-us/articles/Function
thanks ben, i didnt have time to get the link. @Benbebop