local Players = game:GetService("Players") local player = Players.LocalPlayer local spawnEnabled = false local tpEnabled = false local tpSession = 0 local savedPosition = nil local targetPlayer = nil -- CREAR GUI local gui = Instance.new("ScreenGui") gui.Name = "MyFunctions" gui.ResetOnSpawn = false gui.DisplayOrder = 10000 gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling gui.Parent = player:WaitForChild("PlayerGui") local window = Instance.new("Frame") window.Name = "Window" window.Size = UDim2.new(0, 190, 0, 150) window.Position = UDim2.new(0, 20, 0, 100) window.BackgroundColor3 = Color3.fromRGB(25, 25, 25) window.Active = true window.Parent = gui local titleBar = Instance.new("TextLabel") titleBar.Size = UDim2.new(1, 0, 0, 28) titleBar.BackgroundColor3 = Color3.fromRGB(50, 50, 50) titleBar.TextColor3 = Color3.fromRGB(255, 255, 255) titleBar.Text = "My Functions - drag" titleBar.TextSize = 14 titleBar.Active = true titleBar.Parent = window local UserInputService = game:GetService("UserInputService") local dragging = false local dragInput local dragStart local startPosition titleBar.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPosition = window.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) titleBar.InputChanged:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then dragInput = input end end) UserInputService.InputChanged:Connect(function(input) if dragging and input == dragInput then local delta = input.Position - dragStart window.Position = UDim2.new( startPosition.X.Scale, startPosition.X.Offset + delta.X, startPosition.Y.Scale, startPosition.Y.Offset + delta.Y ) end end) local function createButton(name, position) local button = Instance.new("TextButton") button.Size = UDim2.new(0, 150, 0, 45) button.Position = position button.Active = true button.ZIndex = 2 button.Parent = window button.BackgroundColor3 = Color3.fromRGB(35, 35, 35) button.TextColor3 = Color3.fromRGB(255, 255, 255) button.TextSize = 18 button.Text = name .. " OFF" local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 8) corner.Parent = button return button end local spawnButton = createButton( "Spawnpoint", UDim2.new(0, 20, 0, 38) ) local tpButton = createButton( "TP all", UDim2.new(0, 20, 0, 90) ) -- SPAWNPOINT spawnButton.MouseButton1Click:Connect(function() spawnEnabled = not spawnEnabled if spawnEnabled then local character = player.Character if character then savedPosition = character:GetPivot() end spawnButton.Text = "Spawnpoint ON" else spawnButton.Text = "Spawnpoint OFF" savedPosition = nil end end) player.CharacterAdded:Connect(function(character) if spawnEnabled and savedPosition then character:WaitForChild("HumanoidRootPart") task.wait(0.2) character:PivotTo(savedPosition) end end) -- TP RANDOM CADA 5 SEGUNDOS tpButton.MouseButton1Click:Connect(function() tpEnabled = not tpEnabled tpSession = tpSession + 1 if tpEnabled then tpButton.Text = "TP all ON" local thisSession = tpSession task.spawn(function() while tpEnabled and tpSession == thisSession do local availablePlayers = {} for _, otherPlayer in ipairs(Players:GetPlayers()) do if otherPlayer ~= player and otherPlayer.Character and otherPlayer.Character:FindFirstChild("HumanoidRootPart") then table.insert(availablePlayers, otherPlayer) end end if #availablePlayers == 0 then tpButton.Text = "No players" tpEnabled = false targetPlayer = nil break end targetPlayer = availablePlayers[math.random(1, #availablePlayers)] local elapsed = 0 while elapsed < 5 and tpEnabled and tpSession == thisSession do local character = player.Character local targetCharacter = targetPlayer.Character local targetRoot = targetCharacter and targetCharacter:FindFirstChild("HumanoidRootPart") if not targetRoot then break end if character then character:PivotTo( targetRoot.CFrame * CFrame.new(0, 3, 0) * CFrame.Angles(math.rad(180), 0, 0) ) end task.wait(0.1) elapsed = elapsed + 0.1 end end end) else tpButton.Text = "TP all OFF" targetPlayer = nil end end)