o4-mini-2025-04-16· OpenAI
LMArena Human Preference 140K
Could you please, make me a Conveyer Script for Roblox Studio
- User
Could you please, make me a Conveyer Script for Roblox Studio
- Assistant
Here’s a simple “conveyor‐belt” script you can drop into a Part in Roblox Studio. Any unanchored BasePart that touches this conveyor will be carried along its look-vector at whatever speed you choose.
Setup Steps
- In Explorer, create a Part (e.g. name it “Conveyor”).
- Size/rotate it so its Front face (the red axis) is the direction you want parts to move.
- Inside that Part, insert a Script and paste in the code below.
- Tweak the
SPEEDconstant to dial in your belt’s speed (studs/sec).
-- Conveyor Script (place inside your conveyor Part) local conveyor = script.Parent local SPEED = 50 -- studs per second local DIRECTION = conveyor.CFrame.LookVector local MAX_FORCE = 1e5 -- how strongly parts will be driven -- Keep track of BodyVelocity instances so we can clean them up local bvMap = {} -- When something starts touching the conveyor: conveyor.Touched:Connect(function(hit) -- only move non-anchored BaseParts (ignore terrain, players, models, etc.) if not hit:IsA("BasePart") or hit.Anchored then return end -- avoid double-adding if bvMap[hit] then return end -- create a BodyVelocity to push the part local bv = Instance.new("BodyVelocity") bv.MaxForce = Vector3.new(MAX_FORCE, MAX_FORCE, MAX_FORCE) bv.Velocity = DIRECTION * SPEED bv.P arent = hit -- store for cleanup when the part leaves the conveyor bvMap[hit] = bv end) -- When something stops touching: conveyor.TouchEnded:Connect(function(hit) local bv = bvMap[hit] if bv then bv:Destroy() bvMap[hit] = nil end end)How it works:
- Touched → if an unanchored part enters, we give it a
BodyVelocitypointing along the conveyor’s look-vector. - TouchEnded → once it leaves, we destroy that
BodyVelocityso normal physics resume.
🎨 Customizations
- To reverse direction, either rotate your conveyor Part 180° or flip the code to use
-conveyor.CFrame.LookVector. - If you want to move only specific parts/models (e.g. only players’ characters), add a
CollectionServicetag or name-check inside theTouchedcallback. - You can also swap
BodyVelocityforLinearVelocity(newer API) if you prefer.
Enjoy building your factory! 🚂🛠️
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.