Universal Click to teleport
Key RequiredUniversal

Universal Click to teleport

Universal ScriptSpunnySpunny 411 views 409 executesUpdated Jun 13, 2026
Unrated
00
Lua Script•1006 lines (29012 chars)
--========================================================
-- TELEPORT CARTOON STUD UI + CINEMATIC INTRO
-- LocalScript
-- Place in StarterPlayerScripts or StarterGui
--========================================================

--========================================================
-- SERVICES
--========================================================
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
local Debris = game:GetService("Debris")
local Workspace = game:GetService("Workspace")
local Lighting = game:GetService("Lighting")

--========================================================
-- PLAYER
--========================================================
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local mouse = player:GetMouse()

--========================================================
-- CONFIG
--========================================================
local CONFIG = {
	ToggleKey = Enum.KeyCode.F,

	UIName = "TeleportCartoonStudUI",
	IntroUIName = "TeleportCartoonStudIntro",

	CreatorLine = "Script Made By",
	CreatorName = "pauschalStudio",

	MainTitle = "Teleport",
	InfoText = "Klick zum Teleportieren",
	HintText = "F = AN / AUS",

	ButtonTextOn = "Teleport: ON",
	ButtonTextOff = "Teleport: OFF",

	StudTexture = "rbxassetid://18878365966",
	StudTransparency = 0.58,

	Width = 320,
	Height = 178,
	ButtonHeight = 58,
	CornerRadius = 18,
	StrokeThickness = 4,
	ShadowOffset = 6,

	RGBSpeed = 0.62,
	RGBUpdateRate = 0.04,

	IntroDuration = 3.2,
	IntroFadeTime = 0.42,

	TeleportYOffset = 3,
	TeleportCooldown = 0.12,

	MarkerSize = Vector3.new(1.25, 0.2, 1.25),
	MarkerLifetime = 0.45,
	MarkerTransparency = 0.28,
	MaxMarkers = 8,

	BasePanelColor = Color3.fromRGB(167, 112, 68),
	BaseButtonOffColor = Color3.fromRGB(255, 191, 74),
	TextLightColor = Color3.fromRGB(255, 248, 235),
	TextDarkStroke = Color3.fromRGB(45, 28, 18),

	IntroBlurSize = 12,
	IntroParticleCount = 12,
	IntroLightCount = 4,
}

local INTRO_SOUND_ID = "rbxassetid://..."
local INTRO_SOUND_VOLUME = 0.45

--========================================================
-- STATE
--========================================================
local state = {
	enabled = false,
	lastTeleportTime = 0,
	currentAccent = Color3.fromRGB(255, 255, 255),

	dragging = false,
	dragStart = nil,
	frameStart = nil,
	dragInput = nil,

	markerCount = 0,
	introRunning = true,
}

local character = nil
local humanoidRootPart = nil

--========================================================
-- CLEANUP OLD UI
--========================================================
do
	local oldMain = playerGui:FindFirstChild(CONFIG.UIName)
	if oldMain then
		oldMain:Destroy()
	end

	local oldIntro = playerGui:FindFirstChild(CONFIG.IntroUIName)
	if oldIntro then
		oldIntro:Destroy()
	end
end

--========================================================
-- HELPERS
--========================================================
local function now()
	return time()
end

local function isPlayableSoundId(id)
	return typeof(id) == "string" and id:match("^rbxassetid://%d+$") ~= nil
end

local function getRainbowColor()
	local hue = (tick() * CONFIG.RGBSpeed) % 1
	return Color3.fromHSV(hue, 1, 1)
end

local function safeDestroy(obj)
	if obj then
		pcall(function()
			obj:Destroy()
		end)
	end
end

local function createCorner(parent, radius)
	local corner = Instance.new("UICorner")
	corner.CornerRadius = UDim.new(0, radius)
	corner.Parent = parent
	return corner
end

local function createStroke(parent, thickness, transparency)
	local stroke = Instance.new("UIStroke")
	stroke.Thickness = thickness
	stroke.Transparency = transparency or 0
	stroke.Color = CONFIG.TextDarkStroke
	stroke.Parent = parent
	return stroke
end

local function createStudPattern(parent)
	local pattern = Instance.new("ImageLabel")
	pattern.Name = "StudPattern"
	pattern.BackgroundTransparency = 1
	pattern.Image = CONFIG.StudTexture
	pattern.ImageTransparency = CONFIG.StudTransparency
	pattern.ScaleType = Enum.ScaleType.Tile
	pattern.TileSize = UDim2.new(0, 40, 0, 40)
	pattern.Size = UDim2.fromScale(1, 1)
	pattern.Position = UDim2.fromScale(0, 0)
	pattern.ZIndex = parent.ZIndex + 1
	pattern.Parent = parent
	return pattern
end

local function createHighlight(parent)
	local shine = Instance.new("Frame")
	shine.Name = "Highlight"
	shine.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
	shine.BackgroundTransparency = 0.8
	shine.BorderSizePixel = 0
	shine.Size = UDim2.new(1, 0, 0.36, 0)
	shine.Position = UDim2.new(0, 0, 0, 0)
	shine.ZIndex = parent.ZIndex + 2
	shine.Parent = parent
	createCorner(shine, CONFIG.CornerRadius)
	return shine
end

local function getCharacter()
	if character and character.Parent then
		return character
	end
	character = player.Character or player.CharacterAdded:Wait()
	return character
end

local function getHumanoidRootPart()
	local char = getCharacter()
	if not char then
		return nil
	end

	if humanoidRootPart and humanoidRootPart.Parent == char then
		return humanoidRootPart
	end

	humanoidRootPart = char:FindFirstChild("HumanoidRootPart") or char:WaitForChild("HumanoidRootPart", 5)
	return humanoidRootPart
end

local function canTeleport()
	return state.enabled and (now() - state.lastTeleportTime) >= CONFIG.TeleportCooldown
end

local function hasTextFocus()
	return UserInputService:GetFocusedTextBox() ~= nil
end

local function getWorldHitPosition()
	local camera = Workspace.CurrentCamera
	if not camera then
		return nil
	end

	local unitRay = camera:ViewportPointToRay(mouse.X, mouse.Y)
	local params = RaycastParams.new()
	params.FilterType = Enum.RaycastFilterType.Blacklist
	params.IgnoreWater = true

	local blacklist = {}
	local char = player.Character
	if char then
		table.insert(blacklist, char)
	end
	params.FilterDescendantsInstances = blacklist

	local result = Workspace:Raycast(unitRay.Origin, unitRay.Direction * 1000, params)
	if result then
		return result.Position
	end

	local hit = mouse.Hit
	if hit then
		return hit.Position
	end

	return nil
end

--========================================================
-- MARKER
--========================================================
local function spawnMarker(position, accentColor)
	if state.markerCount >= CONFIG.MaxMarkers then
		return
	end

	state.markerCount += 1

	local marker = Instance.new("Part")
	marker.Name = "TeleportMarker"
	marker.Anchored = true
	marker.CanCollide = false
	marker.CastShadow = false
	marker.Material = Enum.Material.Neon
	marker.Size = CONFIG.MarkerSize
	marker.Transparency = CONFIG.MarkerTransparency
	marker.Color = accentColor or state.currentAccent
	marker.CFrame = CFrame.new(position)
	marker.Parent = Workspace

	Debris:AddItem(marker, CONFIG.MarkerLifetime)

	task.delay(CONFIG.MarkerLifetime, function()
		state.markerCount = math.max(0, state.markerCount - 1)
	end)
end

--========================================================
-- TELEPORT
--========================================================
local function teleportTo(position)
	if not position then
		return
	end

	local hrp = getHumanoidRootPart()
	if not hrp then
		return
	end

	local target = position + Vector3.new(0, CONFIG.TeleportYOffset, 0)
	local char = getCharacter()

	local ok = pcall(function()
		if char and char:IsA("Model") then
			char:PivotTo(CFrame.new(target))
		else
			hrp.CFrame = CFrame.new(target)
		end
	end)

	if ok then
		state.lastTeleportTime = now()
		spawnMarker(position, state.currentAccent)
	end
end

--========================================================
-- INTRO GUI
--========================================================
local introGui = Instance.new("ScreenGui")
introGui.Name = CONFIG.IntroUIName
introGui.ResetOnSpawn = false
introGui.IgnoreGuiInset = true
introGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
introGui.Parent = playerGui

local introBlackout = Instance.new("Frame")
introBlackout.Name = "Blackout"
introBlackout.Size = UDim2.fromScale(1, 1)
introBlackout.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
introBlackout.BackgroundTransparency = 1
introBlackout.BorderSizePixel = 0
introBlackout.Parent = introGui

local introSound = nil
local introObjects = {}
local introOrbs = {}
local introParticles = {}

local function track(obj)
	table.insert(introObjects, obj)
	return obj
end

local function createOrb(size, zIndex)
	local orb = Instance.new("Frame")
	orb.Name = "Orb"
	orb.AnchorPoint = Vector2.new(0.5, 0.5)
	orb.Size = size
	orb.BackgroundTransparency = 0.86
	orb.BackgroundColor3 = getRainbowColor()
	orb.BorderSizePixel = 0
	orb.ZIndex = zIndex
	orb.Parent = introGui
	createCorner(orb, 999)
	return orb
end

local function createParticle(kind, pos, color)
	local label = Instance.new("TextLabel")
	label.Name = "Particle"
	label.BackgroundTransparency = 1
	label.AnchorPoint = Vector2.new(0.5, 0.5)
	label.Position = pos
	label.ZIndex = 20
	label.Text = kind == "Star" and "✦" or (kind == "Circle" and "●" or "•")
	label.Font = Enum.Font.GothamBlack
	label.TextColor3 = color
	label.TextTransparency = 0
	label.TextSize = kind == "Star" and math.random(16, 24) or math.random(10, 18)
	label.Parent = introGui
	return label
end

local function playIntroSound()
	if not isPlayableSoundId(INTRO_SOUND_ID) then
		return nil
	end

	local sound = Instance.new("Sound")
	sound.Name = "IntroMusic"
	sound.SoundId = INTRO_SOUND_ID
	sound.Volume = INTRO_SOUND_VOLUME
	sound.Looped = false
	sound.Parent = introGui

	pcall(function()
		sound:Play()
	end)

	return sound
end

local function typingEffect(label, text, speed)
	label.Text = ""
	for i = 1, #text do
		if not label.Parent then
			return
		end
		label.Text = text:sub(1, i)
		task.wait(speed)
	end
end

local function destroyIntro()
	state.introRunning = false

	if introSound then
		pcall(function()
			introSound:Stop()
		end)
		safeDestroy(introSound)
	end

	for _, obj in ipairs(introObjects) do
		safeDestroy(obj)
	end

	local fadeInfo = TweenInfo.new(CONFIG.IntroFadeTime, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
	TweenService:Create(introBlackout, fadeInfo, { BackgroundTransparency = 1 }):Play()

	for _, obj in ipairs(introObjects) do
		if obj and obj.Parent then
			if obj:IsA("TextLabel") then
				TweenService:Create(obj, fadeInfo, {
					TextTransparency = 1,
					TextStrokeTransparency = 1,
				}):Play()
			elseif obj:IsA("Frame") then
				TweenService:Create(obj, fadeInfo, {
					BackgroundTransparency = 1,
				}):Play()
			end
		end
	end

	task.delay(CONFIG.IntroFadeTime + 0.15, function()
		safeDestroy(introGui)
	end)
end

local function runIntro()
	local camera = Workspace.CurrentCamera
	local originalFov = camera and camera.FieldOfView or 70

	local blur = Instance.new("BlurEffect")
	blur.Name = "IntroBlur"
	blur.Size = 0
	blur.Parent = Lighting

	track(blur)

	TweenService:Create(blur, TweenInfo.new(0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
		Size = CONFIG.IntroBlurSize,
	}):Play()

	TweenService:Create(introBlackout, TweenInfo.new(0.28, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
		BackgroundTransparency = 0.18,
	}):Play()

	if camera then
		TweenService:Create(camera, TweenInfo.new(0.7, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {
			FieldOfView = math.max(48, originalFov - 10),
		}):Play()
	end

	introSound = playIntroSound()

	local centerPos = UDim2.new(0.5, 0, 0.5, 0)

	for i = 1, CONFIG.IntroLightCount do
		local orb = createOrb(UDim2.fromOffset(math.random(180, 280), math.random(180, 280)), 4)
		track(orb)
		table.insert(introOrbs, orb)

		local side = (i % 2 == 0) and -1 or 1
		orb.Position = UDim2.new(0.5, side * math.random(130, 180), 0.5, math.random(-120, 120))

		local driftTween = TweenService:Create(orb, TweenInfo.new(math.random(35, 55) / 10, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, true), {
			Position = UDim2.new(0.5, -side * math.random(150, 210), 0.5, math.random(-100, 100)),
			BackgroundTransparency = 0.9,
		})
		driftTween:Play()
	end

	for i = 1, CONFIG.IntroParticleCount do
		local kind = (i % 3 == 0) and "Star" or ((i % 2 == 0) and "Circle" or "Spark")
		local startPos = UDim2.new(0.5, math.random(-110, 110), 0.5, math.random(-45, 45))
		local particle = createParticle(kind, startPos, getRainbowColor())
		track(particle)
		table.insert(introParticles, particle)

		local endPos = UDim2.new(0.5, math.random(-140, 140), 0.5, math.random(-150, -70))
		local tween = TweenService:Create(particle, TweenInfo.new(math.random(18, 28) / 10, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
			Position = endPos,
			TextTransparency = 1,
			Rotation = math.random(120, 260),
		})
		tween:Play()

		task.delay(2.2, function()
			safeDestroy(particle)
		end)
	end

	local shadow = Instance.new("Frame")
	shadow.Name = "PanelShadow"
	shadow.Size = UDim2.new(0, 440, 0, 150)
	shadow.Position = UDim2.new(0.5, -220 + CONFIG.ShadowOffset, 0.37, CONFIG.ShadowOffset)
	shadow.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
	shadow.BackgroundTransparency = 0.55
	shadow.BorderSizePixel = 0
	shadow.Parent = introGui
	createCorner(shadow, CONFIG.CornerRadius)
	track(shadow)

	local panel = Instance.new("Frame")
	panel.Name = "IntroPanel"
	panel.AnchorPoint = Vector2.new(0.5, 0.5)
	panel.Size = UDim2.new(0, 440, 0, 150)
	panel.Position = UDim2.new(0.5, 0, 0.37, 0)
	panel.BackgroundColor3 = CONFIG.BasePanelColor
	panel.BorderSizePixel = 0
	panel.Rotation = -3
	panel.ZIndex = 10
	panel.Parent = introGui
	createCorner(panel, CONFIG.CornerRadius)
	local panelStroke = createStroke(panel, CONFIG.StrokeThickness, 0)
	createStudPattern(panel)
	createHighlight(panel)
	track(panel)

	local panelScale = Instance.new("UIScale")
	panelScale.Scale = 0.36
	panelScale.Parent = panel

	local glowTitle = Instance.new("TextLabel")
	glowTitle.Name = "GlowTitle"
	glowTitle.BackgroundTransparency = 1
	glowTitle.Size = UDim2.new(1, -30, 0, 28)
	glowTitle.Position = UDim2.new(0, 15, 0, 18)
	glowTitle.Text = ""
	glowTitle.Font = Enum.Font.GothamBlack
	glowTitle.TextSize = 23
	glowTitle.TextColor3 = getRainbowColor()
	glowTitle.TextTransparency = 0.72
	glowTitle.TextStrokeTransparency = 1
	glowTitle.ZIndex = 11
	glowTitle.Parent = panel
	track(glowTitle)

	local title = Instance.new("TextLabel")
	title.Name = "Title"
	title.BackgroundTransparency = 1
	title.Size = UDim2.new(1, -30, 0, 28)
	title.Position = UDim2.new(0, 15, 0, 18)
	title.Text = ""
	title.Font = Enum.Font.GothamBlack
	title.TextSize = 23
	title.TextColor3 = CONFIG.TextLightColor
	title.TextStrokeTransparency = 0
	title.TextStrokeColor3 = CONFIG.TextDarkStroke
	title.ZIndex = 13
	title.Parent = panel
	track(title)

	local creatorGlow = Instance.new("TextLabel")
	creatorGlow.Name = "CreatorGlow"
	creatorGlow.BackgroundTransparency = 1
	creatorGlow.Size = UDim2.new(1, -30, 0, 58)
	creatorGlow.Position = UDim2.new(0, 15, 0, 54)
	creatorGlow.Text = ""
	creatorGlow.Font = Enum.Font.GothamBlack
	creatorGlow.TextSize = 42
	creatorGlow.TextColor3 = getRainbowColor()
	creatorGlow.TextTransparency = 0.72
	creatorGlow.TextStrokeTransparency = 1
	creatorGlow.ZIndex = 11
	creatorGlow.Parent = panel
	track(creatorGlow)

	local creatorText = Instance.new("TextLabel")
	creatorText.Name = "CreatorText"
	creatorText.BackgroundTransparency = 1
	creatorText.Size = UDim2.new(1, -30, 0, 58)
	creatorText.Position = UDim2.new(0, 15, 0, 54)
	creatorText.Text = ""
	creatorText.Font = Enum.Font.GothamBlack
	creatorText.TextSize = 42
	creatorText.TextColor3 = CONFIG.TextLightColor
	creatorText.TextStrokeTransparency = 0
	creatorText.TextStrokeColor3 = CONFIG.TextDarkStroke
	creatorText.ZIndex = 13
	creatorText.Parent = panel
	track(creatorText)

	local scanBar = Instance.new("Frame")
	scanBar.Name = "ScanBar"
	scanBar.AnchorPoint = Vector2.new(0.5, 0.5)
	scanBar.Size = UDim2.new(0, 100, 1, 0)
	scanBar.Position = UDim2.new(0, -80, 0.5, 0)
	scanBar.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
	scanBar.BackgroundTransparency = 0.55
	scanBar.BorderSizePixel = 0
	scanBar.ZIndex = 12
	scanBar.Parent = panel
	createCorner(scanBar, 999)
	track(scanBar)

	local scanGrad = Instance.new("UIGradient")
	scanGrad.Color = ColorSequence.new({
		ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)),
		ColorSequenceKeypoint.new(0.5, getRainbowColor()),
		ColorSequenceKeypoint.new(1, Color3.fromRGB(255, 255, 255)),
	})
	scanGrad.Transparency = NumberSequence.new({
		NumberSequenceKeypoint.new(0, 1),
		NumberSequenceKeypoint.new(0.3, 0.5),
		NumberSequenceKeypoint.new(0.5, 0.2),
		NumberSequenceKeypoint.new(0.7, 0.5),
		NumberSequenceKeypoint.new(1, 1),
	})
	scanGrad.Parent = scanBar

	local scaleUp = TweenService:Create(panelScale, TweenInfo.new(0.44, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {
		Scale = 1.06,
	})
	local rotateUp = TweenService:Create(panel, TweenInfo.new(0.34, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {
		Rotation = 0,
	})
	scaleUp:Play()
	rotateUp:Play()
	scaleUp.Completed:Wait()

	TweenService:Create(panelScale, TweenInfo.new(0.16, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
		Scale = 1,
	}):Play()

	TweenService:Create(scanBar, TweenInfo.new(0.92, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
		Position = UDim2.new(1, 80, 0.5, 0),
	}):Play()

	task.spawn(function()
		typingEffect(title, CONFIG.CreatorLine, 0.035)
		glowTitle.Text = title.Text
		glowTitle.TextColor3 = state.currentAccent
	end)

	task.wait(0.42)

	typingEffect(creatorText, CONFIG.CreatorName, 0.045)
	creatorGlow.Text = creatorText.Text
	creatorGlow.TextColor3 = state.currentAccent

	TweenService:Create(creatorGlow, TweenInfo.new(0.22, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
		TextTransparency = 0.42,
	}):Play()

	local pulse = TweenService:Create(panelScale, TweenInfo.new(0.22, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, true), {
		Scale = 1.035,
	})
	pulse:Play()

	if camera then
		TweenService:Create(camera, TweenInfo.new(0.8, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut), {
			FieldOfView = originalFov,
		}):Play()
	end

	task.wait(math.max(0.1, CONFIG.IntroDuration - 1.8))
	destroyIntro()
	task.wait(CONFIG.IntroFadeTime + 0.1)
end

--========================================================
-- MAIN GUI
--========================================================
local mainGui = Instance.new("ScreenGui")
mainGui.Name = CONFIG.UIName
mainGui.ResetOnSpawn = false
mainGui.IgnoreGuiInset = true
mainGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
mainGui.Enabled = false
mainGui.Parent = playerGui

local mainShadow = Instance.new("Frame")
mainShadow.Name = "MainShadow"
mainShadow.Size = UDim2.new(0, CONFIG.Width, 0, CONFIG.Height)
mainShadow.Position = UDim2.new(0.5, -(CONFIG.Width / 2) + CONFIG.ShadowOffset, 0.78, -(CONFIG.Height / 2) + CONFIG.ShadowOffset)
mainShadow.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
mainShadow.BackgroundTransparency = 0.55
mainShadow.BorderSizePixel = 0
mainShadow.Parent = mainGui
createCorner(mainShadow, CONFIG.CornerRadius)

local mainFrame = Instance.new("Frame")
mainFrame.Name = "MainFrame"
mainFrame.Size = UDim2.new(0, CONFIG.Width, 0, CONFIG.Height)
mainFrame.Position = UDim2.new(0.5, -(CONFIG.Width / 2), 0.82, 20)
mainFrame.BackgroundColor3 = CONFIG.BasePanelColor
mainFrame.BorderSizePixel = 0
mainFrame.Parent = mainGui
createCorner(mainFrame, CONFIG.CornerRadius)
local mainStroke = createStroke(mainFrame, CONFIG.StrokeThickness, 0)
createStudPattern(mainFrame)
createHighlight(mainFrame)

local mainScale = Instance.new("UIScale")
mainScale.Scale = 0.82
mainScale.Parent = mainFrame

local topBar = Instance.new("Frame")
topBar.Name = "TopBar"
topBar.BackgroundTransparency = 1
topBar.Size = UDim2.new(1, -24, 0, 34)
topBar.Position = UDim2.new(0, 12, 0, 8)
topBar.Active = true
topBar.ZIndex = mainFrame.ZIndex + 3
topBar.Parent = mainFrame

local titleLabel = Instance.new("TextLabel")
titleLabel.Name = "Title"
titleLabel.Size = UDim2.new(1, -4, 1, 0)
titleLabel.Position = UDim2.new(0, 0, 0, 0)
titleLabel.BackgroundTransparency = 1
titleLabel.Text = CONFIG.MainTitle
titleLabel.Font = Enum.Font.GothamBlack
titleLabel.TextSize = 28
titleLabel.TextColor3 = CONFIG.TextLightColor
titleLabel.TextStrokeTransparency = 0
titleLabel.TextStrokeColor3 = CONFIG.TextDarkStroke
titleLabel.TextXAlignment = Enum.TextXAlignment.Left
titleLabel.ZIndex = topBar.ZIndex + 1
titleLabel.Parent = topBar

local infoLabel = Instance.new("TextLabel")
infoLabel.Name = "Info"
infoLabel.Size = UDim2.new(1, -24, 0, 20)
infoLabel.Position = UDim2.new(0, 12, 0, 40)
infoLabel.BackgroundTransparency = 1
infoLabel.Text = CONFIG.InfoText
infoLabel.Font = Enum.Font.GothamBold
infoLabel.TextSize = 14
infoLabel.TextColor3 = CONFIG.TextLightColor
infoLabel.TextStrokeTransparency = 1
infoLabel.TextXAlignment = Enum.TextXAlignment.Left
infoLabel.ZIndex = mainFrame.ZIndex + 2
infoLabel.Parent = mainFrame

local buttonShadow = Instance.new("Frame")
buttonShadow.Name = "ButtonShadow"
buttonShadow.Size = UDim2.new(1, -24, 0, CONFIG.ButtonHeight)
buttonShadow.Position = UDim2.new(0, 12, 0, 60)
buttonShadow.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
buttonShadow.BackgroundTransparency = 0.55
buttonShadow.BorderSizePixel = 0
buttonShadow.Parent = mainFrame
createCorner(buttonShadow, CONFIG.CornerRadius)

local toggleButton = Instance.new("TextButton")
toggleButton.Name = "ToggleButton"
toggleButton.Size = UDim2.new(1, -24, 0, CONFIG.ButtonHeight)
toggleButton.Position = UDim2.new(0, 12, 0, 60)
toggleButton.BackgroundColor3 = CONFIG.BaseButtonOffColor
toggleButton.BorderSizePixel = 0
toggleButton.AutoButtonColor = false
toggleButton.Text = CONFIG.ButtonTextOff
toggleButton.Font = Enum.Font.GothamBlack
toggleButton.TextSize = 22
toggleButton.TextColor3 = CONFIG.TextLightColor
toggleButton.TextStrokeTransparency = 0
toggleButton.TextStrokeColor3 = CONFIG.TextDarkStroke
toggleButton.Parent = mainFrame
createCorner(toggleButton, CONFIG.CornerRadius)
local buttonStroke = createStroke(toggleButton, CONFIG.StrokeThickness, 0)
createStudPattern(toggleButton)
createHighlight(toggleButton)

local buttonScale = Instance.new("UIScale")
buttonScale.Scale = 1
buttonScale.Parent = toggleButton

local statusLabel = Instance.new("TextLabel")
statusLabel.Name = "Status"
statusLabel.Size = UDim2.new(1, -24, 0, 18)
statusLabel.Position = UDim2.new(0, 12, 0, 122)
statusLabel.BackgroundTransparency = 1
statusLabel.Text = "Status: INAKTIV"
statusLabel.Font = Enum.Font.GothamBold
statusLabel.TextSize = 14
statusLabel.TextColor3 = CONFIG.TextLightColor
statusLabel.TextStrokeTransparency = 1
statusLabel.TextXAlignment = Enum.TextXAlignment.Center
statusLabel.ZIndex = mainFrame.ZIndex + 2
statusLabel.Parent = mainFrame

local hintLabel = Instance.new("TextLabel")
hintLabel.Name = "Hint"
hintLabel.Size = UDim2.new(1, -24, 0, 18)
hintLabel.Position = UDim2.new(0, 12, 0, 141)
hintLabel.BackgroundTransparency = 1
hintLabel.Text = CONFIG.HintText
hintLabel.Font = Enum.Font.GothamBold
hintLabel.TextSize = 13
hintLabel.TextColor3 = CONFIG.TextLightColor
hintLabel.TextStrokeTransparency = 1
hintLabel.TextXAlignment = Enum.TextXAlignment.Center
hintLabel.ZIndex = mainFrame.ZIndex + 2
hintLabel.Parent = mainFrame

--========================================================
-- DRAG
--========================================================
local function beginDrag(input)
	state.dragging = true
	state.dragStart = input.Position
	state.frameStart = mainFrame.Position

	input.Changed:Connect(function()
		if input.UserInputState == Enum.UserInputState.End then
			state.dragging = false
		end
	end)
end

local function updateDrag(input)
	if not state.dragging or not state.dragStart or not state.frameStart then
		return
	end

	local delta = input.Position - state.dragStart
	mainFrame.Position = UDim2.new(
		state.frameStart.X.Scale,
		state.frameStart.X.Offset + delta.X,
		state.frameStart.Y.Scale,
		state.frameStart.Y.Offset + delta.Y
	)

	mainShadow.Position = UDim2.new(
		mainFrame.Position.X.Scale,
		mainFrame.Position.X.Offset + CONFIG.ShadowOffset,
		mainFrame.Position.Y.Scale,
		mainFrame.Position.Y.Offset + CONFIG.ShadowOffset
	)
end

topBar.InputBegan:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		beginDrag(input)
	end
end)

topBar.InputChanged:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseMovement then
		state.dragInput = input
	end
end)

UserInputService.InputChanged:Connect(function(input)
	if input == state.dragInput and state.dragging then
		updateDrag(input)
	end
end)

--========================================================
-- UI UPDATE
--========================================================
local function refreshUi()
	if state.enabled then
		toggleButton.Text = CONFIG.ButtonTextOn
		toggleButton.BackgroundColor3 = state.currentAccent
		statusLabel.Text = "Status: AKTIV"
		statusLabel.TextColor3 = state.currentAccent
		hintLabel.TextColor3 = state.currentAccent
		mainStroke.Color = state.currentAccent
		buttonStroke.Color = CONFIG.TextDarkStroke
	else
		toggleButton.Text = CONFIG.ButtonTextOff
		toggleButton.BackgroundColor3 = CONFIG.BaseButtonOffColor
		statusLabel.Text = "Status: INAKTIV"
		statusLabel.TextColor3 = CONFIG.TextLightColor
		hintLabel.TextColor3 = CONFIG.TextLightColor
		mainStroke.Color = state.currentAccent
		buttonStroke.Color = CONFIG.TextDarkStroke
	end

	titleLabel.TextColor3 = state.currentAccent
	infoLabel.TextColor3 = state.currentAccent
end

local function setEnabled(value)
	state.enabled = value and true or false
	refreshUi()
end

local function toggleEnabled()
	setEnabled(not state.enabled)

	local pulse = TweenService:Create(buttonScale, TweenInfo.new(0.1, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {
		Scale = 1.05,
	})
	pulse:Play()
	pulse.Completed:Connect(function()
		if buttonScale and buttonScale.Parent then
			TweenService:Create(buttonScale, TweenInfo.new(0.12, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
				Scale = 1,
			}):Play()
		end
	end)
end

--========================================================
-- INPUT
--========================================================
toggleButton.Activated:Connect(function()
	toggleEnabled()
end)

UserInputService.InputBegan:Connect(function(input, gameProcessed)
	if gameProcessed then
		return
	end

	if input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode == CONFIG.ToggleKey then
		toggleEnabled()
		return
	end

	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		if canTeleport() and not hasTextFocus() then
			local position = getWorldHitPosition()
			if position then
				teleportTo(position)
			end
		end
	end
end)

--========================================================
-- CHARACTER REFRESH
--========================================================
local function refreshCharacterReferences()
	character = player.Character or player.CharacterAdded:Wait()
	humanoidRootPart = character:WaitForChild("HumanoidRootPart", 5)
end

refreshCharacterReferences()

player.CharacterAdded:Connect(function(newCharacter)
	character = newCharacter
	humanoidRootPart = newCharacter:WaitForChild("HumanoidRootPart", 5)
	state.lastTeleportTime = 0
end)

--========================================================
-- RGB LOOP
--========================================================
task.spawn(function()
	while true do
		task.wait(CONFIG.RGBUpdateRate)

		state.currentAccent = getRainbowColor()

		if state.introRunning and introGui and introGui.Parent then
			for _, obj in ipairs(introObjects) do
				if obj and obj.Parent and obj:IsA("TextLabel") then
					if obj.Name == "Title" or obj.Name == "GlowTitle" or obj.Name == "CreatorGlow" then
						obj.TextColor3 = state.currentAccent
					end
				end
			end

			local panel = introGui:FindFirstChild("IntroPanel")
			if panel then
				local stroke = panel:FindFirstChildOfClass("UIStroke")
				if stroke then
					stroke.Color = state.currentAccent
				end
			end
		end

		if mainGui and mainGui.Parent then
			refreshUi()
		end
	end
end)

--========================================================
-- START
--========================================================
task.spawn(function()
	local success, err = pcall(runIntro)
	if not success then
		warn("[Teleport Intro Error]", err)
		destroyIntro()
	end

	mainGui.Enabled = true
	mainFrame.Position = UDim2.new(0.5, -(CONFIG.Width / 2), 0.78, -(CONFIG.Height / 2))
	mainScale.Scale = 0.82

	local openTween = TweenService:Create(mainScale, TweenInfo.new(0.42, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {
		Scale = 1,
	})
	openTween:Play()

	local slideTween = TweenService:Create(mainFrame, TweenInfo.new(0.4, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {
		Position = UDim2.new(0.5, -(CONFIG.Width / 2), 0.78, -(CONFIG.Height / 2)),
	})
	slideTween:Play()

	TweenService:Create(mainShadow, TweenInfo.new(0.38, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
		BackgroundTransparency = 0.55,
	}):Play()

	setEnabled(false)
	refreshUi()
end)

Features & Information

Its just like the title says
#ClickToTeleport teleport#Teleport

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts