Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function doCreateDemons()
- for i,pos in pairs(demons) do
- if doCreateMonster('Demon', pos) then
- doSendMagicEffect(pos, 10)
- if i == #demons then
- return true
- end
- end
- end
- return false
- end
- function onUse(cid, item, pos, item2, topos)
- local players, demons = {{x=119, y=35, z=9},{x=120, y=35, z=9},{x=121, y=35, z=9},{x=122, y=35, z=9}}, {}
- local config = {
- storage = 23891,
- }
- local pcount = 0
- for i,pos in pairs(players) do
- pos.stackpos = 253
- local pid = getThingFromPos(pos)
- if isPlayer(pid.uid) then
- if getPlayerStorageValue(pid, config.storage) == 1 then
- local name = name or getCreatureName(pid)
- doPlayerSendCancel(pid, name .." has done this quest before.")
- if i == #players then
- return true
- end
- else
- doSendMagicEffect(pos, 12)
- pcount = pcount + 1
- if (i == #players and pcount ~= #players) then doPlayerSendCancel(cid, "Not enough players.") return true end
- end
- local downCenterPos = players[math.ceil(#players / 2)]
- for _,cid in pairs(getSpectators(downCenterPos, 5,5)) do
- if isPlayer(cid) then doPlayerSendCancel(cid, "There is currently a team inside the quest.") return true end
- if isMonster(cid) then doRemoveCreature(cid) end
- end
- local newpos = {x=pos.x,y=pos.y,z=pos.z-1}
- if doTeleportThing(pid, newpos) then
- doSendMagicEffect(newpos, 10)
- if i == #players then
- if doCreateDemons() then
- return true
- end
- end
- end
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement