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

Action Addon Scroll!

Zonet

Web Developer
Joined
Sep 1, 2008
Messages
4,393
Reaction score
52
Location
Tibia VS RL-life, guess whos back?
This is my first script i made!

This is a addon scroll script.
also you get addon by simply click on a item!

If you are using a donation server you can make this item so player can buy addons with Gesiors shop.

Here is it.

First go to data/action/scripts[ Create script, name it addon.lua
Now open the script and add this.


Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
		
if getPlayerStorageValue(cid,1800) == 10 then
			doCreatureSay(cid, "You already got the second addon", TALKTYPE_ORANGE_1)

	else if getPlayerLevel(cid) >= 10 then
		doCreatureSay(cid, "You received the first addon and the second addon, Thanks for buying.", TALKTYPE_ORANGE_1)
			doPlayerAddAddons(cid, 3)
			doSendMagicEffect(fromPosition, 37)
			doRemoveItem(item.uid)
			setPlayerStorageValue(cid,1800,20)
			return TRUE
		else
					doCreatureSay(cid, "You must be level 10 to get the second addon", TALKTYPE_ORANGE_1)
		end
end
end
Code:
doPlayerAddAddons(cid, 3) <--- this means which addon player should get
3=both 1=first 2=second 
also if you want the player use the scroll one time then 
change the setPlayerStorageValue(cid,1800,20) to setPlayerStorageValue(cid,1800,10)

Now go to data/action/action.xml

Under:
Code:
<actions>

Add:
Code:
	<action itemid="6527" script="addon.lua"/>

<action itemid="6527" <--- this id is the id of the scroll... you can change to the item you want the scroll be...


Thank you, dont forget this is only my first script.
 
I like of addons...
Look my script:
Code:
 local female = 0
 local male = 1

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerSex(cid) == female then
	if getPlayerStorageValue(cid, 16344) == TRUE then
	   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but you already have this addon.")
	 elseif getPlayerStorageValue(cid, 16344) == FALSE then
	   doPlayerAddOutfit(cid, 136, 1)
	   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, you received the first 'citizen' addon.")
	   doRemoveItem(item.uid)
	   setPlayerStorageValue(cid, 16344, TRUE)

	 elseif getPlayerSex(cid) == male then
	if getPlayerStorageValue(cid, 16344) == TRUE then
	   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but you already have this addon.")
	 elseif getPlayerStorageValue(cid, 16344) == FALSE then
	   doPlayerAddOutfit(cid, 128, 1)
	   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, you received the first 'citizen' addon.")
	   doRemoveItem(item.uid)
	   setPlayerStorageValue(cid, 16344, TRUE)
  end
 end
  return TRUE
end
 
I make this script based in your script
but I have 1 problem, after logout character the addon no save
the character need use a new scroll for addon =/

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
		
if getPlayerStorageValue(cid,1800) == 10 then
			doCreatureSay(cid, "You already got the first addon", TALKTYPE_ORANGE_1)

	else if getPlayerLevel(cid) >= 10 then
		doCreatureSay(cid, "You received the first addon Demon Hunter.", TALKTYPE_ORANGE_1)
			doPlayerAddOutfit(cid, 289, 1)
                        doPlayerAddOutfit(cid, 288, 1)
			doSendMagicEffect(fromPosition, 37)
			doRemoveItem(item.uid)
			setPlayerStorageValue(cid,1800,20)
			return TRUE
		else
					doCreatureSay(cid, "You must be level 10 to get the second addon", TALKTYPE_ORANGE_1)
		end
end
end


Help :p
 
not too bad... u can remove an end by writing elseif instead of else if..

my version:
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pos = getCreaturePosition(cid)	
	if getPlayerStorageValue(cid, 1800) == TRUE then
			doCreatureSay(cid, "You have already used this scroll.", TALKTYPE_ORANGE_1)
	else
		doCreatureSay(cid, "You received the first addon and the second addon!", TALKTYPE_ORANGE_1)
		doSendAnimatedText(pos, "Addons!", math.random(1, 215))
		doPlayerAddAddons(cid, 3)
		setPlayerStorageValue(cid, 1800, TRUE)
		doRemoveItem(item.uid)
		for i=1,30 do
			doSendDistanceShoot(pos, {x = pos.x + math.random(-7, 7), y = pos.y + math.random(-5, 5), z = pos.z}, 4)
		end
	end
	return TRUE
end

dunno why you had level checker... probably cuz u took the basics from 1337 scroll scripts and changed the function lol :p
 
Ehmm, if your not working which is based on my.. why not just using my ?

:$

I only use scroll for addons of demon hunter outfit
no use for alls
I make quest of demon hunter addon =P
but why no save ? :(
 
It should be like this instead of
change to:

Yeah Im make this:

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
		
if getPlayerStorageValue(cid,1800) == 10 then
			doCreatureSay(cid, "You already got the first addon", TALKTYPE_ORANGE_1)

	else if getPlayerLevel(cid) >= 10 then
		doCreatureSay(cid, "You received the first addon Demon Hunter.", TALKTYPE_ORANGE_1)
			doPlayerAddOutfit(cid, 289, 1)
                        doPlayerAddOutfit(cid, 288, 1)
			doSendMagicEffect(fromPosition, 37)
			doRemoveItem(item.uid)
			setPlayerStorageValue(cid,1800,20)
			return TRUE
		else
					doCreatureSay(cid, "You must be level 10 to get the second addon", TALKTYPE_ORANGE_1)
		end
end
end

But if the player logout the addons delete
addons no save
 
@up,
make another file...

@topic,
This will work with [7.6] Avesta?
I was told its based off of tfs.
 
Btw, its good if adding "doremoveitem" or else the player can just send it around after use.
 
take :p

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)

if getPlayerStorageValue(cid,1800) == 10 then
doCreatureSay(cid, "You already got the addons", TALKTYPE_ORANGE_1)

else if getPlayerLevel(cid) >= 0 then
doCreatureSay(cid, "Felicidades has obtenido los addons de Demon Hunter.", TALKTYPE_ORANGE_1)
doPlayerAddOutfit(cid, 289, 2)
doPlayerAddOutfit(cid, 288, 2)
doPlayerAddOutfit(cid, 289, 1)
doPlayerAddOutfit(cid, 288, 1)
setPlayerStorageValue(cid,demon,2)
doSendMagicEffect(fromPosition, 37)
doRemoveItem(item.uid)
setPlayerStorageValue(cid,1800,20)
return TRUE
else
end
end
end
 
Back
Top