
Keyless

local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local mouse = player:GetMouse()
local workspaceNPCs = game.Workspace:FindFirstChild("NPCs")
if not workspaceNPCs then
warn("NPCs folder not found in Workspace.")
return
end
local merusNPC = workspaceNPCs:FindFirstChild("MerusCH")
if not merusNPC then
warn("MerusCH NPC not found in NPCs folder.")
return
end
local npcRootPart = merusNPC:FindFirstChild("HumanoidRootPart")
if not npcRootPart then
warn("HumanoidRootPart not found in MerusCH.")
return
end
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = player:WaitForChild("PlayerGui")
local teleportButton = Instance.new("TextButton")
teleportButton.Size = UDim2.new(0, 220, 0, 60)
teleportButton.Position = UDim2.new(1, -230, 0, 520) -- Position on the right side and slightly lower
teleportButton.Text = "Teleport Off"
teleportButton.BackgroundColor3 = Color3.fromRGB(200, 100, 100)
teleportButton.TextColor3 = Color3.fromRGB(255, 255, 255)
teleportButton.Font = Enum.Font.GothamBold
teleportButton.TextSize = 24
teleportButton.Parent = screenGui
teleportButton.ClipsDescendants = true
local corner = Instance.new("UICorner")
corner.CornerRadius = UDim.new(0, 12)
corner.Parent = teleportButton
local isTeleportActive = false
local function teleportToNPC()
if character then
local playerRootPart = character:FindFirstChild("HumanoidRootPart")
if playerRootPart then
local offset = 4
local behindPosition = npcRootPart.CFrame * CFrame.new(0, 0, offset)
playerRootPart.CFrame = behindPosition
else
warn("HumanoidRootPart not found for the player's character.")
end
else
warn("Player's character not found.")
end
end
local function toggleTeleport()
isTeleportActive = not isTeleportActive
if isTeleportActive then
teleportButton.Text = "Teleport On"
teleportButton.BackgroundColor3 = Color3.fromRGB(100, 200, 100)
local tween = TweenService:Create(teleportButton, TweenInfo.new(0.3), {BackgroundColor3 = Color3.fromRGB(100, 200, 100)})
tween:Play()
else
teleportButton.Text = "Teleport Off"
teleportButton.BackgroundColor3 = Color3.fromRGB(200, 100, 100)
local tween = TweenService:Create(teleportButton, TweenInfo.new(0.3), {BackgroundColor3 = Color3.fromRGB(200, 100, 100)})
tween:Play()
end
end
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.UserInputType == Enum.UserInputType.MouseButton1 and isTeleportActive then
teleportToNPC()
end
end)
teleportButton.MouseButton1Click:Connect(toggleTeleport)
Doesn't work