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

Requesting a Script:S Help please!!

norse123

Member
Joined
Jun 26, 2010
Messages
1,193
Reaction score
19
Hey,
Can someone post a link where i can find a script, the script looks like this
When u reach lvl 50 for example, then it pop up a message and it stays You have received 10cc. Then he gets the cc, then at lvl 100 he get 40cc for example

Could someone create this script because ive been searching on otland and i didnt find it:S
Sorry for my bad english:p
Regards,
Norse
 
Creaturescripts.xml add
Code:
	<event type="advance" name="AdvanceGain" event="script" value="advancegain.lua"/>
login.lua add
Code:
registerCreatureEvent(cid, "AdvanceGain")
advancegain.lua
Lua:
local level = 50
local level2 = 100
function onAdvance(cid, skill, oldLevel, newLevel)
if getPlayerLevel(cid) >= level then
	if getPlayerStorageValue(cid,2333) == -1 then
	doPlayerPopupFYI(cid, "You have received 10cc for advancing to level 50.")
	doPlayerAddItem(cid,2160,10)
	setPlayerStorageValue(cid,2333,1)
	end
elseif getPlayerLevel(cid) >= level2 then
	if getPlayerStorageValue(cid,2334) == -1 then
	doPlayerPopupFYI(cid, "You have received 40cc for advancing to level 100.")
	doPlayerAddItem(cid,2160,40)
	setPlayerStorageValue(cid,2334,1)
	end
end
return 1
end
Rep++
 
I think that script works for all advances (including skills)

try this..

Lua:
local level =
{
	[50] = {money = 10000, storage = 6501},
	[100] = {money = 40000, storage = 6502}
}
function onAdvance(cid, skill, oldLevel, newLevel)

	if(skill == SKILL__LEVEL) then
		for lvl, p in ipairs(level) do
			if getPlayerLevel(cid) >= lvl then
				if(getCreatureStorage(cid, p.storage) < 1) then
					doPlayerAddMoney(cid, p.money)
					doPlayerPopupFYI(cid, "You have received " .. p.money / 1000 .. "cc for reaching the level " .. lvl .. ".")
					doCreatureSetStorage(cid, p.storage, 1)
				end
			end
		end
	end
	return true
end
 
Back
Top