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

Need Script Addons Per Level

rodolfo

New Member
Joined
Jul 30, 2008
Messages
60
Reaction score
1
Exemple: start in level 130, if advance to level 135, have a reward= Citizen outfit!

Help me? Thanks
 
Here We Are :)
in your creaturescripts/creaturescripts.xml paste the following:
XML:
	<event type="advance" name="recompensa" event="script" value="outfitwin.lua"/>

now in your creaturescripts/scripts create file name outfitwin.lua and paste the following:
Lua:
local sirion ={
level = 135, -- level 
storage = 9557, -- storage
msg = "we have added citizen outfit for reaching level 135" -- message when take outfit
outfit = 136, -- the outfit looktype
addons = 3 -- the addon  its now full addon
}
function onAdvance(cid, oldLevel, newLevel)
if getPlayerStorageValue(cid, sirion.storage) < 1 and getPlayerLevel(cid) >= sirion.level then

doPlayerAddOutfit(cid,sirion.outfit, sirion.addons)
setPlayerStorageValue(cid, sirion.storage, 1)
doPlayerSendTextMessage(cid, sirion.msg)
end
return TRUE
end

Rep++ If It Helpful For You
 
Lua:
local t = {
--	[storage], level, outfit, addons
	[1234] = {135, 136, 3} --citizen
}
function onAdvance(cid, skill, oldLevel, newLevel)
	if skill == SKILL__LEVEL then
		for storage, lalala in pairs(t) do
			if newLevel >= lalala[1] and getPlayerStorageValue(cid, storage) < 1 then
				doPlayerAddOutfit(cid, lalala[2], lalala[3])
				setPlayerStorageValue(cid, storage, 1)
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "CONGRATULATIONS! You've reached level " .. lalala[1] .. ".")
				break
			end
		end
	end
	return true
end

i use the base of cyko script, there is a lot of scripts like this so you can search before ask ;)
 
>creaturescripts.xml
XML:
<event type="advance" name="AddonsLevel" event="script" value="level.lua"/>

>scripts/level.lua
Lua:
local t = {
--	[storage], level, outfit, addons
	[1234] = {135, 136, 3} --citizen
}
function onAdvance(cid, skill, oldLevel, newLevel)
	if skill == SKILL__LEVEL then
		for storage, lalala in pairs(t) do
			if newLevel >= lalala[1] and getPlayerStorageValue(cid, storage) < 1 then
				doPlayerAddOutfit(cid, lalala[2], lalala[3])
				setPlayerStorageValue(cid, storage, 1)
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "CONGRATULATIONS! You've reached level " .. lalala[1] .. ".")
				break
			end
		end
	end
	return true
end

>scripts/login.lua
before
Lua:
	return TRUE
end
copy
Lua:
	registerCreatureEvent(cid, "AddonsLevel")
like this
Lua:
	registerCreatureEvent(cid, "AddonsLevel")
	return TRUE
end
 
Back
Top