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

HUNTING ROOM - problem with spawn monster

tuduras

Member
Joined
Jun 4, 2017
Messages
76
Solutions
1
Reaction score
11
Hello! ;]

I have got the problem, when I stay on special sqm , it could spawn monster. I get it
feedback 15:56 Monsters has been spawned and nothing is happening.
Anyone know what's this.
Here post my code with hunting room:
Code:
    <!-- to jest do tworzenia potworow -->
    <movement type="StepIn" actionid="2860" event="script">
        <![CDATA[
            domodlib("huntingConfig")

            function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
                local monsters, player = false, false
                if isPlayer(cid) then
                    for k, v in pairs(huntingConfig) do
                        if isInRange(getThingPos(cid), v.fromPos, v.toPos) then
                            for x = v.fromPos.x, v.toPos.x do
                                for y = v.fromPos.y, v.toPos.y do
                                    doCleanTile({x=x, y=y, z=v.toPos.z})
                                    local t = getTopCreature({x=x, y=y, z=v.toPos.z}).uid
                                    if t ~= 0 then
                                        if isMonster(t) then
                                            monsters = true
                                        end
                                    end
                                end
                            end
                           
                            if monsters then
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You haven\'t killed all monsters.')
                                doTeleportThing(cid, fromPosition)
                            else
                                if exhaustion.check(cid, configHunting.storageExh) then
                                    doPlayerSendCancel(cid, 'You have to wait: '..exhaustion.get(cid, configHunting.storageExh)..' sec to respawn monsters again.')
                                    doTeleportThing(cid, fromPosition)
                                else
                                    exhaustion.set(cid, configHunting.storageExh, configHunting.exhaust)
                                    doTeleportThing(cid, fromPosition, true)
                                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Monsters has been spawned.')
                                    for i = 1, v.monsters[2] do
                                        doCreateMonster(v.monsters[1], v.teleportPos, false, false, false)
                                    end
                                end
                            end
                            break
                        end
                    end
                end
                return true
            end
        ]]>
    </movement>


Help.. !room.webp
 
I re-post whole module:
it's to long for forum code so I upload


LUA:
https://easyupload.io/qle29l
Post automatically merged:



EDIT: I don't see this error earlier, but -->

monsterfailed.webp
 
Last edited:
The whole file seems a bit complicated to me, replace the v.monsters[1] with just a string of a monster as first step.
Like 'Rotworm' or something and see if that works and then use doPlayerSendTextmessage to see if any of those monsters[] actually have strings
And if not maybe use a table of strings that is working from another file and use that instead.
 
Back
Top