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

Item to summon monster scaling on level

Simonthe

New Member
Joined
Jun 16, 2009
Messages
10
Reaction score
0
can anyone help me make like if i have a stone i right klick it in lvl 8 i get rotworm 50 a hero 100 demon or something like that so its a pk helper
 
an easy script i wrote in ~1 minute xD
Havent tested it tough
only bug should be u get to summon infinite creatures so either make the item dissapear 'doRemoveItem(item.uid,1)' or set an exhoust function

PHP:
function onUse(cid, item, frompos, item2, topos)
herolevel = 50
demonlevel = 100
if getPlayerLevel(cid) < herolevel then
local monster = doSummonCreature("Rotworm", getCreaturePosition(cid))
doConvinceCreature(cid, monster)
elseif getPlayerLevel(cid) >= herolevel and getPlayerLevel(cid) < demonlevel then
local monster = doSummonCreature("Hero", getCreaturePosition(cid))
doConvinceCreature(cid, monster)
elseif getPlayerLevel(cid) >= demonlevel then
local monster = doSummonCreature("Demon", getCreaturePosition(cid))
doConvinceCreature(cid, monster)
else
end
return 1
end
 
Last edited:
Care to share what server you are using?

This should work with TFS 0.3 or later:

Lua:
local t = {
	[{8, 49}] = "bear",
	[{50, 99}] = "hero",
	[{100, 149}] = "demon",
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	for v, k in pairs(t) do
		if(isInArray(v, getPlayerLevel(cid))) then
			doCreateMonster(k, getCreaturePosition(cid))
			doConvinceCreature(cid, k)
			
			-- The following can be used if you wish to remove the creature after X minute(s), if not killed.
			--[[  local monster = doCreateMonster(k, getCreaturePosition(cid))  ]]--
			--[[  addEvent(doRemoveCreature, 1 * 60 * 1000, monster) ]]--
		end
	end
	return true
end
 
Last edited:
Back
Top