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

Lua Mass /m effect. (/mm "Monster")

demon47

New Member
Joined
Dec 11, 2012
Messages
59
Reaction score
2
Location
Belgium
Hey guys, somebody have/know a script that if you say: /mm demon, for example that u get a mass affect from demons on 4x4 size.
Rep++
Thanks :)
 
Haha have no ide if it will work, but give it a try ;)
Code:
function onSay(cid, words, param, channel)
    local funcc = doCreateMonster
    if(words:sub(2, 2) == "n") then
        func = doCreateNpc
    end

    local pid, t = cid, string.explode(param, ",")
    if(t[2]) then
        pid = getPlayerByNameWildcard(t[2])
        if(not pid) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.")
            return true
        end
    end

    local position, effect = getCreaturePosition(pid), CONST_ME_MAGIC_RED
    errors(false)
    local ret = func(t[1], position)
    errors(true)

    local position, effect = getCreaturePosition(pid), CONST_ME_MAGIC_RED
    errors(false)
    local ret = funcc(t[1], position)
    errors(true)
 
    local position, effect = getCreaturePosition(pid), CONST_ME_MAGIC_RED
    errors(false)
    local ret = funcc(t[1], position)
    local ret = funcc(t[1], position)
    local ret = funcc(t[1], position)
    local ret = funcc(t[1], position)
    local ret = funcc(t[1], position)
    local ret = funcc(t[1], position) 
    local ret = funcc(t[1], position)
    local ret = funcc(t[1], position) 
    errors(true) 

    if(tonumber(ret) == nil) then
        effect = CONST_ME_POFF
        doPlayerSendDefaultCancel(cid, (not ret and RETURNVALUE_NOTPOSSIBLE or RETURNVALUE_NOTENOUGHROOM))
    end

    doSendMagicEffect(position, effect)
    return true
end

Will spawn 8 monsters local ret = func(t[1], position)
 
no :/ doesn't work it says: SQLITE ERROR: no such table: player_stateme INSERT INTO "player_statements" <"player_id", "channel_id", "text", date"> ES <4, 0 '/mm demon', 1384116697>>
in my console, no idea what this is :p
 
Give this a try then
Code:
function onSay(cid, words, param, channel)
local k, v, p = string.explode(param, ","), doCreateMonster, getCreaturePosition(cid)
    if(not isPlayer(cid)) then
        return true
    end
    if(isPlayer(cid) and k[1]) then
        v(cid,k[1],position)
        v(cid,k[1],position)
        v(cid,k[1],position)
        v(cid,k[1],position)
        v(cid,k[1],position)
        v(cid,k[1],position)
        v(cid,k[1],position)
        v(cid,k[1],position)
    end
    if(not v) then
        print("Fail...")
    return true
    end
return true
end
WibbenZ
 
Last edited:
Code:
function onSay(cid, words, param, channel)

     local t = string.explode(param, ",")
     local count = tonumber(t[2])
     if(not count or count < 1) then
         count = 15
     end

     local fromPos, toPos = {x = getCreaturePosition(cid).x -1, y = getCreaturePosition(cid).y -1}, {x = getCreaturePosition(cid).x +2, y = getCreaturePosition(cid).y +2}

     local n = 0
     local effect = CONST_ME_MAGIC_RED
     for x = fromPos.x, toPos.x do
         for y = fromPos.y, toPos.y do
             position = {x = x, y = y, z = getCreaturePosition(cid).z}
             if(not isInRange(getCreaturePosition(cid), position, position)) then
                 if(n < count) then
                     n = n + 1
                     local ret = doCreateMonster(t[1], position, false)
                     if(tonumber(ret) == nil) then
                         n = n - 1
                         effect = CONST_ME_POFF
                         doPlayerSendDefaultCancel(cid, (ret == false and RETURNVALUE_NOTPOSSIBLE or RETURNVALUE_NOTENOUGHROOM))
                     end
                 end
             end
         end
     end
     doSendMagicEffect(getCreaturePosition(cid), effect)
     return true
end

With "/mm monstername" it will create max amount, which is 15 atm.
With count, for example: "/mm monstername, 10", it will create 10 monsters instead of max.
You can change the max amount by changing the 1 and 2 in local fromPos, toPos (and the 15 in count = 15).
 
Back
Top