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

VERY SIMPLE script, actions. REP++

squidy

Member
Joined
May 18, 2009
Messages
508
Reaction score
23
Location
Gorzów Wielkopolski
Hello, I need script:

If someone will use item x, he will summon monster y. But it must be max 1 monster, not more. (In config.lua can be maxSummons = 1)

If someone will do this for me, i will give REP ++ of course :P
 
Code:
local t = {
	name = 'Dragon',
	limit = 1,
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if #getCreatureSummons(cid) < t.limit then
		local ret = doSummonMonster(cid, t.name)
		if ret ~= RETURNVALUE_NOERROR then
			doPlayerSendDefaultCancel(cid, ret)
		end
	else
		doPlayerSendCancel(cid, "You cannot summon more creatures.")
	end
	return true
end
 
Back
Top