Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I made a Variable for my favorite food, But it isn't coming up right, What do I have to do?

I'm trying to test out "Variables" and I typed this...

print (MyFavoriteFood) = Tacos

What am I doing wrong?

1 answer

✓ Accepted answer

Variables

Variables are created in their own initial statements - they cannot be created within another statement. For example, if you wanted to make a variable for the text Tacos, having the variable name be MyFavoriteFood, you must format it like this:

-- Variable created in it's own statement
MyFavoriteFood = "Tacos"

-- Now printing the variable as a seperate instruction
print(MyFavoriteFood) -- Prints the variable value (Tacos)

Also notice that there are quotation marks around Tacos. This is called a string value, and is vital to understand before you move on to anything else in programming. Hope this helped, just let me know if you have any questions.

2 comments

0

Thank you!

0

Anytime.

This discussion is preserved as it was. New answers, comments, and votes are closed.