• 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!

Lua Print out data of variable

xatron

New Member
Joined
Jun 14, 2011
Messages
62
Reaction score
1
Hello!

Im trying to develop a new script for my server and are currently using item to upgrade equipment. I do it with a action script and have came upon a problem now.

I use the "onUse" function where I pass in: onUse(player, item, fromPosition, target, toPosition, isHotkey) thoose varaibles.

Now if I want to check what item is holding (wich attributes and such) I'm not sure how to print that data out?

If I only use like print(item) I just the the userdata back - so I want to be able to print out all the data of that varaible somehow, any suggestions?
 
you need to use item methods to print out what you specifically need
here's a list of all of the functions you can use, look under item
i also attached a list of enums for you to use when you need to get an item's attribute, look under ITEM_ATTRIBUTE_XXXXX
for example: item:getAttribute(ITEM_ATTRIBUTE_ATTACK)
 

Attachments

Back
Top