How to seperate Variables correctly?

  1. What do you want to achieve? Keep it simple and clear!
    I want to learn how to make space between variables correctly? I guess

  2. What is the issue? Include screenshots / videos if possible!
    I have no idea how to make space between variables.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I am looking for answer in Devforum

This is the my example of variables:

local Replicated_Storage = game:GetService("ReplicatedStorage")

local Status = Replicated_Storage:WaitForChild("Status")
local Events = Replicated_Storage:WaitForChild("Events")
local New_Round_Event = Events:WaitForChild("NewRound")

local GUI = script.Parent
local Status_Display = script
  • Is this separate correctly?
  • How to seperate variables?

This looks like it is separated correctly. The variables are sorted by type and what they define, so this looks clean.

If 2 variables are very similar sometimes people will do this:

local Status, Events = Replicated_Storage:WaitForChild("Status"), Replicated_Storage:WaitForChild("Events")

local [Variable 1], [Variable 2] = [Variable 1 Data], [Variable 2 Data]

1 Like

Typically you’d separate them between services, dependencies at the top, followed by constants, primitive values and finally objects.