Jakeup10
|
  |
| Joined: 29 Nov 2008 |
| Total Posts: 6782 |
|
|
| 19 Jun 2013 03:37 PM |
Workspace.Script:8:attempt to call field 'Random" (a nil value) That is the only output.
EggValues = { Egg1 = 1, Egg2 = 2, Egg3 = 3 }
Random = math.Random(10)
while true do for i,v in pairs(EggValues) do if Random == EggValues then print(Random) wait(1) end end end
I am assuming that the whole "Name = *Script or area*" doesn't work with math.random, or is it something else? |
|
|
| Report Abuse |
|
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
| |
|
|
| 19 Jun 2013 03:39 PM |
EggValues = { Egg1 = 1, Egg2 = 2, Egg3 = 3 }
Random = math.Random(10)
while true do for i,v in pairs(EggValues) do if Random == v then print(Random) wait(1) end end end
Dat work? |
|
|
| Report Abuse |
|
|
Jakeup10
|
  |
| Joined: 29 Nov 2008 |
| Total Posts: 6782 |
|
|
| 19 Jun 2013 03:42 PM |
| Nope, same error with both... |
|
|
| Report Abuse |
|
|
| |
|
Desperian
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 3371 |
|
|
| 19 Jun 2013 03:47 PM |
1) You need a wait, or that'll crash. 2) Do what ALER posted. As said, while very non-descriptive, it's math.random() not math.Random() |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2013 03:48 PM |
EggValues = { 1, 2, 3 }
Random = math.random(10)
while true do for i,v in pairs(EggValues) do if Random == v then print(Random) wait(1) end end end
Works now? |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2013 03:56 PM |
idiot who posted first saying local random not random
GTFO
no that won't work
math.random(numhere,numhere) needs 2 arguments |
|
|
| Report Abuse |
|
|
Jakeup10
|
  |
| Joined: 29 Nov 2008 |
| Total Posts: 6782 |
|
|
| 19 Jun 2013 05:12 PM |
@Luke,
No, that wouldn't work because I will need the names later, plus it only keeps printing 3, and only 3.
@Master,
Still doesn't work, but the dual numbers doesn't change anything, saying just putting in 1 number will make it from 1 to that number...
|
|
|
| Report Abuse |
|
|