• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Help Needed on upvalue issue

izaak

New Member
Joined
Feb 1, 2009
Messages
161
Reaction score
3
iam bussy on my 1st script ever but i keep having this problem
dous anyone know how i can solve this without losing my functions?

this is the error i get when i right click the item
Code:
data/actions/scripts/Equiptment.lua:3: attempt to call upvalue 'item' (a number value)
[07/09/2010 17:36:21] stack traceback:
[07/09/2010 17:36:21] 	data/actions/scripts/Equiptment.lua:3: in function <data/actions/scripts/Equiptment.lua:2>

and this is my script

Code:
 local item = 2457
function onUse (cid, itemid, frompos, topos)
if item (cid,666 ,1)== true then
doPlayerMoveItem (cid, 666 ,1) 
end
return true
end[/CODE
 
well im trying to fix that if i use a steel helmet that it wil automaticly goto the head slot
sofar i got this

Code:
local item = 2457
local HEAD = 1
local BACKPACK = 3

function onUse (cid, item, frompos, topos)
if item (cid,3,1) then
doPlayerEquip (cid, 2457, 1) ---head
for i,v in pairs do lua_gettable (cid ,local_items) 
end
end
end

thats my action script and it returns this

Code:
[07/09/2010 20:55:05] [Error - Action Interface] 
[07/09/2010 20:55:05] data/actions/scripts/Equiptment.lua:onUse
[07/09/2010 20:55:05] Description: 
[07/09/2010 20:55:05] data/actions/scripts/Equiptment.lua:6: attempt to call local 'item' (a table value)
[07/09/2010 20:55:05] stack traceback:
[07/09/2010 20:55:05] 	data/actions/scripts/Equiptment.lua:6: in function <data/actions/scripts/Equiptment.lua:5>
 
Man from where are you getting these functions, are you inventing them, go to your doc folder and check the lua_function .....
 
Man from where are you getting these functions, are you inventing them, go to your doc folder and check the lua_function .....
asd :p
Action Script =

Code:
local Slot      = getSlotPosition
local Weapon    = getWeaponType
local Item      = getInventoryItem 
local Container = getContainer
local Armor     = getArmor

function onUse (cid ,item ,Container,Weapon,slot,armor)
if Item (cid,weapon) == true then
do AddInventoryWeapon (cid,SlotPosition ,SLOT_RIGHT,1)
end
do RemoveInventoryItem (cid ,weapon ,1)
end
do table.count (cid ,table, item)
end
return true
end
end
 
Back
Top