Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local player = Players.LocalPlayer
- local gui = Instance.new("ScreenGui")
- gui.Name = "TpSpeedGui"
- gui.IgnoreGuiInset = true
- gui.ResetOnSpawn = false
- gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- -- Основной контейнер (без фона)
- local mainFrame = Instance.new("Frame")
- mainFrame.Size = UDim2.new(0.25, 0, 0.15, 0)
- mainFrame.Position = UDim2.new(0.725, 0, 0.05, 0)
- mainFrame.BackgroundTransparency = 1
- mainFrame.Parent = gui
- -- Заголовок TpSpeed с красивым стилем
- local title = Instance.new("TextLabel")
- title.Text = "TpSpeed"
- title.Size = UDim2.new(1, 0, 0.3, 0)
- title.Position = UDim2.new(0, 0, 0, 0)
- title.BackgroundTransparency = 1
- title.TextColor3 = Color3.fromRGB(0, 255, 255) -- Голубой цвет
- title.Font = Enum.Font.GothamBlack
- title.TextSize = 24
- title.TextXAlignment = Enum.TextXAlignment.Right
- title.TextStrokeTransparency = 0.7
- title.TextStrokeColor3 = Color3.fromRGB(0, 100, 100)
- title.Parent = mainFrame
- -- Кнопка закрытия с красивым дизайном
- local closeButton = Instance.new("ImageButton")
- closeButton.Image = "rbxassetid://3926305904" -- Иконка закрытия
- closeButton.ImageRectOffset = Vector2.new(284, 4)
- closeButton.ImageRectSize = Vector2.new(24, 24)
- closeButton.Size = UDim2.new(0, 20, 0, 20)
- closeButton.Position = UDim2.new(0.93, 0, 0, 0)
- closeButton.BackgroundTransparency = 1
- closeButton.ImageColor3 = Color3.fromRGB(255, 100, 100)
- closeButton.Parent = mainFrame
- -- Анимация при наведении на кнопку
- closeButton.MouseEnter:Connect(function()
- game:GetService("TweenService"):Create(
- closeButton,
- TweenInfo.new(0.2),
- {ImageColor3 = Color3.fromRGB(255, 50, 50), Rotation = 5}
- ):Play()
- end)
- closeButton.MouseLeave:Connect(function()
- game:GetService("TweenService"):Create(
- closeButton,
- TweenInfo.new(0.2),
- {ImageColor3 = Color3.fromRGB(255, 100, 100), Rotation = 0}
- ):Play()
- end)
- -- Контейнер для подсказок
- local hintsContainer = Instance.new("Frame")
- hintsContainer.Size = UDim2.new(1, 0, 0.7, 0)
- hintsContainer.Position = UDim2.new(0, 0, 0.3, 0)
- hintsContainer.BackgroundTransparency = 1
- hintsContainer.Parent = mainFrame
- -- Текст подсказки 1 с эффектом свечения
- local hint1 = Instance.new("TextLabel")
- hint1.Text = "▶ Нажмите F чтобы запустить"
- hint1.Size = UDim2.new(1, 0, 0.5, 0)
- hint1.Position = UDim2.new(0, 0, 0, 0)
- hint1.BackgroundTransparency = 1
- hint1.TextColor3 = Color3.fromRGB(200, 200, 255)
- hint1.Font = Enum.Font.GothamMedium
- hint1.TextSize = 14
- hint1.TextXAlignment = Enum.TextXAlignment.Right
- hint1.TextTransparency = 0.2
- hint1.TextStrokeTransparency = 0.8
- hint1.TextStrokeColor3 = Color3.fromRGB(0, 0, 50)
- hint1.Parent = hintsContainer
- -- Текст подсказки 2 с эффектом свечения
- local hint2 = Instance.new("TextLabel")
- hint2.Text = "▶ В чате: speed [число]"
- hint2.Size = UDim2.new(1, 0, 0.5, 0)
- hint2.Position = UDim2.new(0, 0, 0.5, 0)
- hint2.BackgroundTransparency = 1
- hint2.TextColor3 = Color3.fromRGB(200, 200, 255)
- hint2.Font = Enum.Font.GothamMedium
- hint2.TextSize = 14
- hint2.TextXAlignment = Enum.TextXAlignment.Right
- hint2.TextTransparency = 0.2
- hint2.TextStrokeTransparency = 0.8
- hint2.TextStrokeColor3 = Color3.fromRGB(0, 0, 50)
- hint2.Parent = hintsContainer
- -- Анимация появления
- mainFrame.Position = UDim2.new(0.8, 0, 0.05, 0)
- game:GetService("TweenService"):Create(
- mainFrame,
- TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
- {Position = UDim2.new(0.725, 0, 0.05, 0)}
- ):Play()
- -- Функционал кнопки закрытия с анимацией
- closeButton.MouseButton1Click:Connect(function()
- game:GetService("TweenService"):Create(
- mainFrame,
- TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
- {Position = UDim2.new(0.8, 0, 0.05, 0)}
- ):Play()
- wait(0.5)
- gui:Destroy()
- end)
- -- Добавляем GUI игроку
- gui.Parent = player:WaitForChild("PlayerGui")
- local Player = game:GetService("Players").LocalPlayer
- local UserInputService = game:GetService("UserInputService")
- local RunService = game:GetService("RunService")
- local teleportEnabled = false
- local teleportDistance = 5 -- Стартовая дистанция
- local teleportCooldown = 0.1 -- Задержка между телепортами
- local lastTeleport = 0
- -- Функция для телепортации
- local function teleportForward(character)
- if not teleportEnabled then return end
- local rootPart = character:FindFirstChild("HumanoidRootPart")
- local humanoid = character:FindFirstChild("Humanoid")
- if not rootPart or not humanoid or humanoid.Health <= 0 then return end
- local now = tick()
- if now - lastTeleport < teleportCooldown then return end
- lastTeleport = now
- local direction = rootPart.CFrame.LookVector
- local newPosition = rootPart.Position + (direction * teleportDistance)
- -- Проверка на стены/препятствия
- local raycastParams = RaycastParams.new()
- raycastParams.FilterDescendantsInstances = {character}
- raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
- local raycastResult = workspace:Raycast(rootPart.Position, direction * teleportDistance, raycastParams)
- if raycastResult then
- newPosition = raycastResult.Position - (direction * 2)
- end
- rootPart.CFrame = CFrame.new(newPosition, newPosition + direction)
- end
- -- Обработчик включения/выключения
- UserInputService.InputBegan:Connect(function(input, gameProcessed)
- if gameProcessed then return end
- if input.KeyCode == Enum.KeyCode.F then
- teleportEnabled = not teleportEnabled
- print("Телепортация: " .. (teleportEnabled and "ВКЛ" or "ВЫКЛ"))
- end
- end)
- -- Изменение скорости через чат
- Player.Chatted:Connect(function(message)
- if message:sub(1, 6):lower() == "speed " then
- local newSpeed = tonumber(message:sub(7))
- if newSpeed and newSpeed > 0 then
- teleportDistance = newSpeed
- print("Скорость телепортации изменена на: " .. teleportDistance)
- end
- end
- end)
- -- Главный цикл (работает даже после смерти)
- local function handleCharacter(character)
- local humanoid = character:WaitForChild("Humanoid")
- -- Проверка движения и телепорта
- local connection
- connection = RunService.Heartbeat:Connect(function()
- if teleportEnabled and humanoid.Health > 0 and humanoid.MoveDirection.Magnitude > 0 then
- teleportForward(character)
- end
- end)
- -- Отслеживание смерти персонажа
- humanoid.Died:Connect(function()
- connection:Disconnect() -- Остановка телепортации
- end)
- end
- -- Автоподключение к новому персонажу
- Player.CharacterAdded:Connect(handleCharacter)
- if Player.Character then
- handleCharacter(Player.Character)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement