Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not game or not game:IsLoaded() then game.Loaded:Wait() end
- local Players = game:GetService("Players")
- local HttpService = game:GetService("HttpService")
- local TweenService = game:GetService("TweenService")
- local plr = Players.LocalPlayer
- local chr = plr.Character or plr.CharacterAdded:Wait()
- local humanoidRoot = chr:WaitForChild("HumanoidRootPart")
- local savedPositions = {}
- local maxSaves = 5
- local currentSaveSlot = 1
- -- Persistência (sem alterações)
- local hasFS = (type(writefile)=="function" and type(readfile)=="function")
- local SAVE_DIR = "SkyTP"
- local BASE_NAME = string.format("Saves_%d_%d.json", game.PlaceId, plr.UserId)
- local SAVE_FILE = BASE_NAME
- if type(isfolder)=="function" and type(makefolder)=="function" then
- if not isfolder(SAVE_DIR) then pcall(makefolder, SAVE_DIR) end
- SAVE_FILE = SAVE_DIR .. "/" .. BASE_NAME
- end
- 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 saveToDisk() if not hasFS then return end; local out={}; for slot,data in pairs(savedPositions) do if type(slot)=="number" and slot>=1 and slot<=maxSaves and typeof(data.position)=="CFrame" then out[tostring(slot)]={name=data.name or ("Slot "..slot),timestamp=data.timestamp or os.date("%Y-%m-%d %H:%M:%S"),position=encodeCFrame(data.position)} end end; local ok,encoded=pcall(function() return HttpService:JSONEncode(out) end); if ok then pcall(writefile,SAVE_FILE,encoded) end end
- local function loadFromDisk() if not hasFS then return end; local ok,content=pcall(readfile,SAVE_FILE); if not ok or type(content)~="string" or #content==0 then return end; local ok2,data=pcall(function() return HttpService:JSONDecode(content) end); if not ok2 or type(data)~="table" then return end; for k,v in pairs(data) 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 end
- local function teleportTo(cframe) if humanoidRoot and cframe then humanoidRoot.CFrame = cframe; return true end; return false end
- --================================================================================
- -- [INÍCIO DA UI CORRIGIDA E REFINADA]
- --================================================================================
- 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 = "SkyTPGui_Cyber_Fixed"
- ScreenGui.ResetOnSpawn = false
- ScreenGui.Parent = game.CoreGui
- local MainFrame = Instance.new("Frame")
- MainFrame.Size = UDim2.new(0, 450, 0, 350)
- MainFrame.Position = UDim2.new(0.5, -225, 0.5, -175)
- 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, -45, 1, 0); TitleLabel.Position = UDim2.new(0, 15, 0, 0); TitleLabel.BackgroundTransparency = 1; TitleLabel.Text = "✧ SkyTP"; TitleLabel.TextColor3 = Color3.fromRGB(255, 255, 255); TitleLabel.Font = Enum.Font.GothamSemibold; TitleLabel.TextSize = 18; TitleLabel.TextXAlignment = Enum.TextXAlignment.Left
- local CloseBtn = Instance.new("TextButton", TopBar)
- CloseBtn.Size = UDim2.new(0, 30, 0, 30); CloseBtn.Position = UDim2.new(1, -35, 0.5, -15); CloseBtn.BackgroundColor3 = Color3.fromRGB(45, 40, 65); CloseBtn.Text = "✕"; CloseBtn.Font = Enum.Font.GothamBold; CloseBtn.TextSize = 16; CloseBtn.TextColor3 = Color3.fromRGB(255, 120, 120)
- local C1 = Instance.new("UICorner", CloseBtn); C1.CornerRadius = UDim.new(0, 6); AnimateHover(CloseBtn, Color3.fromRGB(255, 100, 100), Color3.fromRGB(45, 40, 65))
- CloseBtn.MouseButton1Click:Connect(function() MainFrame.Visible = false end)
- 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 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 Atual: " .. 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))
- SlotPrev.MouseButton1Click:Connect(function() currentSaveSlot=((currentSaveSlot-2+maxSaves)%maxSaves)+1; SaveSlotLabel.Text="Slot Atual: "..currentSaveSlot end)
- SlotNext.MouseButton1Click:Connect(function() currentSaveSlot=(currentSaveSlot%maxSaves)+1; SaveSlotLabel.Text="Slot Atual: "..currentSaveSlot end)
- local SavedList = Instance.new("ScrollingFrame", MainFrame)
- SavedList.Size = UDim2.new(1, -20, 1, -155); SavedList.Position = UDim2.new(0, 10, 0, 145); SavedList.BackgroundTransparency = 1; SavedList.BorderSizePixel = 0; SavedList.ScrollBarThickness = 6; SavedList.ScrollBarImageColor3 = Color3.fromRGB(120, 90, 255); SavedList.CanvasSize = UDim2.new(0, 0, 0, 0)
- local ListLayout = Instance.new("UIListLayout", SavedList); ListLayout.Padding = UDim.new(0, 8); ListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- local function updateSavedList() end
- updateSavedList = function()
- for _, child in ipairs(SavedList:GetChildren()) do if child:IsA("Frame") or child:IsA("TextButton") then child:Destroy() end end
- local sortedSlots = {}; for slot, _ in pairs(savedPositions) do table.insert(sortedSlots, slot) end; table.sort(sortedSlots)
- for _, slot in ipairs(sortedSlots) do
- local data = savedPositions[slot]
- local entryFrame = Instance.new("Frame"); entryFrame.Size = UDim2.new(1, 0, 0, 50); entryFrame.BackgroundColor3 = Color3.fromRGB(40, 38, 55); entryFrame.BackgroundTransparency = 0.5; entryFrame.BorderSizePixel = 0; entryFrame.LayoutOrder = slot; entryFrame.Parent = SavedList
- local C7 = Instance.new("UICorner", entryFrame); C7.CornerRadius = UDim.new(0, 6)
- local deleteBtn = Instance.new("TextButton", entryFrame); deleteBtn.Text = "🗑️"; deleteBtn.Size = UDim2.new(0, 30, 0, 30); deleteBtn.Position = UDim2.new(0, 10, 0.5, -15); deleteBtn.BackgroundColor3 = Color3.fromRGB(60, 50, 80); deleteBtn.Font = Enum.Font.GothamBold; deleteBtn.TextSize = 16; deleteBtn.TextColor3 = Color3.fromRGB(255, 150, 150)
- local C8 = Instance.new("UICorner", deleteBtn); C8.CornerRadius = UDim.new(0, 6); AnimateHover(deleteBtn, Color3.fromRGB(200, 80, 80), Color3.fromRGB(60, 50, 80))
- local nameLabel = Instance.new("TextLabel", entryFrame); nameLabel.Size = UDim2.new(1, -100, 0, 20); nameLabel.Position = UDim2.new(0, 50, 0, 5); nameLabel.BackgroundTransparency = 1; nameLabel.TextColor3 = Color3.fromRGB(220, 220, 255); nameLabel.Font = Enum.Font.Gotham; nameLabel.TextSize = 15; nameLabel.TextXAlignment = Enum.TextXAlignment.Left; nameLabel.Text = string.format("Slot %d: %s", slot, data.name)
- local timeLabel = Instance.new("TextLabel", entryFrame); timeLabel.Size = UDim2.new(1, -100, 0, 15); timeLabel.Position = UDim2.new(0, 50, 0, 25); timeLabel.BackgroundTransparency = 1; timeLabel.TextColor3 = Color3.fromRGB(150, 150, 180); timeLabel.Font = Enum.Font.Gotham; timeLabel.TextSize = 12; timeLabel.TextXAlignment = Enum.TextXAlignment.Left; timeLabel.Text = data.timestamp
- local teleportBtn = Instance.new("TextButton", entryFrame)
- teleportBtn.Text = "TP 🚀" -- CORREÇÃO DO ERRO ESTAVA AQUI
- teleportBtn.Size = UDim2.new(0, 40, 0, 40)
- teleportBtn.Position = UDim2.new(1, -45, 0.5, -20)
- teleportBtn.BackgroundColor3 = Color3.fromRGB(120, 90, 255)
- teleportBtn.Font = Enum.Font.GothamBold
- teleportBtn.TextSize = 18
- 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))
- teleportBtn.MouseButton1Click:Connect(function()
- if teleportTo(data.position) then teleportBtn.Text = "✅"; TweenService:Create(teleportBtn,TweenInfo.new(0.2),{BackgroundColor3=Color3.fromRGB(80,200,120)}):Play(); task.wait(1); if teleportBtn.Parent then teleportBtn.Text = "TP 🚀"; TweenService:Create(teleportBtn,TweenInfo.new(0.2),{BackgroundColor3=Color3.fromRGB(120,90,255)}):Play() end
- else teleportBtn.Text = "❌"; TweenService:Create(teleportBtn,TweenInfo.new(0.2),{BackgroundColor3=Color3.fromRGB(200,80,80)}):Play(); task.wait(1); if teleportBtn.Parent then teleportBtn.Text = "TP 🚀"; TweenService:Create(teleportBtn,TweenInfo.new(0.2),{BackgroundColor3=Color3.fromRGB(120,90,255)}):Play() end end
- end)
- deleteBtn.MouseButton1Click:Connect(function() savedPositions[slot] = nil; saveToDisk(); updateSavedList() end)
- end
- ListLayout.Parent = nil; ListLayout.Parent = SavedList
- end
- --================================================================================
- -- [FIM DA UI CORRIGIDA]
- --================================================================================
- SaveButton.MouseButton1Click:Connect(function()
- if humanoidRoot then
- local name=NameField.Text; savedPositions[currentSaveSlot]={position=humanoidRoot.CFrame,name=(#name>0) and name or ("Slot "..currentSaveSlot),timestamp=os.date("%Y-%m-%d %H:%M:%S")}; saveToDisk(); updateSavedList(); SaveButton.Text="Salvo!"; TweenService:Create(SaveButton,TweenInfo.new(0.2),{BackgroundColor3=Color3.fromRGB(80,220,140)}):Play(); task.wait(1.5); SaveButton.Text="Salvar Posição"; TweenService:Create(SaveButton,TweenInfo.new(0.2),{BackgroundColor3=Color3.fromRGB(60,180,120)}):Play()
- else
- SaveButton.Text="Erro!"; TweenService:Create(SaveButton,TweenInfo.new(0.2),{BackgroundColor3=Color3.fromRGB(200,80,80)}):Play(); task.wait(1.5); SaveButton.Text="Salvar Posição"; TweenService:Create(SaveButton,TweenInfo.new(0.2),{BackgroundColor3=Color3.fromRGB(60,180,120)}):Play()
- end
- end)
- loadFromDisk()
- updateSavedList()
- Players.LocalPlayer.CharacterAdded:Connect(function(character)
- chr = character
- humanoidRoot = character:WaitForChild("HumanoidRootPart")
- end)
Advertisement
Add Comment
Please, Sign In to add comment