I do not understand the difference. They both seem the same to me, they both hold data.
They are a big difference. So, let me teach you about them.
Variables are things that can be used for later. So, instead of typing this
print('spam') print('spam') print('spam') print('spam') print('spam') print('spam') print('spam') print('spam') print('spam') print('spam')
you could use variables!
local p = print local s = 'spam' p(s) p(s) p(s) p(s) p(s) p(s) p(s) p(s) p(s) p(s)
Strings are basically text that you don't want roblox to run as actual code. For example, this would error
print(game.sometext)
because sometext is not a member of game. So, to tell the program "Hey, I don't want this code to run", we do
print('game.sometext')
Hope this helps!
First off, Here is a page I think you may find useful
A variable holds data that can be of any kind. A string is a kind of data that holds text. Other kinds of data are Integers(Number) and Boolean(Logic:True/False). So in other words, a variable can be a string but a string cannot be a variable
Variable
A variable is a name you can use to hold a value. In Lua, a variable can have any data type, such as a number or a string. See here
String
Strings are sequences of letters, numbers, and symbols. See here