trip script
Key RequiredUniversal

trip script

Universal Scriptutku69680utku69680 3K views 169 executesUpdated Sep 14, 2025
5.0/ 5(1 votes)
10100% Positive
Lua Script•166 lines (5615 chars)
-- ScriptBlox script for a goofy tripping GUI

local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local rootPart = character:WaitForChild("HumanoidRootPart")

-- Create or get RemoteEvent for server communication (optional for replication)
local tripEvent = ReplicatedStorage:FindFirstChild("TripEvent")
if not tripEvent then
    tripEvent = Instance.new("RemoteEvent")
    tripEvent.Name = "TripEvent"
    tripEvent.Parent = ReplicatedStorage
end

-- Create the ScreenGui
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = player:WaitForChild("PlayerGui")
screenGui.Name = "TripToggleGui"

-- Create the black frame (bigger size)
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, 200, 0, 70)  -- Slightly larger
frame.Position = UDim2.new(0.5, -100, 0.5, -35)  -- Centered initially
frame.BackgroundColor3 = Color3.new(0, 0, 0)  -- Black frame
frame.BorderSizePixel = 0
frame.Parent = screenGui

-- Make the frame draggable
local dragging = false
local dragInput
local dragStart
local startPos

local function updateInput(input)
    local delta = input.Position - dragStart
    frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end

frame.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
        dragging = true
        dragStart = input.Position
        startPos = frame.Position
        input.Changed:Connect(function()
            if input.UserInputState == Enum.UserInputState.End then
                dragging = false
            end
        end)
    end
end)

frame.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
        updateInput(input)
    end
end)

-- Create the toggle button
local button = Instance.new("TextButton")
button.Size = UDim2.new(0, 150, 0, 50)  -- Bigger button
button.Position = UDim2.new(0.5, -75, 0.5, -25)
button.BackgroundColor3 = Color3.new(0, 0, 0)  -- Black button
button.TextColor3 = Color3.new(1, 1, 1)  -- White text
button.Text = "Off"
button.Parent = frame

-- Variable to track toggle state
local isTripping = false
local tripConnection = nil

-- Function to make the player trip (goofy effect)
local function makePlayerTrip()
    if not character or not humanoid or not rootPart or humanoid.Health <= 0 then return end

    -- Brief ragdoll for stumble
    humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
    
    -- Apply random force for goofy stumble
    local bodyVelocity = Instance.new("BodyVelocity")
    bodyVelocity.MaxForce = Vector3.new(10000, 0, 10000)  -- Horizontal force only
    bodyVelocity.Velocity = Vector3.new(math.random(-15, 15), 0, math.random(-15, 15))  -- Random direction
    bodyVelocity.Parent = rootPart

    -- Add a slight spin for extra goofiness
    local bodyAngularVelocity = Instance.new("BodyAngularVelocity")
    bodyAngularVelocity.MaxTorque = Vector3.new(0, 5000, 0)  -- Spin on Y-axis
    bodyAngularVelocity.AngularVelocity = Vector3.new(0, math.random(-5, 5), 0)  -- Random spin
    bodyAngularVelocity.Parent = rootPart

    -- Reset after a short delay
    task.spawn(function()
        task.wait(0.7)  -- Short trip duration
        if humanoid and humanoid.Health > 0 then
            humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
            bodyVelocity:Destroy()
            bodyAngularVelocity:Destroy()
        end
    end)

    -- Fire to server for others to see (if supported)
    tripEvent:FireServer(true)
end

-- Button click event
button.MouseButton1Click:Connect(function()
    isTripping = not isTripping
    button.Text = isTripping and "On" or "Off"
    
    if isTripping then
        -- Start looping trip effect
        tripConnection = game:GetService("RunService").Heartbeat:Connect(function()
            if not isTripping or not character or humanoid.Health <= 0 then
                tripConnection:Disconnect()
                return
            end
            makePlayerTrip()
            task.wait(2)  -- Trip every 2 seconds
        end)
    else
        -- Stop tripping
        if tripConnection then
            tripConnection:Disconnect()
        end
        if humanoid then
            humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
        end
        tripEvent:FireServer(false)
    end
end)

-- Handle character respawn
player.CharacterAdded:Connect(function(newChar)
    character = newChar
    humanoid = character:WaitForChild("Humanoid")
    rootPart = character:WaitForChild("HumanoidRootPart")
    if isTripping then
        -- Restart tripping if enabled
        tripConnection = game:GetService("RunService").Heartbeat:Connect(function()
            if not isTripping or not character or humanoid.Health <= 0 then
                tripConnection:Disconnect()
                return
            end
            makePlayerTrip()
            task.wait(2)
        end)
    end
end)

-- Clean up when the player leaves
game:BindToClose(function()
    if tripConnection then
        tripConnection:Disconnect()
    end
    screenGui:Destroy()
end)

Features & Information

trips you

Community Comments (3)

lvbelc5 baba

Replying to @QbvxiUdXG8nehUsRNfgU
utku69680utku69680Sep 15, 2025

@batusd3009 ne-

Replying to @utku69680

@utku69680 😘

More Scripts for Universal Scripts