Universal Script 📌
2.3k Views
48 Executions

Click teleport

Universal Script 📌
1 year ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

Click and teleport

View Raw
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")

local player = Players.LocalPlayer
local mouse = player:GetMouse()

local canTeleport = false

-- When V is pressed down
UserInputService.InputBegan:Connect(function(input, gameProcessed)
    if gameProcessed then return end
    if input.KeyCode == Enum.KeyCode.V then
        canTeleport = true
    end
end)

-- When V is released
UserInputService.InputEnded:Connect(function(input, gameProcessed)
    if gameProcessed then return end
    if input.KeyCode == Enum.KeyCode.V then
        canTeleport = false
    end
end)

-- Teleport on click if V is held
mouse.Button1Down:Connect(function()
    if canTeleport then
        local character = player.Character
        local hrp = character and character:FindFirstChild("HumanoidRootPart")
        if hrp then
            local targetPos = mouse.Hit.p
            hrp.CFrame = CFrame.new(targetPos.X, targetPos.Y + 3, targetPos.Z)
        end
    end
end)



Comments

1
Log in to join the conversation. Login
jalenwil2109's profile picture
jalenwil21091 year ago

This is actually a funny thumbnail

1

More universal scripts

See all
Script hub
3.2M
752.9k
Bumped 1 hour ago
Key System

Script hub

Hall of Fame #8

Verified script badgeFlow Hub | 50 Games | Updated

Universal Script 📌
373
1.0k
Bumped 3 hours ago
Key System
Universal Script 📌
7.0k
141.0k
Bumped 4 hours ago
Script hub
45.6k
114.3k
Bumped 5 hours ago
Key System
Script hub
3.5M
448.4k
Bumped 6 hours ago
Key System

Script hub

Hall of Fame #4

Verified script badgeOverflow #1 *OP*

Universal Script 📌
14.8k
70.8k
Bumped 7 hours ago