Cart Magnet
Key Required

Cart Magnet

cart ride around nothingIscriptForfunIscriptForfun 1.7K views 3.6K executesUpdated Feb 7, 2026
5.0/ 5(2 votes)
20100% Positive
Lua Script•143 lines (4146 chars)
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")
local player = Players.LocalPlayer

local DEFAULT_GRAVITY = 50
local HIGH_GRAVITY = 1000
local RADIUS = 18
local TRACK_NAMES = {"Wheel", "Flange"}

-- ================= GUI =================
local gui = Instance.new("ScreenGui")
gui.Name = "CartMagnetGui"
gui.ResetOnSpawn = false
gui.Parent = player:WaitForChild("PlayerGui")

local frame = Instance.new("Frame", gui)
frame.Size = UDim2.new(0, 200, 0, 100)
frame.Position = UDim2.new(0, 20, 0, 120)
frame.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
frame.BorderSizePixel = 0
frame.Active = true
frame.Draggable = true

local corner = Instance.new("UICorner", frame)
corner.CornerRadius = UDim.new(0, 10)

local title = Instance.new("TextLabel", frame)
title.Size = UDim2.new(1, 0, 0, 30)
title.Text = "Cart Magnet"
title.BackgroundTransparency = 1
title.TextColor3 = Color3.new(1,1,1)
title.Font = Enum.Font.GothamBold
title.TextSize = 16

local toggleBtn = Instance.new("TextButton", frame)
toggleBtn.Size = UDim2.new(1, -20, 0, 40)
toggleBtn.Position = UDim2.new(0, 10, 0, 50)
toggleBtn.BackgroundColor3 = Color3.fromRGB(120, 70, 70) -- Red = OFF
toggleBtn.TextColor3 = Color3.new(1,1,1)
toggleBtn.Font = Enum.Font.GothamBold
toggleBtn.TextSize = 16
toggleBtn.Text = "Off"

-- ================= Selection System =================
local selectedParts = {}
local highlights = {}
local isOn = false

local function clearHighlights()
    for _, h in pairs(highlights) do
        h:Destroy()
    end
    highlights = {}
    selectedParts = {}
end

local function highlightPart(part)
    if highlights[part] then return end
    local hl = Instance.new("Highlight")
    hl.Adornee = part
    hl.FillColor = Color3.fromRGB(0, 255, 0)
    hl.OutlineColor = Color3.fromRGB(0, 200, 0)
    hl.Parent = part
    highlights[part] = hl
end

local function applyPartGravity(part, g)
    local att = part:FindFirstChild("GravityAttachment")
    if not att then
        att = Instance.new("Attachment")
        att.Name = "GravityAttachment"
        att.Parent = part
    end

    local vf = part:FindFirstChild("CustomGravity")
    if not vf then
        vf = Instance.new("VectorForce")
        vf.Name = "CustomGravity"
        vf.Attachment0 = att
        vf.RelativeTo = Enum.ActuatorRelativeTo.World
        vf.Parent = part
    end

    vf.Force = Vector3.new(0, -part:GetMass() * g, 0)
end

local function resetPartGravity(part)
    local vf = part:FindFirstChild("CustomGravity")
    if vf then vf:Destroy() end
    local att = part:FindFirstChild("GravityAttachment")
    if att then att:Destroy() end
end

-- ================= Auto Selection =================
local function scanParts()
    clearHighlights()
    local nearbyParts = Workspace:GetPartBoundsInRadius(player.Character.HumanoidRootPart.Position, RADIUS)
    for _, part in pairs(nearbyParts) do
        if part:IsA("BasePart") then
            for _, name in pairs(TRACK_NAMES) do
                if part.Name == name then
                    selectedParts[part] = true
                    highlightPart(part)
                    if isOn then
                        applyPartGravity(part, HIGH_GRAVITY)
                    else
                        resetPartGravity(part)
                    end
                end
            end
        end
    end
end

-- ================= Toggle Button =================
toggleBtn.MouseButton1Click:Connect(function()
    isOn = not isOn
    if isOn then
        toggleBtn.BackgroundColor3 = Color3.fromRGB(0, 200, 0)
        toggleBtn.Text = "On"
    else
        toggleBtn.BackgroundColor3 = Color3.fromRGB(120, 70, 70)
        toggleBtn.Text = "Off"
    end
    for part in pairs(selectedParts) do
        if isOn then
            applyPartGravity(part, HIGH_GRAVITY)
        else
            resetPartGravity(part)
        end
    end
end)

-- ================= Loop =================
RunService.Heartbeat:Connect(function()
    scanParts()
end)

-- Cleanup on respawn
Players.LocalPlayer.CharacterAdded:Connect(function()
    clearHighlights()
end)

Features & Information

Increases the gravity of the cart wheels, giving you more stability. Works on any cart. Doesn't work on trash executors
#cart#cart ride around nothing

Community Comments (6)

uhipvmtuhipvmtFeb 7, 2026

Didn’t work for me

Replying to @uhipvmt
IscriptForfunIscriptForfunFeb 7, 2026

@uhipvmt probably just your exploit, use a different one

tester_scriptertester_scripterFeb 7, 2026

trash

solaarphantomrasolaarphantomraFeb 7, 2026

not working on xeno

Replying to @solaarphantomra
IscriptForfunIscriptForfunFeb 7, 2026

@solaarphantomra clear your workspace folder

quenquen0601quenquen0601Jun 10, 2026

great script! works on solara

More Scripts for cart ride around nothing