Tutorial:Variables Explained

Roblox developers learn scripting from scratch and one of the oldest methods is variables.

You can use variables by making a short line like ex:

tank = 'Dangerous'

me = 'epic'

you = 'not as epic as me'

These can be used in scripts like ex: DataStore or even creating a currency system (shown in later tutorials) ex:

game.Players.PlayerAdded:connect(function(plr)--when the plr joins the game

local stats = Instance.new("IntValue",plr)--creating stats

stats.Name = 'leaderstats'--naming stats

local cash = Instance.new("IntValue",stats)--making the currency and making its parent the stats

cash.Name = 'Cash'--naming the cash

cash.Value = '0'--setting the value of the Cash

while true do

wait (1)

cash.Value + 10

end

end)

This was a quick example of how variables are helpful hope i have helped you.

Keep exploring and learning!