• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Crystal coin chest, need lvl to use it!

Cornex

Web Developer
Staff member
Global Moderator
Joined
Jun 15, 2008
Messages
3,444
Solutions
5
Reaction score
1,166
Location
Sweden
Hiho, i just write an script for quest chests.

You need an certain lvl to take the chest, i are sure it is simple or already released here. But i just post it anyway, maybe someone got use for it :)

NOTE: That script is not tested!

Lua:
local config ={
level = 250, -- level to take the chest
storage = 58107, -- storage
alreadydonemsg = "You have already done this quest.", -- What message to say if you already done this quest!
tolowlevelmsg = "You need level 250 to take this chest!", -- What message to say if you are to low level!
donemsg = "You have found 100 crystal coins.", -- What message to say if you take the chest!
qnt = 100, -- How much crystal coins you will get in the chest!
itemid = 2160 -- Item Id of crystal coin.
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid, config.storage) == 1 then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,config.alreadydonemsg)
	elseif getPlayerLevel(cid) >= config.level then
		setPlayerStorageValue(cid, config.storage, 1)
		doPlayerAddItem(cid, config.itemid, config.qnt)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,config.donemsg)
	elseif getPlayerLevel(cid) < config.level then
	        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,config.tolowlevelmsg)
	end
	return TRUE
end
 
Last edited:
Cool, i'm glad that you're sharing the scripts to the community! :)
 
bugged, you will not recive ur prize at certain level (ex: 250 at ur script)
need to change this:
Lua:
elseif getPlayerLevel(cid) > config.level then

to this
Lua:
elseif getPlayerLevel(cid) >= config.level then
 
bugged, you will not recive ur prize at certain level (ex: 250 at ur script)
need to change this:
Lua:
elseif getPlayerLevel(cid) > config.level then

to this
Lua:
elseif getPlayerLevel(cid) >= config.level then


Lol, it is not an "bugg" -.-.. Just forgot that shit haha, updated main post. Thanks =)
 
Back
Top Bottom