← Roblox · All tutorials

Roblox

Change a Part’s Color with a Luau Script

By JFG News Writer · Updated Nov 5, 2026
Rainbow cubes connected by glowing script ribbons
Illustration: JustForGamerz

Locate a Workspace part from ServerScriptService and set its Color with Color3.fromRGB.

easy15 minRoblox Studio (Creator Hub object-properties tutorial, current as of Nov 2026)
0/6 steps done

Requirements

  • Roblox Studio
  • A Part in Workspace renamed PracticePart
  • ServerScriptService available in Explorer

Steps

  1. 1

    Inspect properties manually first

    Select any Part and look at the Properties window. Note Color, Size, Material, and Transparency—these can also be changed from scripts.

  2. 2

    Name the target part

    Select or create a Part and rename it exactly PracticePart so the script path matches.

  3. 3

    Create ChangeColor under ServerScriptService

    Add a new Script in ServerScriptService named ChangeColor. Delete the default code and add a comment line starting with -- describing that the script changes a part’s color.

  4. 4

    Address the part from Workspace

    Write workspace.PracticePart to reference the part. Workspace is available to scripts as the keyword workspace.

  5. 5

    Assign Color3.fromRGB

    Set the Color property with a line such as workspace.PracticePart.Color = Color3.fromRGB(255, 230, 50). Each RGB channel is a number from 0 to 255. Studio’s color picker can fill the values inside the parentheses.

  6. 6

    Playtest

    Run a playtest and confirm PracticePart switches to the new color when the server script runs.

Tips

  • Comments starting with -- do not run; use them as notes.
  • Dot operators chain from workspace to the part name to the property.
  • Other part properties follow the same pattern once you know the property name.