I am having trouble with strings and I can’t figure out this script.
Hello!
We use ' and " at the beginning and end of strings to tell if it's a variable or a string. So it is used not to confuse the computer so they can know if it means string or something else.
An example:
local variable = "hello" print("variable") --this will print the text 'variable' and not 'hello' since the quotation marks mean string and not getting the actual variable. print(variable) --this will print 'hello' since there are no quotation marks so it gets the variable called variable instead.
Hope this helps.
Hello kind sir.
As described above in the other answer. Variables and strings are very cool. But the important thing to know is to put these tags ""
between variables. The reason why you should do this is that the game can confuse strings with actual objects! let's see an example!
local string = "hello!" local hello = nil print("hello!")--This will print hello with no problems print(string)--this will print a connected string. Use no tags because this is an ob print(hello)--This will attempt to print a nil value, which is impossible because nil means nothing --Therefore, this part will result in a script crash
Hope this helps you!
Best
TheLastHabanero