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

Aol forever

Zonet

Web Developer
Joined
Sep 1, 2008
Messages
4,393
Reaction score
52
Location
Tibia VS RL-life, guess whos back?
Hello there..

I want to do the broken amulet like amulet of loss but never lose the broken amulet always have it.!


can anyone make a script if there's script i know that aol is compiled but if there's script i would be very thanksful for the guy who script it to me:p


Thank you.
 
If you don't want edit sources...
in data/creaturescripts/scripts/login.lua under:
PHP:
function onLogin(cid)
add:
PHP:
registerCreatureEvent(cid, "PlayerDeathPrepare")
in data/creaturescripts/scripts/ make file playerpreparedeath.lua and in this file:
PHP:
function onPrepareDeath(cid, killer)
	if getPlayerItemCount(cid, 8889) >= 1 then
		doSetCreatureDropLoot(cid, 0)
	end
end
getPlayerItemCount(cid, 8889) - with item 8889 (skullcracker armor) players dont lose eq - tested (player can wear this item in backpack, not only armor slot!)
in file data/creaturescripts/creaturescripts.xml under:
PHP:
<creaturescripts>
add:
PHP:
<event type="preparedeath" name="PlayerDeathPrepare" script="playerpreparedeath.lua"/>
 
Last edited:
I suggest making it check if that item is in the necklace position, otherwise the person could just have it in the backpack and be wearing other necklaces.
 
How do you do so it checks if the item is in "necklace slot"?

Code:
function onPrepareDeath(cid, killer)
if getPlayerSlotItem(cid, 2) == 2196 then
        doSetCreatureDropLoot(cid, 0)
    end 
end

2196 -> Broken amulet
(cid, 2) -> Necklace slot

I tried to do like that, had no error or anything, but the amulet didn't work.
 
I get errors;
PHP:
Error_ [CreatureEvent::configureEvent] No valid type for creature event.preparedeath
PHP:
[Warning - BaseEvents::loadFromXml] Can not configure event
Hmm?
 
Back
Top