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

Spawn Hunt

Fiester

New Member
Joined
Aug 30, 2022
Messages
22
Reaction score
2
Hey guys i got problem with any script, now i can spawn only 1 mobs how to make more mobs?
Lua:
local config = {
wejscie = {
time = 7, --w sekundach
storage = 1234 --storage zapisujace czas
},
[8001] = {tps={'x',1}, czas_expa = 10, wielkosc_pokoju = {6,6}, centrum_pokoju = {x=227,y=109,z=7},
id={}, czas=1, mon='Dragon', p= {x=225,y=107,z=7}}, --od lewej - wielkosc pokoju w sqm (pozycje 'x', pozycje 'y'), pozycje centrum pokoju, ile trzeba odczeka? do kolejnego summona, nazwa moba, pozycja summona
}
function onStepIn(cid, item, pos, frompos, topos)
local v = config[item.actionid]
if v then
if item.itemid == 1387 then
local m, s, x = '', getSpectators(config[item.actionid].centrum_pokoju, config[item.actionid].wielkosc_pokoju[1], config[item.actionid].wielkosc_pokoju[2]), 0
if os.time() < getPlayerStorageValue(cid, config.wejscie.storage) then
return doTeleportThing(cid, frompos) and doCreatureSay(cid, 'Nie mozesz wejsc na arene jeszcze przez '..getPlayerStorageValue(cid, config.wejscie.storage) - os.time()..' sekund.', TALKTYPE_ORANGE )
end
if s ~= nil then
for i = 1, #s do
if isPlayer(s[i]) then
doTeleportThing(cid, frompos)
return doCreatureSay(cid, 'Kto? znajduje sie w pokoju!', TALKTYPE_ORANGE )
elseif getCreatureName(s[i]):lower() == v.mon:lower() then
doRemoveThing(s[i])
end
end
end
if #v.id > 1 then
for i = 1, #v.id/2 do
x = (getPlayerItemCount(cid, v.id[i*2-1]) >= v.id[i*2] and x + 1 or x)
m = m .. getItemNameById(v.id[i*2-1]) .. (i < #v.id/2 and ' ' or '.')
end
end
if x == #v.id/2 then
for i = 1, #v.id/2 do
doPlayerRemoveItem(cid, v.id[i*2-1], v.id[i*2])
end
doPlayerSetStorageValue(cid, config.wejscie.storage, os.time() + v.czas)
local poss = ('_'..frompos.x + (v.tps[1] == 'x' and v.tps[2] or 0)..'_'..frompos.y + (v.tps[1] == 'y' and v.tps[2] or 0)..'_'..frompos.z)
doPlayerSetStorageValue(cid, config.wejscie.storage+1, poss)
doCreateMonster(v.mon, v.p)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, 'Za '..v.czas_expa..' minut zostaniesz wyrzucony z expa.')
doTeleportThing(cid, v.centrum_pokoju)
return addEvent(function()
if isPlayer(cid) and getPlayerStorageValue(cid, config.wejscie.storage+1) ~= -1 then
doTeleportThing(cid, frompos)
doPlayerSetStorageValue(cid, config.wejscie.storage+1, -1)
doPlayerSetStorageValue(cid, config.wejscie.storage-1, -1)
end end,
v.czas_expa * 60 * 1000,
cid, frompos, config, item.actionid)
end
doTeleportThing(cid, frompos)
return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Nie masz wystarczaj?co du?o '..m)
elseif item.itemid == 5023 then
local l = getPlayerStorageValue(cid, config.wejscie.storage+1):explode('_')
doTeleportThing(cid, {x=l[2],y=l[3],z=l[4]})
doPlayerSetStorageValue(cid, config.wejscie.storage, os.time() + config.wejscie.time)
return doPlayerSetStorageValue(cid, config.wejscie.storage+1, -1)
end
if os.time() < getPlayerStorageValue(cid, config.wejscie.storage) then
return doPlayerSendCancel(cid, 'Nie mo?esz przywo?a? kolejnego potwora jeszcze przez '..getPlayerStorageValue(cid,config.wejscie.storage)-os.time()..' sekund.')
end
local s = getSpectators(v.centrum_pokoju, v.wielkosc_pokoju[1], v.wielkosc_pokoju[2])
if s ~= nil then
for i = 1, #s do
if getCreatureName(s[i]):lower() == v.mon:lower() then
return doPlayerSendCancel(cid, 'Musisz zabi? poprzednio stworzonego potwora ('..v.mon:lower()..') by wezwa? kolejnego.')
end
end
end
doPlayerSetStorageValue(cid, config.wejscie.storage, os.time() + v.czas)
return doCreateMonster(v.mon, v.p)
end
return true
end
 
Last edited:

You didn't display your code properly, so it's impossible to read it.
 
Back
Top