Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 10 years ago
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.**

0
What happens when you try to run it? Is there any output? MrFlimsy 345 — 10y
0
I don't see why it should work. Are there any output errors and what specifically is not happening that should? GoldenPhysics 474 — 10y

1 answer

Log in to vote
1
Answered by
HexC3D 830 Moderation Voter
10 years ago
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 :)

0
Yes, it has. Thanks. Overpride 0 — 10y
Ad

Answer this question