Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsTo run your own code in a Roblox experience, open it in Roblox Studio, add a Script or LocalScript in the right place, write Luau, and test the experience. Use a server Script for authoritative game logic, a LocalScript for behavior on a player’s device, and a ModuleScript when other scripts need to reuse code. This guide covers supported workflows for experiences you own or can edit—not running unauthorized code in someone else’s live game.
Choose the right kind of script
Roblox uses Luau, a scripting language derived from Lua 5.1. Roblox describes it as “a fast, small, safe, gradually typed embeddable scripting language.” The Studio editor includes autocomplete, syntax highlighting, linting, type checking, and script analysis. See Roblox’s Luau documentation and scripting overview.
| Type | Where it runs | Use it for |
|---|---|---|
Script |
On the server when enabled and placed in a supported location such as Workspace or ServerScriptService. |
Game logic and changes to authoritative game state. ServerScriptService is intended for server-side scripts. |
LocalScript |
On an individual player’s device, when placed in a supported client-side container. | Player-specific behavior and other client-side features. It does not run on the server. |
ModuleScript |
When another script loads it with require(); its execution is independent on the client and server. |
Reusable code shared by scripts. A module returns one value, and requiring it on the client runs it on the client. |
For current location and behavior details, consult Roblox’s Script, LocalScript, and ModuleScript references.
Run a basic script in Roblox Studio
- Open your place in Studio. In the Explorer, find
ServerScriptService. - Create a Script. Hover over
ServerScriptService, select the plus button, and chooseScript. Roblox’s Create a script tutorial walks through this setup. - Enter a small test. Replace the starter code with
print("Hello from my script"). - Test the experience. Start a test session in Studio, then look for the message in the Output window. You can also inspect logs in the Developer Console.
A server script needs to be enabled and in a supported location to run. If you do not see the message, check that the script is enabled, that it is under ServerScriptService, and that the test session has started.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minute#1 Best Overall
- Redemption: Online only. Robux cards can only be redeemed in a browser at Roblox.com/redeem. They cannot be redeemed in the Roblox mobile app or any video game console.
- Roblox is an immersive platform for connection and communication. Every day, millions of people come to Roblox to create, play, work, learn, and connect with each other in experiences built by our global community of creators.
- Get more with every Roblox Gift Card! From now on, when you redeem a Roblox gift card, you get up to 25% more Robux. Perfect for gaming, creating, and exploring- more Robux means more possibilities!
- Deck out your avatar and unlock additional perks in your favorite experiences when you use Roblox Gift Cards to purchase Robux (Roblox's virtual currency).
- Each gift card grants a free virtual item upon redemption.
Run code on a player’s device
Use a LocalScript when the behavior belongs on the player’s client, rather than the server. Create one in a container where LocalScripts are supported, write the client-side code, and test it in Studio. A LocalScript does not run simply because it exists anywhere in the place hierarchy; use Roblox’s LocalScript reference to check supported locations and behavior.
Decide where the logic belongs before choosing the script type: client code is for player-side behavior; server code is for game state that should be controlled by the experience’s server.
Rank #2
- The easiest way to add Robux (Roblox’s digital currency) to your account. Use Robux to deck out your avatar and unlock additional perks in your favorite Roblox experiences.
- This is a digital gift card that can only be redeemed for Robux at Roblox.com/redeem. It cannot be redeemed in the Roblox mobile app or any video game console. Please allow up to 5 minutes for your balance to be updated after redeeming.
- Roblox Gift Cards can be redeemed worldwide, perfect for gifting to Roblox fans anywhere in the world.
- From now on, when you redeem a Roblox Gift Card, you get up to 25% more Robux. Perfect for gaming, creating, and exploring- more Robux means more possibilities!
- Every Roblox Gift Card grants a free virtual item upon redemption.
Reuse code with a ModuleScript
Create a ModuleScript for code that other scripts should reuse. A calling Script or LocalScript loads the module with require(). The module returns one value, and it executes in the environment of the script that requires it: requiring it from a LocalScript runs it on the client. See Roblox’s ModuleScript reference.
Check output and errors
During a Studio test or live session, open the Developer Console with F9 or /console. Its Log section displays diagnostic messages. Use the client/server view to inspect the relevant logs: client output is visible to players, while server output is restricted to the experience owner or group members with editing permission. Roblox documents these controls in its Developer Console guide.
Rank #3
- The easiest way to add Robux (Roblox’s digital currency) to your account. Use Robux to deck out your avatar and unlock additional perks in your favorite Roblox experiences.
- This is a digital gift card that can only be redeemed for Robux at Roblox.com/redeem. It cannot be redeemed in the Roblox mobile app or any video game console. Please allow up to 5 minutes for your balance to be updated after redeeming.
- Roblox Gift Cards can be redeemed worldwide, perfect for gifting to Roblox fans anywhere in the world.
- From now on, when you redeem a Roblox Gift Card, you get up to 25% more Robux. Perfect for gaming, creating, and exploring- more Robux means more possibilities!
- Every Roblox Gift Card grants a free virtual item upon redemption.
- If a server message is missing, check the server log and confirm the Script is enabled and in a supported location.
- If a client feature is missing, check the client log and confirm the LocalScript is in a supported container.
- If a script reports an error, use the Output window or Developer Console to find the message, then inspect the indicated code and script type.
Use command-line or cloud execution for automation
Run a Luau file with the Studio command line
Roblox documents launching Studio with --task RunScript and an absolute .lua or .luau file path supplied with --runScriptFile. The script runs with the same permission level as the Studio command bar. This is an automation option, not the usual beginner workflow; see the Studio command-line interface documentation for launch examples and place options.
Run a headless task through Open Cloud
Roblox’s Open Cloud Luau Execution lets an automation task specify a universe, place, and Luau script. A server loads the place, runs the code, and returns logs and results. Roblox currently documents a maximum task duration of five minutes and up to ten concurrent tasks per place; these are service limits that may change. See the Luau Execution documentation for requirements and current limits.
Quick Recap
Best Value
- The easiest way to add Robux (Roblox’s digital currency) to your account. Use Robux to deck out your avatar and unlock additional perks in your favorite Roblox experiences.
- This is a digital gift card that can only be redeemed for Robux at Roblox.com/redeem. It cannot be redeemed in the Roblox mobile app or any video game console. Please allow up to 5 minutes for your balance to be updated after redeeming.
- Roblox Gift Cards can be redeemed worldwide, perfect for gifting to Roblox fans anywhere in the world.
- From now on, when you redeem a Roblox Gift Card, you get up to 25% more Robux. Perfect for gaming, creating, and exploring- more Robux means more possibilities!
- Every Roblox Gift Card grants a free virtual item upon redemption.
Rank #4
- The easiest way to add Robux (Roblox’s digital currency) to your account. Use Robux to deck out your avatar and unlock additional perks in your favorite Roblox experiences.
- This is a digital gift card that can only be redeemed for Robux at Roblox.com/redeem. It cannot be redeemed in the Roblox mobile app or any video game console. Please allow up to 5 minutes for your balance to be updated after redeeming.
- Roblox Gift Cards can be redeemed worldwide, perfect for gifting to Roblox fans anywhere in the world.
- From now on, when you redeem a Roblox Gift Card, you get up to 25% more Robux. Perfect for gaming, creating, and exploring- more Robux means more possibilities!
- Every Roblox Gift Card grants a free virtual item upon redemption.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




