Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how do i make a keybind for this teleport script?

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)

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

6 comments

0

for userinput service use inputbegan

0

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

0

use the api

0

thanks ben, i didnt have time to get the link. @Benbebop

This discussion is preserved as it was. New answers, comments, and votes are closed.