• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved Zombie Event (Talkaction)

Sentinel3

New Member
Joined
Oct 16, 2014
Messages
180
Reaction score
0
Hi everyone,

I got an error when I tryed to use !zombie, I leave you error below, if someone can help me please!

Using: TFS 1.0

Thank you for your atention and read this post. ;)

HTML:
Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/zombie_join.lua:onSay
data/talkactions/scripts/zombie_join.lua:11: attempt to compare nil with number
stack traceback:
        [C]: in function '__lt'
        data/talkactions/scripts/zombie_join.lua:11: in function <data/talkactions/scripts/zombie_join.lua:3>
 
Post the script and your server version.

Server Version: 10.41

Here it is, the script of /data/talkactions/talkactions.xml

HTML:
    <!-- Zombie Command -->
    <talkaction words="!zombie" script="zombie_join.lua"/>

Here it is, the script of /data/talkactions/scripts/zombie_join.lua

HTML:
dofile('data/zombie_system.lua')

function onSay(cid, words, param)
    local player = Player(cid)

    if Game.getStorageValue(zeStartedGlobalStorage) == 2 then
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Zombie Event has already started.')
        return false
    end

   if Game.getStorageValue(zeStartedGlobalStorage) < 1 then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "The Zombie Event has not started yet.")
        return false
    end

    if Game.getStorageValue(zeJoinedCountGlobalStorage) > zeMaxPlayers then
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Zombie Event is already full! ['.. Game.getStorageValue(zeJoinedCountGlobalStorage) ..'/'.. zeMaxPlayers ..']')
        return false
    end

    if player:isPzLocked() then
        player:sendCancelMessage('You can\'t join the zombie while you are in a fight!')
        return false
    end
   
    player:teleportTo(zeWaitingRoomPos)
    if not player:getGroup():getAccess() then
        Game.setStorageValue(zeJoinedCountGlobalStorage, Game.getStorageValue(zeJoinedCountGlobalStorage) + 1)
        Game.broadcastMessage(string.format('%s has joined the Zombie Event! [%s/'.. zeMaxPlayers ..'].', player:getName(), Game.getStorageValue(zeJoinedCountGlobalStorage)), MESSAGE_STATUS_WARNING)
        player:setStorageValue(zeJoinStorage, 1)
    end
    return false
end
 
Reload talkactions
VGZScWO.png

As you can see the text appeared after I changed to == nil or 0
 
Back
Top