Universal Script 📌
645 Views
146 Executions

Click TP Open Source

Universal Script 📌
Easyscripts1
Easyscripts1First script
7 months 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

Normal Click-TP Keybind = Crtl (Strg) + left mouse button

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

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

local function teleportCharacter()
	local character = player.Character
	if not character then return end
	
	local rootPart = character:FindFirstChild("HumanoidRootPart")
	if not rootPart then return end

	local targetPosition = mouse.Hit.Position
	local currentRotation = rootPart.CFrame - rootPart.CFrame.Position
	
	local newCFrame = CFrame.new(targetPosition + Vector3.new(0, 3, 0)) * currentRotation
	
	rootPart.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
	rootPart.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
	
	rootPart.CFrame = newCFrame
end

UserInputService.InputBegan:Connect(function(input, gameProcessed)
	if gameProcessed then return end
	
	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		local ctrlDown = UserInputService:IsKeyDown(Enum.KeyCode.LeftControl) or UserInputService:IsKeyDown(Enum.KeyCode.RightControl)
		if ctrlDown then
			teleportCharacter()
		end
	end
end)

player.CharacterAdded:Connect(function(newChar)
	character = newChar
end)


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

Tags

More universal scripts

See all
Script hub
37
1
Approved 38 minutes ago
Script hub
21
1
Approved 1 hour ago
Key System

Script hub

Shadow

Universal Script 📌
35
5
Approved 2 hours ago
Universal Script 📌
57
17
Approved 2 hours ago
Script hub
3.2M
1.2M
Bumped 2 hours ago
Key System

Script hub

Hall of Fame #9

CanHub V2 200 GAMES KEYED

Universal Script 📌
363
784
Bumped 3 hours ago