In Roblox Studio, open a Baseplate.
In Explorer, click on ServerScriptService. Scripts will run inside this service, and will not replicate to game clients, allowing for secure storage of your scripts. In other words, they will run on Roblox's servers.
When you click on the + button, select Script.
A Script is a type of Lua code container that will run its contents on the server. By default, Scripts have
print("Hello, world") as their contents.
Click on File and Save to File
In View, click on Output
In Script Menu, click on Play
If all goes well, you should see Hello World in the Output window at the bottom of your screen.
Pick a Part, any part.
Rename the Part to MyPart or another intuitive name.
Add a Script to MyPart.
Let's change the properties of our Part via Lua.
Create a local variable named mypart to store Workspace MyPart
-- Create a variable to store the partlocal mypart = game.Workspace.MyPart
Change the brick to a random color.
-- Changes the color of loopingPart every few seconds-- Create a variable to store the partlocal mypart = game.Workspace.MyPartmypart.BrickColor = BrickColor.Random()
For your reference, here are a list of different possible colors:
To make the script wait before running the next line of code, use a
wait(3) -- waits 3 seconds
Change your part to random colors.
-- Changes the color of loopingPart every few seconds-- Create a variable to store the partlocal mypart = game.Workspace.MyPartwhile true do--wait(3)end
Add a Spawn Location or multiple Spawn Locations to your game. It's the icon under Effects.
Use the Touched Event to change the color of your Part when a Humanoid comes into contact with it.
Using surface GUIs, you can add interfaces directly into your game world to create shop signs, keypad panels for locked doors, or even touch screens.