Имитация рывков персонажа

Иллюстрация к карточке «Имитация рывков персонажа»

Переключатель включает случайные смещения HumanoidRootPart во время движения.

Переключатель включает случайные смещения HumanoidRootPart во время движения. Надпись FPS генерирует случайные числа; при отключении отображает 60.

Функции

  • Имитация рывков

Особенности исходного кода

Это визуальная имитация задержки, а не измерение или ускорение игры. Нет обновления rootPart после возрождения. Код не вмешивается в сеть и не загружает другие скрипты.

Описаны действия сохранённого исходника. Код не запускался; работа в текущей версии Brookhaven RP не подтверждена.

Lua-код

Lua
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local PlayerGui = player:WaitForChild("PlayerGui")
local character = player.Character or player.CharacterAdded:Wait()
local rootPart = character:WaitForChild("HumanoidRootPart")

local lagEnabled = false
local glitchIntensity = 2.5
local minLag = 0.01
local maxLag = 0.1
local lagChance = 0.95
local lastPosition = rootPart.Position

local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Parent = PlayerGui

local Frame = Instance.new("Frame")
Frame.Size = UDim2.new(0, 160, 0, 50)
Frame.Position = UDim2.new(0.5, -80, 0.1, 0)
Frame.BackgroundColor3 = Color3.fromRGB(15, 15, 15)
Frame.BorderSizePixel = 0
Frame.AnchorPoint = Vector2.new(0.5, 0)
Frame.Parent = ScreenGui
Frame.Active = true
Frame.Draggable = true

local UICorner = Instance.new("UICorner")
UICorner.CornerRadius = UDim.new(0, 25)
UICorner.Parent = Frame

local ToggleButton = Instance.new("TextButton")
ToggleButton.Size = UDim2.new(0.8, 0, 0.4, 0)
ToggleButton.Position = UDim2.new(0.1, 0, 0.1, 0)
ToggleButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
ToggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
ToggleButton.Font = Enum.Font.Gotham
ToggleButton.TextSize = 16
ToggleButton.Text = "OFF"
ToggleButton.AutoButtonColor = false
ToggleButton.Parent = Frame

local UICornerButton = Instance.new("UICorner")
UICornerButton.CornerRadius = UDim.new(0, 15)
UICornerButton.Parent = ToggleButton

local FPSText = Instance.new("TextLabel")
FPSText.Size = UDim2.new(0.8, 0, 0.4, 0)
FPSText.Position = UDim2.new(0.1, 0, 0.55, 0)
FPSText.BackgroundTransparency = 1
FPSText.TextColor3 = Color3.fromRGB(0, 255, 0)
FPSText.Font = Enum.Font.Gotham
FPSText.TextSize = 14
FPSText.Text = "FPS: 60"
FPSText.TextXAlignment = Enum.TextXAlignment.Left
FPSText.Parent = Frame

ToggleButton.MouseEnter:Connect(function()
    ToggleButton.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
end)
ToggleButton.MouseLeave:Connect(function()
    ToggleButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
end)

ToggleButton.MouseButton1Click:Connect(function()
    lagEnabled = not lagEnabled
    ToggleButton.Text = lagEnabled and "ON" or "OFF"
end)

RunService.RenderStepped:Connect(function()
    if lagEnabled then
        local fakeFPS = math.random(1000, 1000000)
        FPSText.Text = "FPS: "..fakeFPS
        if fakeFPS < 10000 then
            FPSText.TextColor3 = Color3.fromRGB(255,0,0)
        elseif fakeFPS < 500000 then
            FPSText.TextColor3 = Color3.fromRGB(255,255,0)
        else
            FPSText.TextColor3 = Color3.fromRGB(0,255,0)
        end
    else
        FPSText.Text = "FPS: 60"
        FPSText.TextColor3 = Color3.fromRGB(0,255,0)
    end

    if lagEnabled then
        local velocity = rootPart.Velocity
        if velocity.Magnitude > 0.1 then
            if math.random() < lagChance then
                local moveDirection = rootPart.CFrame.LookVector * (velocity.Magnitude * 0.1)
                local randomOffset = Vector3.new(
                    (math.random()-0.5)*glitchIntensity,
                    0,
                    (math.random()-0.5)*glitchIntensity
                )
                rootPart.CFrame = CFrame.new(lastPosition + moveDirection + randomOffset)
                wait(math.random()*(maxLag-minLag)+minLag)
            else
                lastPosition = rootPart.Position
            end
        else
            lastPosition = rootPart.Position
        end
    else
        lastPosition = rootPart.Position
    end
end)

Перед использованием проверьте код и учитывайте правила Roblox.

Информация о карточке

Формат
Карточка с кодом
Ключ
Не требуется
Совместимость
Brookhaven RP, place ID 4924922222. Актуальная работа не проверена.
Автор
OnlyThePower

Как запустить скрипт в Brookhaven RP

Для запуска Lua-скрипта в Брукхейвен понадобится специальная программа - executor. В качестве таких инструментов используются Delta, Fluxus и Arceus X. Весь процесс состоит из четырёх простых шагов.

  1. Подготовьте executor. Установите совместимую с вашим устройством программу для выполнения Lua-кода. Учитывайте, что доступность и поддержка конкретных программ могут меняться.
  2. Запустите Brookhaven RP. Откройте Roblox и войдите в игру Брукхейвен на выбранном сервере.
  3. Скопируйте Lua-скрипт. Вернитесь на страницу скрипта и нажмите кнопку «Скопировать», расположенную рядом с блоком кода.
  4. Выполните скрипт. Вставьте скопированный код в окно executor и нажмите Execute. Доступность функций зависит от скрипта, программы и версии игры.

Нужна помощь с установкой и запуском? Прочитайте пошаговое руководство по использованию скриптов Brookhaven RP .