-- Updated Teleport UI Script for Survive in Area 51 Remake -- Fixes: Improved dragging code using input.Changed (works better on mobile/PC, no global connections). -- Added loading notification via StarterGui for visibility. -- Adjusted frame height to fit all buttons without clipping. -- Debug prints kept for console. -- Features: Movable UI (drag by title), Credit added. -- This is a LocalScript. Execute via your executor (try disabling other scripts if not loading). print("Starting script...") local Players = game:GetService("Players") local TweenService = game:GetService("TweenService") local UserInputService = game:GetService("UserInputService") local StarterGui = game:GetService("StarterGui") local player = Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") print("Services and player loaded.") -- Safely create UI with pcall local success, screenGui = pcall(function() local sg = Instance.new("ScreenGui") sg.Name = "TeleportUI" sg.Parent = playerGui sg.ResetOnSpawn = false return sg end) if success then print("ScreenGui created successfully.") else warn("Failed to create ScreenGui: " .. tostring(screenGui)) return end print("Creating Main Frame...") -- Create Main Frame (increased height to fit buttons) local mainFrame = Instance.new("Frame") mainFrame.Name = "MainFrame" mainFrame.Size = UDim2.new(0, 220, 0, 360) -- Adjusted height mainFrame.Position = UDim2.new(0, 10, 0, 10) mainFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50) mainFrame.BorderSizePixel = 0 mainFrame.Parent = screenGui print("MainFrame created.") -- Add corner radius local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 10) corner.Parent = mainFrame -- Title Label (draggable) local titleLabel = Instance.new("TextLabel") titleLabel.Name = "Title" titleLabel.Size = UDim2.new(1, 0, 0, 30) titleLabel.Position = UDim2.new(0, 0, 0, 0) titleLabel.BackgroundColor3 = Color3.fromRGB(30, 30, 30) titleLabel.BorderSizePixel = 0 titleLabel.Text = "Hidden Pads Teleport" titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255) titleLabel.TextScaled = true titleLabel.Font = Enum.Font.SourceSansBold titleLabel.Parent = mainFrame local titleCorner = Instance.new("UICorner") titleCorner.CornerRadius = UDim.new(0, 10) titleCorner.Parent = titleLabel print("Title created.") -- Improved dragging: Uses input.Changed for both mouse and touch local dragging = false local dragStart = nil local startPos = nil titleLabel.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPos = mainFrame.Position local connection connection = input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false connection:Disconnect() else local delta = input.Position - dragStart mainFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y) end end) end end) print("Improved dragging setup (PC + Mobile).") -- Get character safely local function getCharacter() local character = player.Character if not character then return nil end local humanoidRootPart = character:FindFirstChild("HumanoidRootPart") if not humanoidRootPart then return nil end return {character = character, humanoidRootPart = humanoidRootPart} end -- Teleport function local function teleportTo(padName) print("Attempting to teleport to: " .. padName) local charData = getCharacter() if not charData then warn("Teleport failed: Character not ready") return end local mapFolder = workspace:FindFirstChild("MapFolder") if not mapFolder then warn("Teleport failed: MapFolder not found") return end local inside = mapFolder:FindFirstChild("Inside") if not inside then warn("Teleport failed: Inside not found") return end local hiddenPads = inside:FindFirstChild("Hidden Pads") if not hiddenPads then warn("Teleport failed: Hidden Pads not found") return end local padModel = hiddenPads:FindFirstChild(padName) if not padModel then warn("Teleport failed: Pad model '" .. padName .. "' not found") print("Available pads in Hidden Pads:") for _, child in pairs(hiddenPads:GetChildren()) do print("- " .. child.Name) end return end print("Found pad model: " .. padModel.Name .. " (Class: " .. padModel.ClassName .. ")") print("Pad model children count: " .. #padModel:GetChildren()) for _, child in pairs(padModel:GetChildren()) do print("- Child: " .. child.Name .. " (Class: " .. child.ClassName .. ")") end -- Try to find "Pad" first local actualPad = padModel:FindFirstChild("Pad") if not actualPad or not actualPad:IsA("BasePart") then -- Fallback: Find any BasePart actualPad = padModel:FindFirstChildWhichIsA("BasePart") if not actualPad then warn("Teleport failed: No BasePart found in '" .. padName .. "'") return end print("Using fallback BasePart for teleport: " .. actualPad.Name) else print("Using 'Pad' part for teleport") end local tpSuccess, err = pcall(function() charData.humanoidRootPart.CFrame = actualPad.CFrame + Vector3.new(0, 5, 0) end) if tpSuccess then print("Teleported to " .. padName .. " successfully!") else warn("Teleport error: " .. tostring(err)) end end print("Functions defined. Creating buttons...") -- Button creation function local function createButton(name, posY, color, padName) local button = Instance.new("TextButton") button.Name = name .. "Button" button.Size = UDim2.new(1, -20, 0, 30) button.Position = UDim2.new(0, 10, 0, posY) button.BackgroundColor3 = color button.Text = name button.TextColor3 = Color3.fromRGB(255, 255, 255) button.TextScaled = true button.Font = Enum.Font.SourceSans button.Parent = mainFrame local btnCorner = Instance.new("UICorner") btnCorner.CornerRadius = UDim.new(0, 5) btnCorner.Parent = button button.MouseButton1Click:Connect(function() teleportTo(padName) end) print("Button created: " .. name) return button end -- Create buttons local lxwButton = createButton("LXW Pad", 40, Color3.fromRGB(0, 162, 255), "LXW Pad") local vulcanButton = createButton("Vulcan Pad", 80, Color3.fromRGB(255, 162, 0), "Vulcan Pad") local garandButton = createButton("Platinum M1 Garand", 120, Color3.fromRGB(128, 0, 128), "Platinum M1 Garand Pad") local icicleButton = createButton("Icicle Launcher", 160, Color3.fromRGB(0, 200, 255), "Icicle Launcher Pad") local secretButton = createButton("Secret Shop TP", 200, Color3.fromRGB(0, 255, 0), "Dual LX1") local fryingButton = createButton("Frying Pan Giver", 240, Color3.fromRGB(255, 165, 0), "Frying Pan Giver") local medkitButton = createButton("Bronze Medkit Pad", 280, Color3.fromRGB(0, 255, 255), "Bronze Medkit Pad") local pickaxeButton = createButton("Pickaxe Giver (Dangerous)", 320, Color3.fromRGB(139, 69, 19), "Pickaxe Giver") print("Buttons created.") -- Store original sizes local originalSizes = {} for _, btn in pairs({lxwButton, vulcanButton, garandButton, icicleButton, secretButton, fryingButton, medkitButton, pickaxeButton}) do originalSizes[btn] = btn.Size end local hoverOffset = UDim2.new(0, 10, 0, 5) local tweenInfo = TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out) -- Hover effect local function addHoverEffect(button) local enlargedSize = originalSizes[button] + hoverOffset local currentTween = nil button.MouseEnter:Connect(function() if currentTween then currentTween:Cancel() end currentTween = TweenService:Create(button, tweenInfo, {Size = enlargedSize}):Play() end) button.MouseLeave:Connect(function() if currentTween then currentTween:Cancel() end currentTween = TweenService:Create(button, tweenInfo, {Size = originalSizes[button]}):Play() end) end for _, btn in pairs({lxwButton, vulcanButton, garandButton, icicleButton, secretButton, fryingButton, medkitButton, pickaxeButton}) do addHoverEffect(btn) end print("Hover effects added.") -- Credit Label local creditLabel = Instance.new("TextLabel") creditLabel.Name = "Credit" creditLabel.Size = UDim2.new(1, 0, 0, 20) creditLabel.Position = UDim2.new(0, 0, 1, -20) creditLabel.BackgroundTransparency = 1 creditLabel.Text = "Made by Grok" creditLabel.TextColor3 = Color3.fromRGB(150, 150, 150) creditLabel.TextScaled = true creditLabel.Font = Enum.Font.SourceSansItalic creditLabel.Parent = mainFrame print("Credit added.") -- Handle respawn player.CharacterAdded:Connect(function() wait(1) print("Character respawned.") end) -- Loading notification pcall(function() StarterGui:SetCore("SendNotification", { Title = "Teleport UI"; Text = "Loaded successfully! Drag title to move. Top-left corner."; Duration = 5; }) end) print("UI fully loaded! Notification sent. Console errors likely from game/Infinite Yield - ignore.") print("Improved mobile dragging. If still not loading, try executing alone or check for syntax in executor.")