LUA:local loot = doCreatureSepDropLoot(uid, itemid) doSetItemSpecialDescription(loot, "text")
And how to use ? OnKill or what ?
darkhaos I will rep you but please tell how to use that script.
And how about key charges ?
local loot = doCreatureSepDropLoot(uid, itemid)
doSetItemSpecialDescription(loot, "text")
local loot = doCreatureSepDropLoot(uid, 2173)
doSetItemSpecialDescription(loot, "Saves your life.")
<action itemid="2173" event="script" value="scriptname.lua"/>
local loot = doCreatureSepDropLoot(uid, 2173)
doSetItemSpecialDescription(loot, "Saves your life.")
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
doSetItemSpecialDescription(corpse.uid, "Text")
return TRUE
end
I was traying that :
and not working.Code:function onUse(cid, item, frompos, item2, toPosition) local loot = doCreatureSepDropLoot(cid, 2088) doSetItemSpecialDescription(loot, "Saves your life.") end
function onKill(cid, target)
local creature = "Demon"
if getCreatureName(target) == creature and isMonster(target) then
local loot = doCreatureSetDropLoot(target, 2195) --boots of haste
doSetItemSpecialDescription(loot, "Demon Boots of Haste")
end
return TRUE
end
<event type="kill" name="Loot" event="script" value="SCRIPT_NAME.lua"/>
registerCreatureEvent(cid, "Loot")
<script>
<event name="Loot"/>
</script>
My bug
Code:[16/05/2009 11:19:15] [Error - CreatureEvent::configureEvent] No valid type for creature event.textedit [16/05/2009 11:19:15] [Warning - BaseEvents::loadFromXml] Can not configure event
create a lua script in creatureScripts and put this:
LUA:function onKill(cid, target) local creature = "Demon" if getCreatureName(target) == creature and isMonster(target) then local loot = doCreatureSetDropLoot(target, 2195) --boots of haste doSetItemSpecialDescription(loot, "Demon Boots of Haste") end return TRUE end
Put this in creaturescripts.xml:
LUA:<event type="kill" name="Loot" event="script" value="SCRIPT_NAME.lua"/>
Add this in login.lua
LUA:registerCreatureEvent(cid, "Loot")
Later, add this in the monster-file (in this case, in demon.xml)
After </flags> add:
LUA:<script> <event name="Loot"/> </script>
That's all
@Kekox!
You're right! my bad! xD fast writing