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

Training

enriel

Big L
Joined
Dec 14, 2007
Messages
1,254
Reaction score
2
Location
Montenegro
Anyone that can make a script like,
if you use !summonmonk it will take a item and summon a monk for 24hours?
 
OOH r0x, let me guess, shop? ;d It isn't a hard script to make, to bad I go sleep now=( I will make it for you when I'm out of school tommorow(if someone else didnt make it before me:p)
 
This is as far as I could get. I failed on a proper check for summoning and desummoning the monster. I don't know if this script works at all, hehe.

PHP:
function onSay(cid, words, param)

local pos 		= getPlayerPosition(cid)
local summonPos = {x=pos.x+1,y=pos.y,z=pos.z, stackpos=STACKPOS_TOP_CREATURE}
local item 		= XXXX
local timer		= 60*60*24

	if getPlayerItemCount(cid, XXXX) >= 1 then

		doPlayerRemoveItem(cid, XXXX, 1)
		doSummonCreature("monk", summonPos)
		local summon = getThingfromPos(summonPos)
		addEvent(removeSummon, timer*1000)
		return TRUE
		
	else
	
		doPlayerSendCancel(cid, 22, "Sorry, you do not have the required item.")
		return 1
		
	end
	
end

function removeSummon()

local pos 		= getPlayerPosition(cid)

	for areax = pos.x-2, pos.x+2 do
		for areay = pos.y-2, pos.y+2 do
		areapos 			= {x=areax, y=areay, z=pos.z, stackpos=STACKPOS_TOP_CREATURE}
		local summon		= getThingfromPos(areapos)
					
			if isMonster(summon) == TRUE then
						
				doRemoveCreature(summon.uid, 1)
							
			end
						
		end
					
	end
	
end
 
@up, he can stand where he wants and if ots crash he gets it again, like a timer. Don't know really how to explain but.. if he use !trainer he gets a monk that is spawned for about 2h or something like that, thanks for helping both
 
This is as far as I could get. I failed on a proper check for summoning and desummoning the monster. I don't know if this script works at all, hehe.

PHP:
function onSay(cid, words, param)

local pos 		= getPlayerPosition(cid)
local summonPos = {x=pos.x+1,y=pos.y,z=pos.z, stackpos=STACKPOS_TOP_CREATURE}
local item 		= XXXX
local timer		= 60*60*24

	if getPlayerItemCount(cid, XXXX) >= 1 then

		doPlayerRemoveItem(cid, XXXX, 1)
		doSummonCreature("monk", summonPos)
		local summon = getThingfromPos(summonPos)
		addEvent(removeSummon, timer*1000)
		return TRUE
		
	else
	
		doPlayerSendCancel(cid, 22, "Sorry, you do not have the required item.")
		return 1
		
	end
	
end

function removeSummon()

local pos 		= getPlayerPosition(cid)

	for areax = pos.x-2, pos.x+2 do
		for areay = pos.y-2, pos.y+2 do
		areapos 			= {x=areax, y=areay, z=pos.z, stackpos=STACKPOS_TOP_CREATURE}
		local summon		= getThingfromPos(areapos)
					
			if isMonster(summon) == TRUE then
						
				doRemoveCreature(summon.uid, 1)
							
			end
						
		end
					
	end
	
end

It works, it gives you a monk but I'm not sure about the things you said btw, is there a way to check if it's protection zone etc.
 
Did you test if my script removes the monk after the time has passed. Set the time to 20 seconds or something and see if the monk disappears after 20 seconds.

I was not sure if this part would work correctly as I did not testrun the script. I'm sure it has some flaws.
 
If the player is offline, the addEvent will be executed and cause an error on the console? With my other script it happened.
 
Back
Top