|
trak = math.random(1,2)
if trak == 1 then
xcx = math.random(1,1)
if xcx == 1 then
dwarf()
wait(4)
end
elseif trak == 2 then
xcx = math.random(1,1)
if xcx == 1 then
gokart()
wait(4)
end
end
My problem is that the functions never run.
I'd give you the rest of the script, but it's 200 lines.
|
|
KingBooJoin Date: 2007-07-16 Post Count: 8495 |
trak = math.random(1,2)
if trak == 1 then
dwarf()
wait(4)
else
gokart()
wait(4)
end
Don't question, try. |
|
|
Ok, so what will I do when I need to add a third function and elseif?
trak isn't always going to be 1 or 2. it is for now, but later it will be more numbers. |
|
|
grimm343Join Date: 2008-09-18 Post Count: 2796 |
That would only work if you did a math.random(1,3)
Increase the higher number to the number of possibilities. |
|
|
Ugh...
Don't try to help me if you aren't going to read the original post.
I told you my problem. Don't try to fix another problem. |
|
|
smurf279Join Date: 2010-03-15 Post Count: 6871 |
trak = math.random(1,2)
if trak == 1 then
dwarf()
wait(4)
elseif trak == 2 then
gokart()
wait(4)
end |
|
|
xcx has to stay in the script. |
|
|
grimm343Join Date: 2008-09-18 Post Count: 2796 |
...
The functions you are having trouble running should be placed ABOVE the pasted few lines.
Also, if the problem resides inside those functions that do not run, then you must paste more.
Hmm.. Output would also help. |
|
grimm343Join Date: 2008-09-18 Post Count: 2796 |
Why does xcx have to stay there?
Where else do you use a value of 1?
Why did you make it randomly choose a number between 1 and.. 1? |
|
KingBooJoin Date: 2007-07-16 Post Count: 8495 |
The reason it doesn't work is because the script is trying to pic a random number between 1 and 1. -.- |
|
grimm343Join Date: 2008-09-18 Post Count: 2796 |
local trak = math.random(1,2)
if trak == 1 then
dwarf()
elseif trak == 2 then
gokart()
end |
|