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

CreatureEvent a Present Script.

Zonet

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

function onLogin(cid)

write.
PHP:
local position = getPlayerPosition(cid)

if isPlayer(cid) == TRUE  and getPlayerStorageValue(cid, 5000,-1) then
doPlayerAddItem(cid, itemid, count)
doSendAnimatedText(position, You received a present, 35)
setPlayerStorageValue(cid, 5000, 1)
end

Not tested i'm newbie at scripting but this should work ;)
Dont forget to replace the item you want in

PHP:
doPlayerAddItem(cid, itemid, count)
itemid = the item you want..
If is a crystal or something else that can have count then just write count = 100 = 100 crystal coin.

Bad english maybe but.. that's how i explain xD;)
 
Last edited:
Could actually put the item in a present box too if you wished.
Here's a 10 second fixer:
PHP:
-- START PRESENT SCRIPT --
		if isPlayer(cid) == TRUE  then
		if getPlayerStorageValue(cid, 5001) == -1 then
		    local present = doPlayerAddItem(cid, 1990, 1)
				doAddContainerItem(present, 2162, 1)
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You received a present!")
				setPlayerStorageValue(cid, 5001, 1) 
			end  
		end
-- END PRESENT SCRIPT --

Give reputation if you please ;)
 
Back
Top