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

Lua HELP Experience RING

GOD Esteve

New Member
Joined
May 18, 2011
Messages
87
Reaction score
1
Code:
local rate = 2.0

function onEquip(cid, item, slot) 
if(item.itemid ~= 6300) then 
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your exp rate + "..((rate - 1)*100).."%.") 
doPlayerSetExperienceRate(cid, rate) 
doTransformItem(item.uid, 6301) 
return TRUE
end 
return TRUE
end 

function onDeEquip(cid, item, slot) 
if(item.itemid ~= 6301) then 
return TRUE
end
doPlayerSetExperienceRate(cid, 1.0) 
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has ended.") 
doTransformItem(item.uid, 6300) 
return TRUE
end

Code:
	<!-- Anel VIP -->
	<movevent type="Equip" itemid="6300" slot="ring" event="function" value="onEquipItem"/>
	<movevent type="Equip" itemid="6301" slot="ring" event="script" value="vipanel.lua"/>
	<movevent type="DeEquip" itemid="6301" slot="ring" event="script" value="vipanel.lua"/>

Code:
	<item id="6300" article="a" name="Experience Ring">
		<attribute key="slotType" value="ring" />
		<attribute key="weight" value="5000" />
		<attribute key="transformEquipTo" value="6301" />
		<attribute key="stopduration" value="1" />
		<attribute key="showduration" value="1" />
	</item>
	<item id="6301" article="a" name="Experience Ring">
		<attribute key="slotType" value="ring" />
		<attribute key="weight" value="5000" />
		<attribute key="transformDeEquipTo" value="6300" />
		<attribute key="decayTo" value="0" />
		<attribute key="duration" value="7200" />
		<attribute key="showduration" value="1" />
	</item>

The ring it's ok!! double xp all right
but have a problem
If i put the ring and after get it aut !! to i put again and works i need log aut =/
can somebody help me plz
with don't understaind tell me
im braziliam no good english

In real server 1.7 works good
but in
TFS 0.4 no =/
 
Shouldn't this
Lua:
if(item.itemid ~= 6300) then
be:
Lua:
if(item.itemid == 6300) then

(idk if it solves your problem but it just might..)

Cuz ~= is IF NOT and == is IF EXACTLY so.. Try it xD :ninja:
 
I Just try it
with i do this when i use ring the msg of xp don't show
and when i get aut ring didn't stop =/

thx but it's not this

if have some other script of exp ring i can accept :)
 
Back
Top