• 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 Is this scrpit correct?

guigui768

New Member
Joined
Oct 11, 2010
Messages
81
Reaction score
1
Well..I have this scrpit that works like that: The player use the item,that is in the scrpit,and his experience will be like 3x,and after one hour it came back to the normal...
I would like,that you guys ,could check this scrpit for me and tell me if is working fine..And if possible i'd like too that you pass me this same scrpit,But only Premium Accounts could use the item..
Thanks

function onUse(cid, item, frompos, item2, topos)
local pausa = 120*60*1000 -- (1000 = 1 segundos) Tempo que o script durará
local texto = "You have 3 times more experience for 60 minutes, do not logout or else you will loose the bonus."
textofinal = "Your bonus time is gone." -- Texto que irá receber quando o efeito da potion acabar.
local exp = 3.0 -- O quanto que você quer que dobre sua experiencia, por exemplo 2 é 2x as rates do seu server.
expfinal = 1 --Não mude, isso é para a experiencia voltar ao normal.
if item.itemid == 6527 then
doRemoveItem(item.uid,1)
doPlayerSetExperienceRate(cid,exp)
doSendMagicEffect(frompos,13)
doPlayerSendTextMessage(cid,22,texto)
addEvent(potion,pausa,cid)
end
end

function potion(pos, cid)
doPlayerSetExperienceRate(pos,expfinal)
doPlayerSendTextMessage(pos,22,textofinal)
end
 
Take

LUA:
function onUse(cid, item, frompos, item2, topos)
local pausa = 120*60*1000 -- (1000 = 1 segundos) Tempo que o script durará
local texto = "You have 3 times more experience for 60 minutes, do not logout or else you will loose the bonus."
textofinal = "Your bonus time is gone." -- Texto que irá receber quando o efeito da potion acabar.
local exp = 3.0 -- O quanto que você quer que dobre sua experiencia, por exemplo 2 é 2x as rates do seu server.
expfinal = 1 --Não mude, isso é para a experiencia voltar ao normal.

	if not(isPremium(cid)) then
		doPlayerSendTextMessage(cid, 22, "You need premium account to use this potion")
	else
		doRemoveItem(item.uid,1)
		doPlayerSetExperienceRate(cid,exp)
		doSendMagicEffect(frompos,13)
		doPlayerSendTextMessage(cid,22,texto)
		addEvent(potion,pausa,cid)
	end
end

function potion(pos, cid)
	doPlayerSetExperienceRate(pos,expfinal)
	doPlayerSendTextMessage(pos,22,textofinal)
end
 
Back
Top