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

What is wrong with this script?(Random # Generator)

MapData.Value = math.random(1,2)
		wait(1)
		if MapData.Value == 1 then

MapData is an IntegerValue inside the script. & It is defined as:

MapData = script.MapData

**But it does not work. Why!? When the script executes, it does not generate a random number from 1-2.

P.S, I do not want any other method. I want this method to be fixed and I do not want no tables >_> so please...stick to this method and help me fix it.**

2 comments

0

What happens when you try to run it? Is there any output?

0

I don't see why it should work. Are there any output errors and what specifically is not happening that should?

1 answer

✓ Accepted answer
local az= script.Parent.script
local ab = az.MapData
local a = (math.random(1, math.random(1, 2))
ab.Value = a

This should work, there!

+1 if this helped, check mark if this answered your query :)

1 comment

0

Yes, it has. Thanks.

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