• 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 Learning Lua help

Dexftw

Total Boss
Joined
Jan 30, 2011
Messages
317
Reaction score
8
Hi again, I decided instead of relying on others all the time to do crap is kind of sad, so Im reading Evil Heros tutorial and its helped me understand everything up to where I am now, so I'm practicing some noob scripts. Figured the best way to get understandable help would be from otland members

doTransformItem(item.uid, item.itemid + 1) What does this do? I understand what item.itemid = the item but the +1 and the item.(U)id and do transform item

I didn't see him explain that part in the script appreciate any help

P.S I'll edit this post when I change up what I need help understanding
 
doTransformItem is a function which uses 2 parameters/arguments in this example

The first; item.uid (or simply uid) is used by the server to locate and identify which item should be transformed. It must be a number.

The second parameter specifies which item ID should uid be changed to.
if item.itemid is 1945, item.itemid + 1 would be 1946

The third parameter is optional, and if specified it changes the item's count (if stackable) or subtype (if fluid container).
 
Ok since that ID was statue it wouldnt make much since too use dotransformitem then correct?
so I made this would this work? And explain to me what exactly it would do to see If I did it right

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
             if item.itemid == 8540 and getPlayerLevel(cid) >= 50 then
			 doPlayerSendTextMessage(cid,21,"Congratulations, you've gained the Mage addons!")
			 doPlayerAddOutfit(cid,130, 3)
		else 
		      doPlayerSendCancel(cid,"You don't have the required level to use this.")
		
end
return TRUE
end
 
Last edited:
Back
Top Bottom