i think you aren't supposed to put the filename in "s (dont know what they're called in english). So it becomes:
Code:dofile(./jumpdata/index.lua)
Printable View
i think you aren't supposed to put the filename in "s (dont know what they're called in english). So it becomes:
Code:dofile(./jumpdata/index.lua)
i need the quotes i know that. i dont need the ( though. still doesnt work now. now its
dofile "jumpdata/Index.lua
also what is wrong with thise line of code?
if math:random(0, 1)==0 then
when i try running it it says
wrong number of arguments
its
I think that should workCode:if math.random(0, 1)==0 then
hmm in the wiki it says:
dofile([filename])
If that doesn't work then i dont know because i havent used that before. But Ill try it if i have the time.
still doesnt work. right now im not even that worried with the dofuile. its the mathrandom part. without it i cant go any further.
this is the code its in
if np<6 and rc==1 and math:random(0,1)==0 then screenLblit(x1, y1, Obj) else end
I told you it's with a point, not a colon.
So it's:
if np<6 and rc==1 and math.random(0,1)==0 then screenLblit(x1, y1, Obj) else end
and not
if np<6 and rc==1 and math:random(0,1)==0 then screenLblit(x1, y1, Obj) else end
Ok i figured the dofile() out:
it's just
dofile("index.lua")
if it's in the same directory
If its not, then you can do this:
dofile("map/map/index.lua")
or you can put this in front of it:
System.currentDirectory("map/map")
Instead of "map/map" you type the directory its in (duh).
Both methods work.
So for you its:
orCode:dofile("jumpdata/index.lua")
Hope that helpedCode:System.currentDirectory("jumpdata")
dofile("index.lua")
see i thought it was with a : because in ttlde it has a lua funtion dictiopnsary type thing wherte u select it and it shows up on screen. it had showed up with a : not a .
well i used a . instead of a : and with me it works
and if it still doesnt work. Try storing the math.random(0,1) in a variable first and compare the variable in the if statement.
it works. i just now need to think of whats the best way to go about this.
also i just did the dofile and it works perfectly. thatnks alot.