Universal Script 📌
2.3k Views
55 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.9k
7.1k
Bumped 16 minutes ago
Key System
Universal Script 📌
43.5k
1.1M
Bumped 50 minutes ago
Universal Script 📌
37
7
Approved 54 minutes ago
Script hub
166.2k
594.9k
Bumped 1 hour ago
Key System

Script hub

Hall of Fame #6

Verified script badgeAcro Hub OP SCRIPT

Script hub
56
4
Approved 1 hour ago
Key System
Universal Script 📌
44
5
Approved 2 hours ago
Script hub
381
1.4k
Bumped 2 hours ago
Key System