English stupid lua-initArray bug

3 replies
Goto Page
To the start Previous 1 Next To the start
13.09.11 07:42:24 am
Up
Sudden Death
User
Offline Off
Hello try make something for my friend and lua don't like me:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function initArray(m)
local array = {}
for id = 1, m do
array[id]=0
end
return array
end

x=initArray(32)

addhook("spawn","iii")
function iii()
if x[id]>=1 then -- here it's have problem :/ it's don't like ">="??
x[id]=x[id]-1
end
if x[id]==0 then
menu(id,"Imperator,Yes,No")
end
end
Sniffin'Man "If it cannot be done with lua, it must be you mama, coz she's too fat"
13.09.11 10:14:32 am
Up
Cure Pikachu
User
Offline Off
You forgot the parameter for the iii function.
Code:
1
function iii(id) -- Fixed the function ONLY
IMG:https://i.imgur.com/uUrye71.png
IMG:https://i.imgur.com/xpsyQRX.png
13.09.11 03:26:45 pm
Up
Infinite Rain
Reviewer
Offline Off
Array error becouse theres no such array "id"
so mkae this:
Code:
1
function iii((id)
A thousand may fall at your side, ten thousand at your right hand, but it will not come near you. You will only look with your eyes and see the recompense of the wicked. - Psalm 91:7-8 ESV
13.09.11 03:38:44 pm
Up
Sudden Death
User
Offline Off
Omg sorry for that :X maybe better when i copy and pase next time
Sniffin'Man "If it cannot be done with lua, it must be you mama, coz she's too fat"
To the start Previous 1 Next To the start