• 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 Help with this script!

Epic

Banned User
Joined
Mar 30, 2009
Messages
1,142
Reaction score
1
Location
Barcelona (Spain)
Code:
  --[[
    Summon monster with Item
    - by Shawak
]]--

function onUse(cid, item, fromPosition, itemEx, toPosition)

local config = {
    grounds = {103}, -- ignore it

    monster = "Frost Dragon Hatcling",       -- monster that will be summoned  
    removeItem = 2,          -- "1" or "0" // 1 = yes, 2 = no
    articleOfMonster = "your lovely pet, the",  -- article of the monster // Example: "a" Demon
    }

        if isInArray(config.grounds,itemEx.itemid) == FALSE then
                if getTilePzInfo(fromPosition) == FALSE then
                        if getTilePzInfo(toPossition) == FALSE then
                                if config.removeItem >= 1 then
                                        doRemoveItem(item.uid,1)
                                end
                                doSendMagicEffect(toPosition, 10)
                                doSummonCreature(config.monster, toPosition)
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You summoned "..config.articleOfMonster.." "..config.monster..".")
                        else
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You can't summon your pet in a protection zone.")
                        end
                else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You can't summon your pet while you are in a protection zone.")
                end
        else
                doSendMagicEffect(toPosition, CONST_ME_POFF)
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You can't summon your pet there.")
        end
        return TRUE
end

Can it be to summon Dragon Hatchling, Dragon Lord Hatchling and Frost Dragon Hatchling randomly? And btw, when i use it, it always says "cannot summon creature while you are in a protection zone" and i don't know why. And one last thing, is that monster going to attack with ur like a summon, or i can be like that?

Thanks beforehand!
 
Back
Top