I'm trying to make a simple chest script or whatever for my server want be plagued by multiple ids. I'm in no way taking credit for anything just trying to learn how to script a little in lua. I can't get it to work for some reason. Maybe someone here can show me the error of my ways.
Heres how its coded. I'm useing tfs 3.6 and i'm guessing its an action script.
function onUse(cid, item, frompos, item2, topos)
if item.uid == 15001 then
getplayerstoragevalue(cid, 50001) == -1 then
setplayerstoragevalue(cid, 50001, 1)
doplayeradditem(cid, 2376, 1)
else
return 0
end
return 1
end
this is the error i get
[Error - LuaScriptInterface::loadFile] data/actions/scripts/test2.lua:3: unexpected symbol near '=='
[19/02/2010 18:07:45] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/test2.lua)
[19/02/2010 18:07:45] data/actions/scripts/test2.lua:3: unexpected symbol near '=='
Heres how its coded. I'm useing tfs 3.6 and i'm guessing its an action script.
function onUse(cid, item, frompos, item2, topos)
if item.uid == 15001 then
getplayerstoragevalue(cid, 50001) == -1 then
setplayerstoragevalue(cid, 50001, 1)
doplayeradditem(cid, 2376, 1)
else
return 0
end
return 1
end
this is the error i get
[Error - LuaScriptInterface::loadFile] data/actions/scripts/test2.lua:3: unexpected symbol near '=='
[19/02/2010 18:07:45] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/test2.lua)
[19/02/2010 18:07:45] data/actions/scripts/test2.lua:3: unexpected symbol near '=='
Last edited: