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

Can i make press E teleport sys ?

I working on press E teleportsys or i have problems with press E !!!

1 answer

✓ Accepted answer

If I understand correctly, you want the character to teleport when you press E?

local userInputService = game:GetService("UserInputService")
local mouse = game.Players.LocalPlayer:GetMouse()
local character = game.Players.LocalPlayer.Character

userInputService.InputBegan:Connect(function(key) --Input detected!
	if key.KeyCode == Enum.KeyCode.E then --Checks if we pressed "e"
		character.HumanoidRootPart.CFrame = mouse.Hit --teleports the character to the mouse's position
	end
end)

For more information on keycodes and stuff, check out this article

1 comment

0

THX !!!

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