Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- [[ OTIMIZAÇÃO 1: PREVENÇÃO DE DUPLICIDADE E CRASH ]]
- if getgenv().SaveLocateRunning then
- local oldGui = game:GetService("CoreGui"):FindFirstChild("Save Locate (NickZ) V5 Stable")
- if oldGui then oldGui:Destroy() end
- end
- getgenv().SaveLocateRunning = true
- if not game or not game:IsLoaded() then game.Loaded:Wait() end
- -- Serviços
- local Players = game:GetService("Players")
- local HttpService = game:GetService("HttpService")
- local TweenService = game:GetService("TweenService")
- local UserInputService = game:GetService("UserInputService")
- local RunService = game:GetService("RunService")
- local CoreGui = game:GetService("CoreGui")
- local plr = Players.LocalPlayer
- -- [[ REFERÊNCIA SEGURA AO PERSONAGEM ]]
- local function getRoot()
- local char = plr.Character
- if char then
- return char:FindFirstChild("HumanoidRootPart"), char:FindFirstChildWhichIsA("Humanoid")
- end
- return nil, nil
- end
- -- Estado
- local savedPositions = {}
- local maxSaves = 50
- local slotsPerPage = 10
- local maxPages = 5
- local currentPage = 1
- local currentSaveSlot = 1
- local mainPosition = nil
- -- Variáveis de controle
- local isTeleporting = false
- local isSaving = false
- -- Helpers de FS
- local hasWrite = (type(writefile) == "function")
- local hasRead = (type(readfile) == "function")
- local hasFS = (hasWrite and hasRead)
- local hasFolder = (type(isfolder) == "function" and type(makefolder) == "function")
- local hasDelFile = (type(delfile) == "function")
- local SAVE_DIR = "SaveLocate_NickZ"
- local GAME_DIR = tostring(game.PlaceId)
- if hasFolder then
- pcall(function()
- if not isfolder(SAVE_DIR) then makefolder(SAVE_DIR) end
- if not isfolder(SAVE_DIR .. "/" .. GAME_DIR) then makefolder(SAVE_DIR .. "/" .. GAME_DIR) end
- end)
- end
- local BASE_NAME = string.format("Saves_%s.json", plr.UserId)
- local MAIN_NAME = string.format("MainPos_%s.json", plr.UserId)
- local SAVE_FILE = hasFolder and (SAVE_DIR .. "/" .. GAME_DIR .. "/" .. BASE_NAME) or string.format("SaveLocate_%d_%s.json", game.PlaceId, plr.UserId)
- local MAIN_FILE = hasFolder and (SAVE_DIR .. "/" .. GAME_DIR .. "/" .. MAIN_NAME) or string.format("MainPos_%d_%s.json", game.PlaceId, plr.UserId)
- -- Funções de Dados
- local function encodeCFrame(cf)
- local x,y,z,R00,R01,R02,R10,R11,R12,R20,R21,R22 = cf:GetComponents()
- return {x=x,y=y,z=z,R00=R00,R01=R01,R02=R02,R10=R10,R11=R11,R12=R12,R20=R20,R21=R21,R22=R22}
- end
- local function decodeCFrame(t)
- if type(t)=="table" and t.x and t.R00 then
- return CFrame.new(t.x,t.y,t.z, t.R00,t.R01,t.R02, t.R10,t.R11,t.R12, t.R20,t.R21,t.R22)
- end
- return nil
- end
- local function safeRead(path)
- if not hasFS then return nil end
- local success, content = pcall(readfile, path)
- if success and type(content) == "string" and #content > 0 then
- return content
- end
- return nil
- end
- local function safeWrite(path, data)
- if not hasFS then return end
- local success, encoded = pcall(function() return HttpService:JSONEncode(data) end)
- if success then
- pcall(writefile, path, encoded)
- end
- end
- -- Persistência
- local function saveMainPosition()
- if not mainPosition then return end
- local data = {
- position = encodeCFrame(mainPosition.position),
- name = mainPosition.name,
- timestamp = mainPosition.timestamp,
- gameId = game.PlaceId
- }
- safeWrite(MAIN_FILE, data)
- end
- local function loadMainPosition()
- local content = safeRead(MAIN_FILE)
- if not content then return end
- local ok, data = pcall(function() return HttpService:JSONDecode(content) end)
- if ok and type(data) == "table" and (data.gameId == game.PlaceId or not data.gameId) then
- local cf = decodeCFrame(data.position)
- if cf then
- mainPosition = {
- position = cf,
- name = data.name or "Posição Principal",
- timestamp = data.timestamp or os.date("%Y-%m-%d %H:%M:%S")
- }
- end
- end
- end
- local function saveToDisk()
- local out = {
- gameId = game.PlaceId,
- userId = plr.UserId,
- positions = {}
- }
- for slot, data in pairs(savedPositions) do
- if type(slot)=="number" and slot>=1 and slot<=maxSaves and typeof(data.position)=="CFrame" then
- out.positions[tostring(slot)] = {
- name = data.name,
- timestamp = data.timestamp,
- position = encodeCFrame(data.position)
- }
- end
- end
- safeWrite(SAVE_FILE, out)
- saveMainPosition()
- end
- local function loadFromDisk()
- local content = safeRead(SAVE_FILE)
- if not content then loadMainPosition(); return end
- local ok, data = pcall(function() return HttpService:JSONDecode(content) end)
- if not ok or type(data) ~= "table" then loadMainPosition(); return end
- local positions = data.positions or data
- table.clear(savedPositions)
- for k,v in pairs(positions) do
- local slot = tonumber(k)
- if slot and slot >= 1 and slot <= maxSaves and type(v) == "table" then
- local cf = decodeCFrame(v.position)
- if cf then
- savedPositions[slot] = {
- position = cf,
- name = v.name or ("Slot "..slot),
- timestamp = v.timestamp or os.date("%Y-%m-%d %H:%M:%S")
- }
- end
- end
- end
- loadMainPosition()
- end
- -- [[ TELEPORTE ULTRA SEGURO ]]
- local function teleportTo(cframe)
- if isTeleporting then return false end
- local root, hum = getRoot()
- if root and cframe then
- isTeleporting = true
- if hum and hum.SeatPart then pcall(function() hum.Sit = false end) end
- local success, err = pcall(function()
- local oldAnchor = root.Anchored
- root.Anchored = true
- root.Velocity = Vector3.zero
- root.RotVelocity = Vector3.zero
- root.CFrame = cframe
- RunService.Heartbeat:Wait()
- root.CFrame = cframe
- root.Anchored = oldAnchor
- end)
- task.delay(0.5, function() isTeleporting = false end)
- return success
- end
- return false
- end
- --================================================================================
- -- [UI E INTERFACE]
- --================================================================================
- local function AnimateHover(button, a, b)
- button.MouseEnter:Connect(function()
- TweenService:Create(button, TweenInfo.new(0.2), {BackgroundColor3 = a}):Play()
- end)
- button.MouseLeave:Connect(function()
- TweenService:Create(button, TweenInfo.new(0.2), {BackgroundColor3 = b}):Play()
- end)
- end
- local ScreenGui = Instance.new("ScreenGui")
- ScreenGui.Name = "Save Locate (NickZ) V5 Stable"
- ScreenGui.ResetOnSpawn = false
- if gethui then ScreenGui.Parent = gethui()
- elseif syn and syn.protect_gui then syn.protect_gui(ScreenGui); ScreenGui.Parent = CoreGui
- else ScreenGui.Parent = CoreGui end
- local MainFrame = Instance.new("Frame")
- MainFrame.Size = UDim2.new(0, 600, 0, 460)
- MainFrame.Position = UDim2.new(0.5, -300, 0.5, -230)
- MainFrame.BackgroundColor3 = Color3.fromRGB(20, 18, 28)
- MainFrame.BackgroundTransparency = 0.2
- MainFrame.BorderSizePixel = 0
- MainFrame.AnchorPoint = Vector2.new(0.5, 0.5)
- MainFrame.Active = true
- MainFrame.Draggable = true
- MainFrame.ClipsDescendants = true
- MainFrame.Parent = ScreenGui
- local UICorner = Instance.new("UICorner", MainFrame)
- UICorner.CornerRadius = UDim.new(0, 8)
- local UIStroke = Instance.new("UIStroke", MainFrame)
- UIStroke.Color = Color3.fromRGB(120, 90, 255)
- UIStroke.Thickness = 1.5
- local UIGradient_BG = Instance.new("UIGradient", MainFrame)
- UIGradient_BG.Color = ColorSequence.new({
- ColorSequenceKeypoint.new(0, Color3.fromRGB(25, 22, 38)),
- ColorSequenceKeypoint.new(1, Color3.fromRGB(45, 40, 65))
- })
- UIGradient_BG.Rotation = 90
- local TopBar = Instance.new("Frame", MainFrame)
- TopBar.Size = UDim2.new(1, 0, 0, 40)
- TopBar.BackgroundTransparency = 1
- local TitleLabel = Instance.new("TextLabel", TopBar)
- TitleLabel.Size = UDim2.new(1, -85, 1, 0) -- Ajustado para caber 2 botões
- TitleLabel.Position = UDim2.new(0, 15, 0, 0)
- TitleLabel.BackgroundTransparency = 1
- TitleLabel.Text = "✧ Save Locate (NickZ)"
- TitleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- TitleLabel.Font = Enum.Font.GothamSemibold
- TitleLabel.TextSize = 18
- TitleLabel.TextXAlignment = Enum.TextXAlignment.Left
- -- [[ NOVO SISTEMA DE FECHAR ]]
- -- Botão Minimizar (Antigo CloseBtn, agora ajustado)
- local MinimizeBtn = Instance.new("TextButton", TopBar)
- MinimizeBtn.Name = "MinimizeBtn"
- MinimizeBtn.Size = UDim2.new(0, 30, 0, 30)
- MinimizeBtn.Position = UDim2.new(1, -70, 0.5, -15) -- Movido para a esquerda
- MinimizeBtn.BackgroundColor3 = Color3.fromRGB(45, 40, 65)
- MinimizeBtn.Text = "–" -- Símbolo de minimizar (Traço)
- MinimizeBtn.Font = Enum.Font.GothamBold
- MinimizeBtn.TextSize = 18
- MinimizeBtn.TextColor3 = Color3.fromRGB(200, 200, 255) -- Cor azulada para minimizar
- local C_Min = Instance.new("UICorner", MinimizeBtn)
- C_Min.CornerRadius = UDim.new(0, 6)
- AnimateHover(MinimizeBtn, Color3.fromRGB(60, 55, 80), Color3.fromRGB(45, 40, 65))
- MinimizeBtn.MouseButton1Click:Connect(function() MainFrame.Visible = false end)
- -- Botão Fechar Totalmente (Terminate)
- local TerminateBtn = Instance.new("TextButton", TopBar)
- TerminateBtn.Name = "TerminateBtn"
- TerminateBtn.Size = UDim2.new(0, 30, 0, 30)
- TerminateBtn.Position = UDim2.new(1, -35, 0.5, -15) -- Extrema direita
- TerminateBtn.BackgroundColor3 = Color3.fromRGB(45, 40, 65)
- TerminateBtn.Text = "✕" -- Símbolo de Fechar (X)
- TerminateBtn.Font = Enum.Font.GothamBold
- TerminateBtn.TextSize = 16
- TerminateBtn.TextColor3 = Color3.fromRGB(255, 80, 80) -- Cor vermelha para perigo/fechar
- local C_Term = Instance.new("UICorner", TerminateBtn)
- C_Term.CornerRadius = UDim.new(0, 6)
- AnimateHover(TerminateBtn, Color3.fromRGB(200, 60, 60), Color3.fromRGB(45, 40, 65))
- local OpenBtn = Instance.new("TextButton", ScreenGui)
- OpenBtn.Size = UDim2.new(0, 45, 0, 45)
- OpenBtn.Position = UDim2.new(0, 15, 0.5, -22.5)
- OpenBtn.BackgroundColor3 = Color3.fromRGB(20, 18, 28)
- OpenBtn.Text = "✧"
- OpenBtn.Font = Enum.Font.GothamBold
- OpenBtn.TextSize = 24
- OpenBtn.TextColor3 = Color3.fromRGB(120, 90, 255)
- OpenBtn.Visible = false
- local C2 = Instance.new("UICorner", OpenBtn)
- C2.CornerRadius = UDim.new(0, 8)
- local S2 = Instance.new("UIStroke", OpenBtn)
- S2.Color = Color3.fromRGB(120, 90, 255)
- S2.Thickness = 1.5
- OpenBtn.MouseButton1Click:Connect(function() MainFrame.Visible = true end)
- MainFrame:GetPropertyChangedSignal("Visible"):Connect(function() OpenBtn.Visible = not MainFrame.Visible end)
- local MainPosContainer = Instance.new("Frame", ScreenGui)
- MainPosContainer.Size = UDim2.new(0, 50, 0, 50)
- MainPosContainer.Position = UDim2.new(1, -60, 0, 10)
- MainPosContainer.BackgroundTransparency = 1
- MainPosContainer.Visible = false
- MainPosContainer.Active = true
- MainPosContainer.Draggable = true
- local MainPosBtn = Instance.new("TextButton", MainPosContainer)
- MainPosBtn.Size = UDim2.new(1, 0, 1, 0)
- MainPosBtn.Position = UDim2.new(0, 0, 0, 0)
- MainPosBtn.BackgroundColor3 = Color3.fromRGB(25, 22, 38)
- MainPosBtn.BackgroundTransparency = 0.1
- MainPosBtn.Text = "🚀"
- MainPosBtn.Font = Enum.Font.GothamBold
- MainPosBtn.TextSize = 24
- MainPosBtn.TextColor3 = Color3.new(1, 1, 1)
- local MP_Corner = Instance.new("UICorner", MainPosBtn)
- MP_Corner.CornerRadius = UDim.new(0.5, 0)
- local MP_Stroke = Instance.new("UIStroke", MainPosBtn)
- MP_Stroke.Color = Color3.fromRGB(120, 90, 255)
- MP_Stroke.Thickness = 2
- local MP_Tooltip = Instance.new("TextLabel", MainPosBtn)
- MP_Tooltip.Size = UDim2.new(0, 150, 0, 30)
- MP_Tooltip.Position = UDim2.new(-3.2, 0, 0.5, -15)
- MP_Tooltip.BackgroundColor3 = Color3.fromRGB(20, 18, 28)
- MP_Tooltip.BackgroundTransparency = 0.1
- MP_Tooltip.Text = ""
- MP_Tooltip.TextColor3 = Color3.fromRGB(255, 255, 255)
- MP_Tooltip.Font = Enum.Font.Gotham
- MP_Tooltip.TextSize = 12
- MP_Tooltip.Visible = false
- MP_Tooltip.ZIndex = 2
- local Tooltip_Corner = Instance.new("UICorner", MP_Tooltip)
- Tooltip_Corner.CornerRadius = UDim.new(0, 6)
- local Tooltip_Stroke = Instance.new("UIStroke", MP_Tooltip)
- Tooltip_Stroke.Color = Color3.fromRGB(120, 90, 255)
- Tooltip_Stroke.Thickness = 1
- local MP_RemoveBtn = Instance.new("TextButton", MainPosBtn)
- MP_RemoveBtn.Size = UDim2.new(0, 20, 0, 20)
- MP_RemoveBtn.Position = UDim2.new(1, -5, 0, -5)
- MP_RemoveBtn.BackgroundColor3 = Color3.fromRGB(200, 80, 80)
- MP_RemoveBtn.Text = "×"
- MP_RemoveBtn.Font = Enum.Font.GothamBold
- MP_RemoveBtn.TextSize = 14
- MP_RemoveBtn.TextColor3 = Color3.new(1, 1, 1)
- MP_RemoveBtn.Visible = false
- MP_RemoveBtn.ZIndex = 3
- local Remove_Corner = Instance.new("UICorner", MP_RemoveBtn)
- Remove_Corner.CornerRadius = UDim.new(0.5, 0)
- MainPosBtn.MouseButton1Click:Connect(function()
- if mainPosition and teleportTo(mainPosition.position) then
- MainPosBtn.Text = "✅"
- TweenService:Create(MainPosBtn, TweenInfo.new(0.2), {BackgroundColor3 = Color3.fromRGB(80, 200, 120)}):Play()
- task.wait(1)
- if MainPosBtn.Parent then
- MainPosBtn.Text = "🚀"
- TweenService:Create(MainPosBtn, TweenInfo.new(0.2), {BackgroundColor3 = Color3.fromRGB(25, 22, 38)}):Play()
- end
- end
- end)
- MainPosBtn.MouseEnter:Connect(function()
- if mainPosition then
- MP_Tooltip.Text = mainPosition.name or "Principal"
- MP_Tooltip.Visible = true
- MP_RemoveBtn.Visible = true
- end
- TweenService:Create(MainPosBtn, TweenInfo.new(0.2), {Size = UDim2.new(1.1, 0, 1.1, 0)}):Play()
- TweenService:Create(MP_Stroke, TweenInfo.new(0.2), {Thickness = 3}):Play()
- end)
- MainPosBtn.MouseLeave:Connect(function()
- MP_Tooltip.Visible = false
- MP_RemoveBtn.Visible = false
- TweenService:Create(MainPosBtn, TweenInfo.new(0.2), {Size = UDim2.new(1, 0, 1, 0)}):Play()
- TweenService:Create(MP_Stroke, TweenInfo.new(0.2), {Thickness = 2}):Play()
- end)
- local ControlsFrame = Instance.new("Frame", MainFrame)
- ControlsFrame.Size = UDim2.new(1, -20, 0, 90)
- ControlsFrame.Position = UDim2.new(0, 10, 0, 45)
- ControlsFrame.BackgroundTransparency = 1
- local SaveButton = Instance.new("TextButton", ControlsFrame)
- SaveButton.Text = "Salvar Posição"
- SaveButton.Size = UDim2.new(0.5, -5, 1, -50)
- SaveButton.Position = UDim2.new(0, 0, 0, 0)
- SaveButton.BackgroundColor3 = Color3.fromRGB(60, 180, 120)
- SaveButton.Font = Enum.Font.GothamSemibold
- SaveButton.TextSize = 16
- SaveButton.TextColor3 = Color3.new(1, 1, 1)
- local C3 = Instance.new("UICorner", SaveButton)
- C3.CornerRadius = UDim.new(0, 6)
- AnimateHover(SaveButton, Color3.fromRGB(80, 220, 140), Color3.fromRGB(60, 180, 120))
- local NameField = Instance.new("TextBox", ControlsFrame)
- NameField.PlaceholderText = "Nome da Posição..."
- NameField.Size = UDim2.new(1, 0, 0, 40)
- NameField.Position = UDim2.new(0, 0, 0, 50)
- NameField.BackgroundColor3 = Color3.fromRGB(30, 28, 42)
- NameField.TextColor3 = Color3.new(1, 1, 1)
- NameField.Font = Enum.Font.Gotham
- NameField.TextSize = 14
- NameField.PlaceholderColor3 = Color3.fromRGB(150,150,150)
- local C4 = Instance.new("UICorner", NameField)
- C4.CornerRadius = UDim.new(0, 6)
- local S4 = Instance.new("UIStroke", NameField)
- S4.Color = Color3.fromRGB(80, 70, 130)
- S4.Thickness = 1
- local SaveSlotLabel = Instance.new("TextLabel", ControlsFrame)
- SaveSlotLabel.Size = UDim2.new(0.5, -5, 0, 20)
- SaveSlotLabel.Position = UDim2.new(0.5, 5, 0, 5)
- SaveSlotLabel.BackgroundTransparency = 1
- SaveSlotLabel.TextColor3 = Color3.fromRGB(200, 200, 255)
- SaveSlotLabel.Font = Enum.Font.Gotham
- SaveSlotLabel.TextSize = 14
- SaveSlotLabel.Text = "Slot de Destino: " .. currentSaveSlot
- SaveSlotLabel.TextXAlignment = Enum.TextXAlignment.Left
- local SlotPrev = Instance.new("TextButton", ControlsFrame)
- SlotPrev.Text = "<"
- SlotPrev.Size = UDim2.new(0, 35, 0, 30)
- SlotPrev.Position = UDim2.new(0.5, 5, 0, 22)
- SlotPrev.BackgroundColor3 = Color3.fromRGB(80, 70, 130)
- SlotPrev.Font = Enum.Font.GothamBold
- SlotPrev.TextSize = 16
- SlotPrev.TextColor3 = Color3.new(1, 1, 1)
- local C5 = Instance.new("UICorner", SlotPrev)
- C5.CornerRadius = UDim.new(0, 6)
- AnimateHover(SlotPrev, Color3.fromRGB(100, 90, 150), Color3.fromRGB(80, 70, 130))
- local SlotNext = Instance.new("TextButton", ControlsFrame)
- SlotNext.Text = ">"
- SlotNext.Size = UDim2.new(0, 35, 0, 30)
- SlotNext.Position = UDim2.new(0.5, 45, 0, 22)
- SlotNext.BackgroundColor3 = Color3.fromRGB(80, 70, 130)
- SlotNext.Font = Enum.Font.GothamBold
- SlotNext.TextSize = 16
- SlotNext.TextColor3 = Color3.new(1, 1, 1)
- local C6 = Instance.new("UICorner", SlotNext)
- C6.CornerRadius = UDim.new(0, 6)
- AnimateHover(SlotNext, Color3.fromRGB(100, 90, 150), Color3.fromRGB(80, 70, 130))
- local PageControlFrame = Instance.new("Frame", MainFrame)
- PageControlFrame.Name = "PageControls"
- PageControlFrame.Size = UDim2.new(1, -20, 0, 30)
- PageControlFrame.Position = UDim2.new(0, 10, 0, 140)
- PageControlFrame.BackgroundTransparency = 1
- local PageLabel = Instance.new("TextLabel", PageControlFrame)
- PageLabel.Text = "Página " .. currentPage .. " / " .. maxPages
- PageLabel.Size = UDim2.new(0, 120, 1, 0)
- PageLabel.Position = UDim2.new(0.5, -60, 0, 0)
- PageLabel.BackgroundTransparency = 1
- PageLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- PageLabel.Font = Enum.Font.GothamBold
- PageLabel.TextSize = 16
- local PagePrev = Instance.new("TextButton", PageControlFrame)
- PagePrev.Text = "◄ Anterior"
- PagePrev.Size = UDim2.new(0, 90, 0, 26)
- PagePrev.Position = UDim2.new(0, 0, 0, 2)
- PagePrev.BackgroundColor3 = Color3.fromRGB(50, 48, 65)
- PagePrev.Font = Enum.Font.GothamBold
- PagePrev.TextSize = 12
- PagePrev.TextColor3 = Color3.new(1, 1, 1)
- local PPrev_C = Instance.new("UICorner", PagePrev)
- PPrev_C.CornerRadius = UDim.new(0, 6)
- AnimateHover(PagePrev, Color3.fromRGB(70, 65, 90), Color3.fromRGB(50, 48, 65))
- local PageNext = Instance.new("TextButton", PageControlFrame)
- PageNext.Text = "Próxima ►"
- PageNext.Size = UDim2.new(0, 90, 0, 26)
- PageNext.Position = UDim2.new(1, -90, 0, 2)
- PageNext.BackgroundColor3 = Color3.fromRGB(50, 48, 65)
- PageNext.Font = Enum.Font.GothamBold
- PageNext.TextSize = 12
- PageNext.TextColor3 = Color3.new(1, 1, 1)
- local PNext_C = Instance.new("UICorner", PageNext)
- PNext_C.CornerRadius = UDim.new(0, 6)
- AnimateHover(PageNext, Color3.fromRGB(70, 65, 90), Color3.fromRGB(50, 48, 65))
- local SlotsContainer = Instance.new("Frame", MainFrame)
- SlotsContainer.Size = UDim2.new(1, -20, 1, -185)
- SlotsContainer.Position = UDim2.new(0, 10, 0, 175)
- SlotsContainer.BackgroundTransparency = 1
- local GridLayout = Instance.new("UIGridLayout", SlotsContainer)
- GridLayout.CellPadding = UDim2.new(0, 8, 0, 8)
- GridLayout.CellSize = UDim2.new(0.5, -4, 0, 46)
- GridLayout.FillDirection = Enum.FillDirection.Vertical
- GridLayout.SortOrder = Enum.SortOrder.LayoutOrder
- GridLayout.StartCorner = Enum.StartCorner.TopLeft
- -- Overlays
- local ConfirmationOverlay = Instance.new("Frame", MainFrame)
- ConfirmationOverlay.Name = "ConfirmationOverlay"
- ConfirmationOverlay.Size = UDim2.new(1, 0, 1, 0)
- ConfirmationOverlay.BackgroundColor3 = Color3.new(0, 0, 0)
- ConfirmationOverlay.BackgroundTransparency = 0.6
- ConfirmationOverlay.Visible = false
- ConfirmationOverlay.ZIndex = 10
- local ConfirmationFrame = Instance.new("Frame", ConfirmationOverlay)
- ConfirmationFrame.Size = UDim2.new(0, 300, 0, 120)
- ConfirmationFrame.Position = UDim2.new(0.5, -150, 0.5, -60)
- ConfirmationFrame.BackgroundColor3 = Color3.fromRGB(35, 32, 50)
- local CF_C = Instance.new("UICorner", ConfirmationFrame)
- CF_C.CornerRadius = UDim.new(0, 8)
- local CF_S = Instance.new("UIStroke", ConfirmationFrame)
- CF_S.Color = Color3.fromRGB(120, 90, 255)
- CF_S.Thickness = 1.5
- local ConfirmLabel = Instance.new("TextLabel", ConfirmationFrame)
- ConfirmLabel.Size = UDim2.new(1, -20, 0, 60)
- ConfirmLabel.Position = UDim2.new(0, 10, 0, 0)
- ConfirmLabel.BackgroundTransparency = 1
- ConfirmLabel.TextColor3 = Color3.new(1, 1, 1)
- ConfirmLabel.Font = Enum.Font.GothamSemibold
- ConfirmLabel.TextSize = 16
- ConfirmLabel.TextWrapped = true
- local ConfirmYes = Instance.new("TextButton", ConfirmationFrame)
- ConfirmYes.Size = UDim2.new(0.5, -15, 0, 40)
- ConfirmYes.Position = UDim2.new(0, 10, 1, -50)
- ConfirmYes.BackgroundColor3 = Color3.fromRGB(220, 80, 80)
- ConfirmYes.Font = Enum.Font.GothamBold
- ConfirmYes.Text = "Sim"
- ConfirmYes.TextColor3 = Color3.new(1, 1, 1)
- ConfirmYes.TextSize = 14
- local CY_C = Instance.new("UICorner", ConfirmYes)
- CY_C.CornerRadius = UDim.new(0, 6)
- AnimateHover(ConfirmYes, Color3.fromRGB(240, 100, 100), Color3.fromRGB(220, 80, 80))
- local ConfirmNo = Instance.new("TextButton", ConfirmationFrame)
- ConfirmNo.Size = UDim2.new(0.5, -15, 0, 40)
- ConfirmNo.Position = UDim2.new(0.5, 5, 1, -50)
- ConfirmNo.BackgroundColor3 = Color3.fromRGB(80, 70, 130)
- ConfirmNo.Font = Enum.Font.GothamBold
- ConfirmNo.Text = "Não"
- ConfirmNo.TextColor3 = Color3.new(1, 1, 1)
- ConfirmNo.TextSize = 14
- local CN_C = Instance.new("UICorner", ConfirmNo)
- CN_C.CornerRadius = UDim.new(0, 6)
- AnimateHover(ConfirmNo, Color3.fromRGB(100, 90, 150), Color3.fromRGB(80, 70, 130))
- local RenameOverlay = Instance.new("Frame", MainFrame)
- RenameOverlay.Name = "RenameOverlay"
- RenameOverlay.Size = UDim2.new(1, 0, 1, 0)
- RenameOverlay.BackgroundColor3 = Color3.new(0, 0, 0)
- RenameOverlay.BackgroundTransparency = 0.6
- RenameOverlay.Visible = false
- RenameOverlay.ZIndex = 11
- local RenameFrame = Instance.new("Frame", RenameOverlay)
- RenameFrame.Size = UDim2.new(0, 350, 0, 160)
- RenameFrame.Position = UDim2.new(0.5, -175, 0.5, -80)
- RenameFrame.BackgroundColor3 = Color3.fromRGB(35, 32, 50)
- local RF_C = Instance.new("UICorner", RenameFrame)
- RF_C.CornerRadius = UDim.new(0, 8)
- local RF_S = Instance.new("UIStroke", RenameFrame)
- RF_S.Color = Color3.fromRGB(120, 90, 255)
- RF_S.Thickness = 1.5
- local RenameTitle = Instance.new("TextLabel", RenameFrame)
- RenameTitle.Size = UDim2.new(1, -20, 0, 40)
- RenameTitle.Position = UDim2.new(0, 10, 0, 0)
- RenameTitle.BackgroundTransparency = 1
- RenameTitle.TextColor3 = Color3.new(1, 1, 1)
- RenameTitle.Font = Enum.Font.GothamSemibold
- RenameTitle.TextSize = 16
- RenameTitle.Text = "Renomear Posição"
- local RenameField = Instance.new("TextBox", RenameFrame)
- RenameField.Size = UDim2.new(1, -20, 0, 40)
- RenameField.Position = UDim2.new(0, 10, 0, 50)
- RenameField.BackgroundColor3 = Color3.fromRGB(30, 28, 42)
- RenameField.TextColor3 = Color3.new(1, 1, 1)
- RenameField.Font = Enum.Font.Gotham
- RenameField.TextSize = 14
- local RFD_C = Instance.new("UICorner", RenameField)
- RFD_C.CornerRadius = UDim.new(0, 6)
- local RFD_S = Instance.new("UIStroke", RenameField)
- RFD_S.Color = Color3.fromRGB(80, 70, 130)
- RFD_S.Thickness = 1
- local RenameConfirm = Instance.new("TextButton", RenameFrame)
- RenameConfirm.Size = UDim2.new(0.5, -15, 0, 40)
- RenameConfirm.Position = UDim2.new(0, 10, 1, -50)
- RenameConfirm.BackgroundColor3 = Color3.fromRGB(80, 160, 220)
- RenameConfirm.Font = Enum.Font.GothamBold
- RenameConfirm.Text = "Confirmar"
- RenameConfirm.TextColor3 = Color3.new(1, 1, 1)
- RenameConfirm.TextSize = 14
- local RC_C = Instance.new("UICorner", RenameConfirm)
- RC_C.CornerRadius = UDim.new(0, 6)
- AnimateHover(RenameConfirm, Color3.fromRGB(100, 180, 240), Color3.fromRGB(80, 160, 220))
- local RenameCancel = Instance.new("TextButton", RenameFrame)
- RenameCancel.Size = UDim2.new(0.5, -15, 0, 40)
- RenameCancel.Position = UDim2.new(0.5, 5, 1, -50)
- RenameCancel.BackgroundColor3 = Color3.fromRGB(80, 70, 130)
- RenameCancel.Font = Enum.Font.GothamBold
- RenameCancel.Text = "Cancelar"
- RenameCancel.TextColor3 = Color3.new(1, 1, 1)
- RenameCancel.TextSize = 14
- local RCN_C = Instance.new("UICorner", RenameCancel)
- RCN_C.CornerRadius = UDim.new(0, 6)
- AnimateHover(RenameCancel, Color3.fromRGB(100, 90, 150), Color3.fromRGB(80, 70, 130))
- local MoveOverlay = Instance.new("Frame", MainFrame)
- MoveOverlay.Name = "MoveOverlay"
- MoveOverlay.Size = UDim2.new(1, 0, 1, 0)
- MoveOverlay.BackgroundColor3 = Color3.new(0, 0, 0)
- MoveOverlay.BackgroundTransparency = 0.6
- MoveOverlay.Visible = false
- MoveOverlay.ZIndex = 12
- local MoveFrame = Instance.new("Frame", MoveOverlay)
- MoveFrame.Size = UDim2.new(0, 300, 0, 180)
- MoveFrame.Position = UDim2.new(0.5, -150, 0.5, -90)
- MoveFrame.BackgroundColor3 = Color3.fromRGB(35, 32, 50)
- local MF_C = Instance.new("UICorner", MoveFrame)
- MF_C.CornerRadius = UDim.new(0, 8)
- local MF_S = Instance.new("UIStroke", MoveFrame)
- MF_S.Color = Color3.fromRGB(120, 90, 255)
- MF_S.Thickness = 1.5
- local MoveTitle = Instance.new("TextLabel", MoveFrame)
- MoveTitle.Size = UDim2.new(1, -20, 0, 40)
- MoveTitle.Position = UDim2.new(0, 10, 0, 10)
- MoveTitle.BackgroundTransparency = 1
- MoveTitle.TextColor3 = Color3.new(1, 1, 1)
- MoveTitle.Font = Enum.Font.GothamSemibold
- MoveTitle.TextSize = 16
- MoveTitle.Text = "Mover Posição"
- local MoveInfo = Instance.new("TextLabel", MoveFrame)
- MoveInfo.Size = UDim2.new(1, -20, 0, 20)
- MoveInfo.Position = UDim2.new(0, 10, 0, 50)
- MoveInfo.BackgroundTransparency = 1
- MoveInfo.TextColor3 = Color3.fromRGB(200, 200, 200)
- MoveInfo.Font = Enum.Font.Gotham
- MoveInfo.TextSize = 13
- MoveInfo.Text = "Digite o número do slot de destino (1-50):"
- local MoveInput = Instance.new("TextBox", MoveFrame)
- MoveInput.Size = UDim2.new(0, 80, 0, 40)
- MoveInput.Position = UDim2.new(0.5, -40, 0, 80)
- MoveInput.BackgroundColor3 = Color3.fromRGB(30, 28, 42)
- MoveInput.TextColor3 = Color3.new(1, 1, 1)
- MoveInput.Font = Enum.Font.GothamBold
- MoveInput.TextSize = 20
- MoveInput.Text = ""
- MoveInput.PlaceholderText = "1-50"
- local MI_C = Instance.new("UICorner", MoveInput)
- MI_C.CornerRadius = UDim.new(0, 6)
- local MI_S = Instance.new("UIStroke", MoveInput)
- MI_S.Color = Color3.fromRGB(80, 70, 130)
- MI_S.Thickness = 1
- local MoveConfirm = Instance.new("TextButton", MoveFrame)
- MoveConfirm.Size = UDim2.new(0.5, -15, 0, 35)
- MoveConfirm.Position = UDim2.new(0, 10, 1, -45)
- MoveConfirm.BackgroundColor3 = Color3.fromRGB(80, 160, 220)
- MoveConfirm.Font = Enum.Font.GothamBold
- MoveConfirm.Text = "Confirmar"
- MoveConfirm.TextColor3 = Color3.new(1, 1, 1)
- MoveConfirm.TextSize = 14
- local MC_C = Instance.new("UICorner", MoveConfirm)
- MC_C.CornerRadius = UDim.new(0, 6)
- AnimateHover(MoveConfirm, Color3.fromRGB(100, 180, 240), Color3.fromRGB(80, 160, 220))
- local MoveCancel = Instance.new("TextButton", MoveFrame)
- MoveCancel.Size = UDim2.new(0.5, -15, 0, 35)
- MoveCancel.Position = UDim2.new(0.5, 5, 1, -45)
- MoveCancel.BackgroundColor3 = Color3.fromRGB(80, 70, 130)
- MoveCancel.Font = Enum.Font.GothamBold
- MoveCancel.Text = "Cancelar"
- MoveCancel.TextColor3 = Color3.new(1, 1, 1)
- MoveCancel.TextSize = 14
- local MCN_C = Instance.new("UICorner", MoveCancel)
- MCN_C.CornerRadius = UDim.new(0, 6)
- AnimateHover(MoveCancel, Color3.fromRGB(100, 90, 150), Color3.fromRGB(80, 70, 130))
- -- [[ OVERLAY DE SAÍDA (EXIT) ]]
- local ExitOverlay = Instance.new("Frame", MainFrame)
- ExitOverlay.Name = "ExitOverlay"
- ExitOverlay.Size = UDim2.new(1, 0, 1, 0)
- ExitOverlay.BackgroundColor3 = Color3.new(0, 0, 0)
- ExitOverlay.BackgroundTransparency = 0.6
- ExitOverlay.Visible = false
- ExitOverlay.ZIndex = 20
- local ExitFrame = Instance.new("Frame", ExitOverlay)
- ExitFrame.Size = UDim2.new(0, 300, 0, 120)
- ExitFrame.Position = UDim2.new(0.5, -150, 0.5, -60)
- ExitFrame.BackgroundColor3 = Color3.fromRGB(35, 32, 50)
- local EX_C = Instance.new("UICorner", ExitFrame)
- EX_C.CornerRadius = UDim.new(0, 8)
- local EX_S = Instance.new("UIStroke", ExitFrame)
- EX_S.Color = Color3.fromRGB(255, 80, 80) -- Borda vermelha para indicar saída
- EX_S.Thickness = 1.5
- local ExitLabel = Instance.new("TextLabel", ExitFrame)
- ExitLabel.Size = UDim2.new(1, -20, 0, 60)
- ExitLabel.Position = UDim2.new(0, 10, 0, 0)
- ExitLabel.BackgroundTransparency = 1
- ExitLabel.TextColor3 = Color3.new(1, 1, 1)
- ExitLabel.Font = Enum.Font.GothamSemibold
- ExitLabel.TextSize = 16
- ExitLabel.TextWrapped = true
- ExitLabel.Text = "Deseja fechar o script totalmente?"
- local ExitYes = Instance.new("TextButton", ExitFrame)
- ExitYes.Size = UDim2.new(0.5, -15, 0, 40)
- ExitYes.Position = UDim2.new(0, 10, 1, -50)
- ExitYes.BackgroundColor3 = Color3.fromRGB(220, 80, 80)
- ExitYes.Font = Enum.Font.GothamBold
- ExitYes.Text = "Sim, Fechar"
- ExitYes.TextColor3 = Color3.new(1, 1, 1)
- ExitYes.TextSize = 14
- local EXY_C = Instance.new("UICorner", ExitYes)
- EXY_C.CornerRadius = UDim.new(0, 6)
- AnimateHover(ExitYes, Color3.fromRGB(240, 100, 100), Color3.fromRGB(220, 80, 80))
- local ExitNo = Instance.new("TextButton", ExitFrame)
- ExitNo.Size = UDim2.new(0.5, -15, 0, 40)
- ExitNo.Position = UDim2.new(0.5, 5, 1, -50)
- ExitNo.BackgroundColor3 = Color3.fromRGB(80, 70, 130)
- ExitNo.Font = Enum.Font.GothamBold
- ExitNo.Text = "Cancelar"
- ExitNo.TextColor3 = Color3.new(1, 1, 1)
- ExitNo.TextSize = 14
- local EXN_C = Instance.new("UICorner", ExitNo)
- EXN_C.CornerRadius = UDim.new(0, 6)
- AnimateHover(ExitNo, Color3.fromRGB(100, 90, 150), Color3.fromRGB(80, 70, 130))
- -- Lógica de Saída
- TerminateBtn.MouseButton1Click:Connect(function()
- ExitOverlay.Visible = true
- end)
- ExitNo.MouseButton1Click:Connect(function()
- ExitOverlay.Visible = false
- end)
- ExitYes.MouseButton1Click:Connect(function()
- -- Salva uma última vez por segurança
- saveToDisk()
- -- Limpa flag global para permitir re-execução
- getgenv().SaveLocateRunning = false
- -- Destrói a interface
- ScreenGui:Destroy()
- end)
- --================================================================================
- -- [LÓGICA E CONTROLES]
- --================================================================================
- local onConfirmCallback = nil
- local slotToRename = nil
- local slotToMove = nil
- local activeMenuConnection = nil
- local updateSavedList
- local function updateMainPositionUI()
- if mainPosition then
- MainPosContainer.Visible = true
- else
- MainPosContainer.Visible = false
- end
- end
- local function setMainPosition(slot)
- if savedPositions[slot] then
- mainPosition = {
- position = savedPositions[slot].position,
- name = savedPositions[slot].name,
- timestamp = savedPositions[slot].timestamp
- }
- saveMainPosition()
- updateMainPositionUI()
- end
- end
- MP_RemoveBtn.MouseButton1Click:Connect(function()
- ConfirmLabel.Text = "Remover posição principal?"
- ConfirmYes.Text = "Sim"
- onConfirmCallback = function()
- mainPosition = nil
- if hasFS and hasDelFile then pcall(delfile, MAIN_FILE) end
- updateMainPositionUI()
- end
- ConfirmationOverlay.Visible = true
- end)
- local function swapPositions(fromSlot, toSlot)
- if fromSlot == toSlot then return end
- local temp = savedPositions[fromSlot]
- savedPositions[fromSlot] = savedPositions[toSlot]
- savedPositions[toSlot] = temp
- saveToDisk()
- end
- local function findNextEmptySlot()
- for i = 1, maxSaves do
- if not savedPositions[i] then return i end
- end
- return (currentSaveSlot % maxSaves) + 1
- end
- local function selectNextSlot()
- currentSaveSlot = findNextEmptySlot()
- SaveSlotLabel.Text = "Slot de Destino: " .. currentSaveSlot
- end
- local function openRenamePrompt(slot)
- if not savedPositions[slot] then return end
- slotToRename = slot
- RenameTitle.Text = string.format("Renomear Slot %d", slot)
- RenameField.Text = savedPositions[slot].name
- RenameOverlay.Visible = true
- end
- local function openMovePrompt(slot)
- if not savedPositions[slot] then return end
- slotToMove = slot
- MoveTitle.Text = string.format("Mover Slot %d: %s", slot, savedPositions[slot].name)
- MoveInput.Text = ""
- MoveOverlay.Visible = true
- end
- local function changePage(dir)
- local newPage = currentPage + dir
- if newPage < 1 then newPage = maxPages end
- if newPage > maxPages then newPage = 1 end
- currentPage = newPage
- PageLabel.Text = "Página " .. currentPage .. " / " .. maxPages
- updateSavedList()
- end
- PagePrev.MouseButton1Click:Connect(function() changePage(-1) end)
- PageNext.MouseButton1Click:Connect(function() changePage(1) end)
- updateSavedList = function()
- if activeMenuConnection then
- activeMenuConnection:Disconnect()
- activeMenuConnection = nil
- end
- for _, child in ipairs(SlotsContainer:GetChildren()) do
- if child:IsA("Frame") then child:Destroy() end
- end
- local startSlot = (currentPage - 1) * slotsPerPage + 1
- local endSlot = currentPage * slotsPerPage
- for slot = startSlot, endSlot do
- local entryFrame = Instance.new("Frame")
- entryFrame.Name = "Slot_" .. slot
- entryFrame.LayoutOrder = slot
- entryFrame.BackgroundColor3 = Color3.fromRGB(40, 38, 55)
- entryFrame.BackgroundTransparency = 0.5
- entryFrame.Parent = SlotsContainer
- entryFrame.ClipsDescendants = false
- local C7 = Instance.new("UICorner", entryFrame)
- C7.CornerRadius = UDim.new(0, 6)
- local data = savedPositions[slot]
- if data then
- local actionsFrame = Instance.new("Frame", entryFrame)
- actionsFrame.Name = "ActionsFrame"
- actionsFrame.Size = UDim2.new(0, 30, 1, 0)
- actionsFrame.Position = UDim2.new(0, 5, 0, 0)
- actionsFrame.BackgroundTransparency = 1
- local mainBtn = Instance.new("TextButton", actionsFrame)
- mainBtn.Text = mainPosition and mainPosition.position == data.position and "★" or "☆"
- mainBtn.Size = UDim2.new(1, 0, 0, 22)
- mainBtn.Position = UDim2.new(0, 0, 0, 2)
- mainBtn.BackgroundTransparency = 1
- mainBtn.Font = Enum.Font.GothamBold
- mainBtn.TextSize = 14
- mainBtn.TextColor3 = Color3.fromRGB(255, 215, 0)
- local menuBtn = Instance.new("TextButton", actionsFrame)
- menuBtn.Text = "⋮"
- menuBtn.Size = UDim2.new(1, 0, 0, 22)
- menuBtn.Position = UDim2.new(0, 0, 0, 26)
- menuBtn.BackgroundTransparency = 1
- menuBtn.Font = Enum.Font.GothamBold
- menuBtn.TextSize = 18
- menuBtn.TextColor3 = Color3.fromRGB(180, 180, 200)
- local optionsFrame = Instance.new("Frame", ScreenGui)
- optionsFrame.Name = "OptionsFrame_" .. slot
- optionsFrame.Size = UDim2.new(0, 120, 0, 110)
- optionsFrame.BackgroundColor3 = Color3.fromRGB(35, 32, 48)
- optionsFrame.BackgroundTransparency = 0.05
- optionsFrame.Visible = false
- optionsFrame.ZIndex = 50
- optionsFrame.BorderSizePixel = 0
- local OptionsCorner = Instance.new("UICorner", optionsFrame)
- OptionsCorner.CornerRadius = UDim.new(0, 8)
- local OptionsStroke = Instance.new("UIStroke", optionsFrame)
- OptionsStroke.Color = Color3.fromRGB(100, 80, 180)
- OptionsStroke.Thickness = 1.5
- local buttonsContainer = Instance.new("Frame", optionsFrame)
- buttonsContainer.Size = UDim2.new(1, -10, 1, -25)
- buttonsContainer.Position = UDim2.new(0, 5, 0, 22)
- buttonsContainer.BackgroundTransparency = 1
- buttonsContainer.ZIndex = 51
- local function createMenuOption(txt, yPos, col)
- local b = Instance.new("TextButton", buttonsContainer)
- b.Size = UDim2.new(1, 0, 0, 25)
- b.Position = UDim2.new(0, 0, 0, yPos)
- b.BackgroundColor3 = Color3.fromRGB(45, 42, 58)
- b.BackgroundTransparency = 0.3
- b.Text = txt
- b.TextColor3 = Color3.fromRGB(220, 220, 240)
- if col then b.TextColor3 = col end
- b.Font = Enum.Font.Gotham
- b.TextSize = 12
- b.ZIndex = 52
- local c = Instance.new("UICorner", b)
- c.CornerRadius = UDim.new(0, 4)
- b.MouseEnter:Connect(function()
- TweenService:Create(b, TweenInfo.new(0.15), {BackgroundTransparency=0, BackgroundColor3=Color3.fromRGB(60, 57, 78)}):Play()
- end)
- b.MouseLeave:Connect(function()
- TweenService:Create(b, TweenInfo.new(0.15), {BackgroundTransparency=0.3, BackgroundColor3=Color3.fromRGB(45, 42, 58)}):Play()
- end)
- return b
- end
- local renameBtn = createMenuOption("✏ Renomear", 0)
- local moveBtn = createMenuOption("↔ Mover", 28)
- local deleteBtn = createMenuOption("🗑 Excluir", 56, Color3.fromRGB(255, 150, 150))
- local nameLabel = Instance.new("TextLabel", entryFrame)
- nameLabel.Size = UDim2.new(1, -90, 0, 24)
- nameLabel.Position = UDim2.new(0, 40, 0, 3)
- nameLabel.BackgroundTransparency = 1
- nameLabel.TextColor3 = Color3.fromRGB(220, 220, 255)
- nameLabel.Font = Enum.Font.GothamSemibold
- nameLabel.TextSize = 13
- nameLabel.TextXAlignment = Enum.TextXAlignment.Left
- nameLabel.TextTruncate = Enum.TextTruncate.AtEnd
- nameLabel.Text = data.name
- local timeLabel = Instance.new("TextLabel", entryFrame)
- timeLabel.Size = UDim2.new(1, -90, 0, 14)
- timeLabel.Position = UDim2.new(0, 40, 0, 28)
- timeLabel.BackgroundTransparency = 1
- timeLabel.TextColor3 = Color3.fromRGB(130, 130, 160)
- timeLabel.Font = Enum.Font.Gotham
- timeLabel.TextSize = 10
- timeLabel.TextXAlignment = Enum.TextXAlignment.Left
- timeLabel.Text = data.timestamp
- local teleportBtn = Instance.new("TextButton", entryFrame)
- teleportBtn.Text = "TP"
- teleportBtn.Size = UDim2.new(0, 35, 0, 35)
- teleportBtn.Position = UDim2.new(1, -40, 0.5, -17.5)
- teleportBtn.BackgroundColor3 = Color3.fromRGB(120, 90, 255)
- teleportBtn.Font = Enum.Font.GothamBold
- teleportBtn.TextSize = 14
- teleportBtn.TextColor3 = Color3.new(1, 1, 1)
- local C9 = Instance.new("UICorner", teleportBtn)
- C9.CornerRadius = UDim.new(0, 6)
- AnimateHover(teleportBtn, Color3.fromRGB(140, 110, 255), Color3.fromRGB(120, 90, 255))
- local menuOpen = false
- menuBtn.MouseButton1Click:Connect(function()
- menuOpen = not menuOpen
- if menuOpen then
- local btnPos = menuBtn.AbsolutePosition
- optionsFrame.Position = UDim2.new(0, btnPos.X + 35, 0, btnPos.Y - 10)
- optionsFrame.Visible = true
- for _, child in ipairs(ScreenGui:GetChildren()) do
- if child.Name:match("^OptionsFrame_") and child ~= optionsFrame then child.Visible = false end
- end
- if activeMenuConnection then activeMenuConnection:Disconnect() end
- activeMenuConnection = UserInputService.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- task.wait(0.05)
- if not optionsFrame.Parent then return end
- local mousePos = UserInputService:GetMouseLocation()
- local fp = optionsFrame.AbsolutePosition
- local fs = optionsFrame.AbsoluteSize
- if mousePos.X < fp.X or mousePos.X > fp.X + fs.X or mousePos.Y < fp.Y or mousePos.Y > fp.Y + fs.Y then
- optionsFrame.Visible = false
- menuOpen = false
- if activeMenuConnection then
- activeMenuConnection:Disconnect()
- activeMenuConnection = nil
- end
- end
- end
- end)
- else
- optionsFrame.Visible = false
- if activeMenuConnection then activeMenuConnection:Disconnect(); activeMenuConnection = nil end
- end
- end)
- mainBtn.MouseButton1Click:Connect(function()
- local isAlreadyMain = (mainPosition and mainPosition.position and mainPosition.position == data.position)
- if isAlreadyMain then
- ConfirmLabel.Text = "Remover posição principal?"
- ConfirmYes.Text = "Remover"
- onConfirmCallback = function()
- mainPosition = nil
- if hasFS and hasDelFile then pcall(delfile, MAIN_FILE) end
- updateMainPositionUI()
- updateSavedList()
- end
- else
- ConfirmLabel.Text = "Definir como posição principal?"
- ConfirmYes.Text = "Sim"
- onConfirmCallback = function() setMainPosition(slot); updateSavedList() end
- end
- ConfirmationOverlay.Visible = true
- end)
- local function closeMenu()
- optionsFrame.Visible = false; menuOpen = false
- if activeMenuConnection then activeMenuConnection:Disconnect(); activeMenuConnection = nil end
- end
- renameBtn.MouseButton1Click:Connect(function() closeMenu(); openRenamePrompt(slot) end)
- moveBtn.MouseButton1Click:Connect(function() closeMenu(); openMovePrompt(slot) end)
- deleteBtn.MouseButton1Click:Connect(function()
- closeMenu()
- ConfirmLabel.Text = "Excluir o Slot " .. slot .. "?"
- ConfirmYes.Text = "Sim"
- onConfirmCallback = function()
- savedPositions[slot] = nil
- saveToDisk()
- updateSavedList()
- selectNextSlot()
- end
- ConfirmationOverlay.Visible = true
- end)
- teleportBtn.MouseButton1Click:Connect(function()
- if teleportTo(data.position) then
- teleportBtn.Text = "✅"
- task.delay(1, function() if teleportBtn.Parent then teleportBtn.Text = "TP" end end)
- end
- end)
- else
- local nameLabel = Instance.new("TextLabel", entryFrame)
- nameLabel.Size = UDim2.new(1, -20, 1, 0)
- nameLabel.Position = UDim2.new(0, 10, 0, 0)
- nameLabel.BackgroundTransparency = 1
- nameLabel.TextColor3 = Color3.fromRGB(100, 100, 120)
- nameLabel.Font = Enum.Font.Gotham
- nameLabel.TextSize = 15
- nameLabel.TextXAlignment = Enum.TextXAlignment.Left
- nameLabel.Text = string.format("Slot %d: Vazio", slot)
- end
- end
- end
- local function performSave()
- if isSaving then return false end
- local root = getRoot()
- if not root then return false end
- isSaving = true
- local name = NameField.Text
- savedPositions[currentSaveSlot] = {
- position = root.CFrame,
- name = (#name > 0) and name or ("Slot "..currentSaveSlot),
- timestamp = os.date("%Y-%m-%d %H:%M:%S")
- }
- saveToDisk()
- local pageOfSlot = math.ceil(currentSaveSlot / slotsPerPage)
- if pageOfSlot ~= currentPage then
- currentPage = pageOfSlot
- PageLabel.Text = "Página " .. currentPage .. " / " .. maxPages
- end
- updateSavedList()
- task.wait(0.5)
- isSaving = false
- return true
- end
- local function animateSaveButton(success)
- local button = SaveButton
- local color = success and Color3.fromRGB(80,220,140) or Color3.fromRGB(200,80,80)
- local text = success and "Salvo!" or "Erro!"
- task.spawn(function()
- button.Text = text
- TweenService:Create(button, TweenInfo.new(0.2), {BackgroundColor3 = color}):Play()
- task.wait(1.5)
- button.Text = "Salvar Posição"
- TweenService:Create(button, TweenInfo.new(0.2), {BackgroundColor3 = Color3.fromRGB(60,180,120)}):Play()
- end)
- end
- MoveConfirm.MouseButton1Click:Connect(function()
- local targetSlot = tonumber(MoveInput.Text)
- if slotToMove and targetSlot and targetSlot >= 1 and targetSlot <= maxSaves then
- swapPositions(slotToMove, targetSlot)
- updateSavedList()
- MoveOverlay.Visible = false
- slotToMove = nil
- else
- MoveInput.Text = ""
- MoveInput.PlaceholderText = "Erro!"
- task.wait(1)
- MoveInput.PlaceholderText = "1-50"
- end
- end)
- MoveCancel.MouseButton1Click:Connect(function() MoveOverlay.Visible = false; slotToMove = nil end)
- RenameConfirm.MouseButton1Click:Connect(function()
- if slotToRename and #RenameField.Text > 0 then
- local newName = RenameField.Text
- local slotData = savedPositions[slotToRename]
- if slotData then
- slotData.name = newName
- if mainPosition and mainPosition.position and slotData.position and (mainPosition.position == slotData.position) then
- mainPosition.name = newName
- saveMainPosition()
- end
- saveToDisk()
- updateSavedList()
- updateMainPositionUI()
- end
- RenameOverlay.Visible = false
- slotToRename = nil
- end
- end)
- RenameCancel.MouseButton1Click:Connect(function() RenameOverlay.Visible = false; slotToRename = nil end)
- SlotPrev.MouseButton1Click:Connect(function()
- currentSaveSlot = ((currentSaveSlot - 2 + maxSaves) % maxSaves) + 1
- SaveSlotLabel.Text = "Slot de Destino: " .. currentSaveSlot
- end)
- SlotNext.MouseButton1Click:Connect(function()
- currentSaveSlot = (currentSaveSlot % maxSaves) + 1
- SaveSlotLabel.Text = "Slot de Destino: " .. currentSaveSlot
- end)
- ConfirmYes.MouseButton1Click:Connect(function()
- if onConfirmCallback then onConfirmCallback() end
- onConfirmCallback = nil
- ConfirmationOverlay.Visible = false
- end)
- ConfirmNo.MouseButton1Click:Connect(function()
- onConfirmCallback = nil
- ConfirmationOverlay.Visible = false
- end)
- SaveButton.MouseButton1Click:Connect(function()
- if savedPositions[currentSaveSlot] then
- ConfirmLabel.Text = "O Slot "..currentSaveSlot.." já tem uma posição salva. SUBSTITUIR?"
- ConfirmYes.Text = "Sim"
- onConfirmCallback = function()
- local success = performSave()
- if success then selectNextSlot() end
- animateSaveButton(success)
- end
- ConfirmationOverlay.Visible = true
- else
- local success = performSave()
- if success then selectNextSlot() end
- animateSaveButton(success)
- end
- end)
- loadFromDisk()
- selectNextSlot()
- updateSavedList()
- updateMainPositionUI()
- game:BindToClose(function()
- saveToDisk()
- end)
- print("✅ Save Locate V5.5 (Stable) - Sistema de Saída Seguro Implementado")
Advertisement
Add Comment
Please, Sign In to add comment