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

Output error " = expected near 'ME' " on one line but not a basically identical other line?

math.randomseed(tick())
local number = (math.random(2))
if number == 1 then
	script.Parent.Value = Voltison Augusta ME 
elseif number == 2 then
	script.Parent.Value = Voltison Belfast ME
end

The output error says that error is occurring on line 4, but line 6 is identical in every way except the city name is different, and no errors there. If I put two equals signs on line 4, the error goes away, but it's replaced with what I knew would happen, " = expected near ==' I've tried putting it in random places and nothing happens. I've tried making it "AugustaME" but then the error transfers to line 5. Where is the = supposed to go?

1 comment

0

By the way this is not where I live, I'm just building a game that involves these two cities.

2 answers

✓ Accepted answer

You're assigning your value wrong. Instead of Voltison Augusta ME, do "Voltison Augusta ME" in quotation marks to specify it's a string value.

Correct syntax:

local number = math.random(1, 2)

You can also look up Random.new().

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