RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"make me a script that allows a player to teleport to where their mouse is when they press Q"
-- Local script local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local player = Players.LocalPlayer local mouse = player:GetMouse() local function teleport() local character = player.Character if character then local humanoidRootPart = character:FindFirstChild("HumanoidRootPart") if humanoidRootPart then humanoidRootPart.CFrame = CFrame.new(mouse.Hit.p) end end end local function onInputBegan(input, gameProcessedEvent) if input.KeyCode == Enum.KeyCode.Q and not gameProcessedEvent then teleport() end end UserInputService.InputBegan:Connect(onInputBegan)