• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Another noob request!!

Snow

New Member
Joined
Jan 16, 2008
Messages
381
Reaction score
0
I wanted a script where these new items give exp if u "use" them...

A simple script in which each item give a certain exp and I can add a lot of items....
just do an example no need to use item ids..

Thanks :)
 
You didn't understand my request....
I want 1 script that's easy to edit so I can add all the new items each giving a certain exp..
 
Ahm...

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
		
if getPlayerStorageValue(cid,1302) == 2 then
			doCreatureSay(cid, "You can only use this scroll once!", TALKTYPE_ORANGE_1)

	else if getPlayerLevel(cid) >= 8 then
		doCreatureSay(cid, "You Gained 40 000 000 Experience Points!", TALKTYPE_ORANGE_1)
			doPlayerAddExp(cid, [B][COLOR="Red"]JUST CHANGE THE EXP YOU WANT TO ADD HERE[/COLOR][/B])
			doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
			doRemoveItem(item.uid)
			setPlayerStorageValue(cid,1302,0)
			return TRUE
		else
					doCreatureSay(cid, "You must be over level 8 to use this scroll", TALKTYPE_ORANGE_1)
		end
end
end

next you add in actions.xml

<action itemid="ITEM YOU WANT TO GIVE THE EXP" script="quests/exp scroll.lua"/>
<action itemid="ITEM YOU WANT TO GIVE THE EXP" script="quests/exp scroll.lua"/>
<action itemid="ITEM YOU WANT TO GIVE THE EXP" script="quests/exp scroll.lua"/>

And if you want to make another with another exp, just make a copy of the first one and change the name and exp...

Example:


Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
		
if getPlayerStorageValue(cid,1302) == 2 then
			doCreatureSay(cid, "You can only use this scroll once!", TALKTYPE_ORANGE_1)

	else if getPlayerLevel(cid) >= 8 then
		doCreatureSay(cid, "You Gained 1000 Experience Points!", TALKTYPE_ORANGE_1)
			doPlayerAddExp(cid, [B][COLOR="Red"]JUST CHANGE THE EXP YOU WANT TO ADD HERE[/COLOR][/B])
			doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
			doRemoveItem(item.uid)
			setPlayerStorageValue(cid,1302,0)
			return TRUE
		else
					doCreatureSay(cid, "You must be over level 8 to use this scroll", TALKTYPE_ORANGE_1)
		end
end
end

Code:
<action itemid="[B][COLOR="Red"]ITEM YOU WANT TO GIVE THE EXP[/COLOR][/B]" script="quests/exp scroll[COLOR="Red"][B]2[/B][/COLOR].lua"/>

Hope it works.. :/

and I DON'T MAKE THAT SCRIPT i just edit it from here:

http://otland.net/f81/exp-scroll-28325/

Greetings
 
why storage value?
I want players being able to use them all the time.....and I want to make them all in 1 script not making 100000 of scripts

:)
 
why storage value?
I want players being able to use them all the time.....and I want to make them all in 1 script not making 100000 of scripts

:)

I don't know i don't make that script.. but read it right.. i disable the storage value:

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
		
if getPlayerStorageValue(cid,1302) == 2 then
			doCreatureSay(cid, "You can only use this scroll once!", TALKTYPE_ORANGE_1)

	else if getPlayerLevel(cid) >= 8 then
		doCreatureSay(cid, "You Gained 1000 Experience Points!", TALKTYPE_ORANGE_1)
			doPlayerAddExp(cid, JUST CHANGE THE EXP YOU WANT TO ADD HERE)
			doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
			doRemoveItem(item.uid)
			[SIZE="4"][COLOR="Red"][B]setPlayerStorageValue(cid,1302,0)[/B][/COLOR][/SIZE]
			return TRUE
		else
					doCreatureSay(cid, "You must be over level 8 to use this scroll", TALKTYPE_ORANGE_1)
		end
end
end

the storage will be 0 and it blocks when u have 1302 at two...

:)

That's all i can do for you, because i don't know how to put "1 million of script" in one :P
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cfg = {
		[XXXX] = { level = 10, exp = 10000 },
		[XXXX] = { level = 10, exp = 10000 }
	}
	if(getPlayerLevel(cid) >= cfg[item.itemid].level) then
		doCreatureSay(cid, "You recieved " .. cfg[item.itemid].exp .. " experience.")
		doPlayerAddExperience(cid, cfg[item.itemid].exp)
		doRemoveItem(item.uid)
	else
		doPlayerSendCancel(cid, "Your level is not high enough.")
	end
	return true
end


There's just 2 problems :(

I needed the msg to be in orange and the item I want is stackable, if I "use" 100 of the item I'll get the exp of using 1 and they'll all dissapear ;(
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cfg = {
		[XXXX] = { level = 10, exp = 10000 },
		[XXXX] = { level = 10, exp = 10000 }
	}
	if(getPlayerLevel(cid) >= cfg[item.itemid].level) then
		doCreatureSay(cid, "You recieved " .. cfg[item.itemid].exp .. " experience.", TALKTYPE_ORANGE_1)
		doPlayerAddExperience(cid, cfg[item.itemid].exp)
		doRemoveItem(item.uid, 1)
	else
		doPlayerSendCancel(cid, "Your level is not high enough.")
	end
	return true
end
 
Back
Top