function onUse(cid, item, frompos, item2, topos)
doPlayerAddOutfit(cid, 153, 1)
doPlayerAddOutfit(cid, 157, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have received First Beggar Addon.")
doSendMagicEffect(getCreaturePosition(cid), 14)
doRemoveItem(item.uid, 1)
return 1
end
<action itemid="2145" script="smalldiamond.lua"/>
The script: (data/actions/scripts/smalldiamond.lua)PHP:function onUse(cid, item, frompos, item2, topos) doPlayerAddOutfit(cid, 153, 1) doPlayerAddOutfit(cid, 157, 1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have received First Beggar Addon.") doSendMagicEffect(getCreaturePosition(cid), 14) doRemoveItem(item.uid, 1) return 1 end
Add into data/actions/actions.xml:
PHP:<action itemid="2145" script="smalldiamond.lua"/>
Reputation Plz ;>
But i if i want a new outfit
like a mob
doPlayerAddOutfit(cid, 255, 0)
its not work :S
all the addons? how i do then?
<outfit type="1" looktype="153" enabled="1" name="Beggar" premium="1" quest="STORAGE"/>
@Elaney
nonono :/
this is example, by adding quest="" value you can set those outfits available only for those who have certain storage. For example toy have set quest=12345 for knight outfit, so player with 12345,1 storage (setPlayerStorageValue(cid, 1234, 1)) will have this outfit enabled, and ofcourse player without 12345,1 storage won't have. Sry, messed up a bit but still readable xdCode:<outfit type="1" looktype="153" enabled="1" name="Beggar" premium="1" quest="STORAGE"/>
[02/03/2009 12:28:34] Lua Script Error: [Action Interface]
[02/03/2009 12:28:34] data/actions/scripts/br.luanUse
[02/03/2009 12:28:34] attempt to index a number value
[02/03/2009 12:28:34] stack traceback:
[02/03/2009 12:28:34] [C]: in function 'doSetCreatureOutfit'
[02/03/2009 12:28:34] data/actions/scripts/br.lua:2: in function <data/actions/scripts/br.lua:1>
Just do two items like i do.