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

Summon by switch

gilbert123

~Caspin~
Joined
Mar 11, 2011
Messages
98
Reaction score
1
Hey- I have looked around a little for a switch that when pulled summons a monster, for example a demon.
I found a script but it didn't work. If someone could make me one that'd be great :)
 
PHP:
function exhaust(cid, storevalue, exhausttime)
    
    newExhaust = os.time()
    oldExhaust = getPlayerStorageValue(cid, storevalue)
    if (oldExhaust == nil or oldExhaust < 0) then
        oldExhaust = 0
    end
    if (exhausttime == nil or exhausttime < 0) then
        exhausttime = 1
    end
    diffTime = os.difftime(newExhaust, oldExhaust)
    if (diffTime >= exhausttime or diffTime < 0) then
        setPlayerStorageValue(cid, storevalue, newExhaust) 
        return 1
    else
        return 0
    end
end



function onUse(cid, item, frompos, item2, topos)
local config = {
		storevalue = 0,
		exhausttime = 1, 
		newnPosition = {x=1484, y=1450, z=7},

		}

local monster = {
			["Hero"] = {x=5479, y=1449, z=7}
		}

for name, pos in pairs(monster) do


		if (exhaust(cid, config.storevalue, config.exhausttime) == TRUE) then
			if item.itemid == 1945 then
				doSummonCreature(name, pos)
				
				doTransformItem(item.uid,item.itemid+1)
			break

			elseif  item.itemid == 1946 then
				doSummonCreature(name, pos)
				doTransformItem(item.uid,item.itemid-1)
			break

			else
				doPlayerSendCancel(cid,"Sorry,not possible.")
			end
		break
		else
			doPlayerSendCancel(cid,"You Need Wait 2 Second.")
			doSendMagicEffect(getCreaturePosition(cid),CONST_ME_POFF)
			
			
		end
	
end
return TRUE
end
 
If it didnt work its because you're using doSummonCreature, use doCreateMonster.

@Tgyoshi, your script is obviously nothing like what he wants. Doesnt even have exhuast...
 
If it didnt work its because you're using doSummonCreature, use doCreateMonster.

@Tgyoshi, your script is obviously nothing like what he wants. Doesnt even have exhuast...

You obviously should read his post again. He never stated anything about exhausts, or about a maximum of 1 demon etc etc.
If he's too lazy to give a detailed description of what he wants, they shouldn't expect me (or any other script) to just guess what he wants.

That was EXACTLY what he requested. Nothing more, nothing less.
 
You obviously should read his post again. He never stated anything about exhausts, or about a maximum of 1 demon etc etc.
If he's too lazy to give a detailed description of what he wants, they shouldn't expect me (or any other script) to just guess what he wants.

That was EXACTLY what he requested. Nothing more, nothing less.

Based on the current script he gave up you can clearly see what hes looking for. If you cant take some time to look through the whole thread dont bother posting :O
 
Tell me what that script has to do with.. basically any action related script. More likely a script for in the libs..

I've never read that he wants exhaust in it. And I'm not going to guess whether he wants it or not.
 
Back
Top