So, I learned how to make tables, and I made some this days and everything worked fine.
But today I tried making 2 different scripts with tables and Im getting always an error, which I cannot fix!
For example, this 2 scripts, Im getting the same error
Switch system
And here a summoning script
And the error I'm getting (Of course in diff lines since they don't have the same line..)
Is this:
Rep+ for the one who tries to help
But today I tried making 2 different scripts with tables and Im getting always an error, which I cannot fix!
For example, this 2 scripts, Im getting the same error
Switch system
LUA:
local uids = {
[35000] = {1},
[35001] = {2},
[35002] = {3},
[35003] = {4},
[35004] = {5},
[35005] = {6},
[35006] = {7},
[35007] = {8},
[35008] = {9},
[35009] = {10}
}
local s = setPlayerStorageValue
local storage = 45001
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = uids[item.uid]
setPlayerStorageValue(cid,storage,v[1])
elseif getPlayerStorageValue(cid,storage) == 10 then
doPlayerSendTextMessage(cid, "You have already pulled all switches")
return true
end
And here a summoning script
LUA:
local t = {
[1] = {'dragon'},
[2] = {'rat'},
[3] = {'fire elemental'},
[4] = {'vampire'} ,
[5] = {'dragon lord'},
[6] = {'cave rat'}
}
function onSay(cid, words, param, channel)
local v = t[vocations]
if vocations then
doSummonCreature(cid,v[1])
doSummonCreature(cid,v[1])
doSummonCreature(cid,v[1])
setPlayerStorageValue(cid,5000,1)
end
elseif getPlayerStorageValue(cid,5000) and word == 'summon' then
doPlayerSendCancel(cid, "You can only summon 3 monsters")
return true
end
And the error I'm getting (Of course in diff lines since they don't have the same line..)
Is this:
Code:
ERROR: untitled.lua:19: 'end' expected (to close 'function' at line 11) near 'elseif'
Rep+ for the one who tries to help