• 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 Simple LUA Item Question

Arn

Member
Joined
Mar 8, 2010
Messages
282
Reaction score
18
I'd like to be able to call an items attack or defense from inside a script. How can I do this?

Example:
Code:
local item = 3964
doCreatureSay(cid, item.attack .. " " .. item.defense, TALKTYPE_SAY)

Very simple although the above obviously doesn't work. So, how can I do it?

Thank you!

-Arn

(will +rep)
 
Lua:
function f(cid, ...)
	local itemInfo = getItemInfo(3964)
	doCreatureSay(cid, itemInfo.attack .. " " .. itemInfo.defense, TALKTYPE_SAY)
	
	return true
end
 
Lua:
function f(cid, ...)
	local itemInfo = getItemInfo(3964)
	doCreatureSay(cid, itemInfo.attack .. " " .. itemInfo.defense, TALKTYPE_SAY)
	
	return true
end

Very elegant solution, however my server does not have the getItemInfo function. Any other options available to me?
 
Add the getItemInfo function to your sources? If you haven't your sources.. you can pay or search it, you're a Premium User.

Could you elaborate on this? Also, when you say adding it to my sources, you mean re-compiling the server? Also, I am a premium user.
 
Back
Top