• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Item on Advance

xTremoxx

domasturb(cid, genital)
Joined
Aug 11, 2007
Messages
418
Reaction score
6
Location
Brazil
Plx anybody make one script me ?

example:

When player get up lvl 50 add one item in bag in arrow slot...
When player get up lvl 60 add one item in bag in arrow slot...
When player get blá blá blá ....

obs: player already have bag in arrow slot, because in my server when you create character add automatic one bag in arrow slot, and player cant move this bag...

obs2: with msg when player get up example "Congratulations you level is 50 and you get new item in you bag (arrow slot).

please script with tables for future i add new levels and items.

example table:

{
level="50" reward="2551" msg="Congratulations blá blá";
level="60" reward="2551" msg="Congratulations blá blá"
}

please help i need it so much, thanks ! my server is tfs 0.3.6pl1
 
Last edited:
ops i forgot, one for vocation.

one script for paladin & royal paladin
one script for sorcerer & master sorcerer
etc etc~~~~

tkssssssssssssssssss
 
LUA:
local config = 
		{
			[50] = {
					reward = 1234, count = 1
					},
			[60] = {
					reward = 2345, count = 2
					}
		}

function onAdvance(cid, skill, oldlevel, newlevel)
	local level = config[getPlayerLevel(cid)]
	if skill == SKILL__LEVEL and newlevel == level then
		doPlayerAddItem(cid, level.reward, level.count)
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Congratulations you level is "..level.." and you get a new item: "..getItemNameById(level.reward).." ir your bag.")
	end
	return true
end
 
LUA:
local config = 
		{
			[50] = {
					reward = 1234, count = 1
					},
			[60] = {
					reward = 2345, count = 2
					}
		}

function onAdvance(cid, skill, oldlevel, newlevel)
	local level = config[getPlayerLevel(cid)]
	if skill == SKILL__LEVEL and newlevel == level then
		doPlayerAddItem(cid, level.reward, level.count)
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Congratulations you level is "..level.." and you get a new item: "..getItemNameById(level.reward).." ir your bag.")
	end
	return true
end

Thankkkkkkks so much, but you can separe separated by vocation and item go to arrow slot ? plx plx plx thanks so much :wub: S2
 
I don't know shorter way to do it :/
LUA:
function onAdvance(cid, skill, oldlevel, newlevel)
	if isSorc(cid) then
	config = {
		[50] = {reward = 1234, count = 1},
        [60] = {reward = 2345, count = 2}
             }
	elseif isDruid(cid) then
	config = {
            [50] = {reward = 1234, count = 1},
            [60] = {reward = 2345, count = 2}
             }
	elseif isPaladin(cid) then
	config = {
            [50] = {reward = 1234, count = 1},
            [60] = {reward = 2345, count = 2}
              }
	elseif isKnight(cid) then
	config = {
            [50] = {reward = 1234, count = 1},
            [60] = {reward = 2345, count = 2}
             }
	end
	local level = config[getPlayerLevel(cid)]
		if skill == SKILL__LEVEL and newlevel >= level then
            doPlayerAddItem(cid, level.reward, level.count)
            doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Congratulations your level is "..level.." and you get a new item: "..getItemNameById(level.reward).." in your bag.")
        end
    return true
end
 
I don't know shorter way to do it :/
LUA:
function onAdvance(cid, skill, oldlevel, newlevel)
	if isSorc(cid) then
	config = {
		[50] = {reward = 1234, count = 1},
        [60] = {reward = 2345, count = 2}
             }
	elseif isDruid(cid) then
	config = {
            [50] = {reward = 1234, count = 1},
            [60] = {reward = 2345, count = 2}
             }
	elseif isPaladin(cid) then
	config = {
            [50] = {reward = 1234, count = 1},
            [60] = {reward = 2345, count = 2}
              }
	elseif isKnight(cid) then
	config = {
            [50] = {reward = 1234, count = 1},
            [60] = {reward = 2345, count = 2}
             }
	end
	local level = config[getPlayerLevel(cid)]
		if skill == SKILL__LEVEL and newlevel >= level then
            doPlayerAddItem(cid, level.reward, level.count)
            doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Congratulations your level is "..level.." and you get a new item: "..getItemNameById(level.reward).." in your bag.")
        end
    return true
end

Ok, i'm in my work no ... when i go to my home i try ... if work i rep you, but thank so much !!!! :wub:
 
Just make a config for all items like
LUA:
local config = {
knightitem1 = 1111,
knightitem2 = 2222
}
Instead of a config in EVERY check. Because it'll probably fuck up. Also make it LOCAL config, not global.
 
Back
Top