Error: attempt to index field '?' (a number value)
local numbers = {{1,2},{3,4},{5,6},{7,8},{9,10}}
function check ()
local number = 3
for i,v in ipairs (numbers) do
if number == v[1] then
outputChatBox(v[1].." | "..v[1][2])
break
end
end
end
addCommandHandler("check", check)
I have a table with some numbers:
local numbers = {{1,240},{3,4670},{5,64343},{7,8704},{9,10476}}
If I can retrieve numbers: 1,3,5,7,9, how can I get a number next to it?
For example if I get a number 3 I want to retrieve a number 4670.
Oh, I provided incorrect information. Data is set to 10 by client, then server sets it to 0 and finally server checks data with 'onElementDataChange'. and it is still 10.
I have element data called: "data". The script sets data to 0.
Then I use 'onElementDataChange'
if getElementData(source,"data") == 10 then
outputChatBox("k", source, 0, 255, 0, true)
And for some players it outputs k. How is this possible, if I ask data to be 10 and it stills passes the condition?
Usually everything works fine but for some people it happens. Why?
Everything is server side.