Put math.randomseed(os.time() ) as the first line. Then do:Zitat:
Zitat von N0obKi|l3r.exe
math.random(low, high)
You could just do mynumber = math.random(low,high)
Hope I helped. :)
Printable View
Put math.randomseed(os.time() ) as the first line. Then do:Zitat:
Zitat von N0obKi|l3r.exe
math.random(low, high)
You could just do mynumber = math.random(low,high)
Hope I helped. :)
myNumber = math.random(1,30)
This picks a number at random between 1 and 30.If you put this BEFORE your main loop, it will pick a random number once, when the script is first started. If you put this AFTER your main loop, it will pick a new number each time the loop performs.
Also, if you are going to be using random numbers, put this at the beggining of your code:
math.randomseed(os.time() )
Without this, it would pick the same random number every time, which wouldn't make it very random.
EDIT: Oops, looks like PSPduh already helped you. BTW- Don't worry about making stupid mistakes, everyone does it.
Yes but yours is much more explained then mine. :)Zitat:
Zitat von Access_Denied
That's probably why you posted before me, I took too long to write it.:)Zitat:
Zitat von PSPduh
thnaks both off you. now with this im going top make it so thaty after 5 seconds, it will load a number. if number == 1 then health = health - 5 and restart timer and start it. iff 2 then do nothing :D what do ya think? fighting games are confusong :( thnx to all who hasve helped!
You could do something like this:
if number == 1 then
health = health - 5
counter:reset(0)
counter:start()
end
i know i did i was just tellin waht i was gonna do :p i9 did:
if counter:time() > 4000 then
mynumber = math.random(1,1000)
screen:print(30,30,"num". . mynumber,black)
counter:reset(0)
counter:start()
end
if mynumber == 2 then
Health = Health - 5
end
-= Double Post =-
damn. while it waits for the timer to laod up to 4000,,, it like subtract 5 every sec of it... sdo im sticking to 1000
OK, I just downloaded TTLDE v 2.1. I have tried it using the widows emulator and it works fine. But, when I go into my other program and write "dofile("TTLDE.lua")" in the windows emulator, I get all kinds of errors. But when I run it alone, it works fine. Does anyone know why? And yes, I have all the files in the same directory.
-= Double Post =-
Sorry for bumping this so quickly, but I need an answer ASAP.
The error names would help immensly ;)
Nevermind, I'm done with that problem. But now I need to know, How many images can you load in one script in LuaPlayer?