Zombie Event BETA! [Tfs 1.0] Vers: 0.5

Discussion in 'GlobalEvents, Spells & CreatureEvents' started by Printer, Apr 24, 2014.

  1. Codinablack

    Codinablack Dreamer

    Joined:
    Dec 26, 2013
    Messages:
    1,119
    You aren't using 1.0

    The problem should be fixed by changing
    Code:
    function onDeath(cid, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
        local monster = Monster(cid)
    to

    Code:
    function onDeath(monster, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
    
    
     
  2. darkjav

    darkjav Senior Developer

    Joined:
    Apr 29, 2008
    Messages:
    179
    @Codinablack, i have the same error :/

    EDIT:
    I trying:

    Code:
    function onDeath(monster, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
    to

    Code:
    function onDeath(monster, corpse, killer, mostDamageKiller, unjustified, mostDamage_unjustified)
    and the same :(
     
    Last edited: May 24, 2015
  3. Codinablack

    Codinablack Dreamer

    Joined:
    Dec 26, 2013
    Messages:
    1,119
    Are you using 1.0 1.1 or 1.2?
     
  4. darkjav

    darkjav Senior Developer

    Joined:
    Apr 29, 2008
    Messages:
    179
    @Codinablack, is TFS 1.0 and I fixed changing:

    Code:
    function onDeath(cid, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
    local monster = Monster(cid)
    to

    Code:
    function onDeath(cid, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
      local monster = Creature(cid)
    SOLVED :D
     
    Codinablack likes this.
  5. Hugofasima

    Hugofasima Website: thenosegang.servegame.com

    Joined:
    Jun 24, 2015
    Messages:
    206
    My TFS is 1.1

    Error onSay and Onthink:
    Code:
    data/talkactions/scripts/events/zombie_join.lua:11: attempt to compare nil with
    number
    and
    Code:
    data/globalevents/scripts/events/zombie_think.lua:4: attempt to compare nil with
    number
    How can I solve it?
     
  6. Sir Islam

    Sir Islam Never Give Up

    Joined:
    Jun 6, 2008
    Messages:
    500
    for talkactions
    Code:
    dofile('data/zombie_system.lua')
    
    function onSay(cid, words, param)
        local player = Player(cid)
    
        if tonumber(Game.getStorageValue(102))  == 2 then
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Zombie Event has already started.')
            return false
        end
    
       if tonumber(Game.getStorageValue(102)) < 1 then
            player:sendTextMessage(MESSAGE_INFO_DESCR, "The Zombie Event has not started yet.")
            return false
        end
    
        if tonumber(Game.getStorageValue(100))  > zeMaxPlayers then
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Zombie Event is already full! ['.. tonumber(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(100, tonumber(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

    for onThink
    Code:
    dofile('data/zombie_system.lua')
    
    function onThink(interval, lastExecution, thinkInterval)
      if tonumber(Game.getStorageValue(102)) < 1 then
      local teleport = Game.createItem(1387, 1, zeCreateTeleportPosition)
      if teleport then
      teleport:setAttribute(ITEM_ATTRIBUTE_UNIQUEID, 7000)
      end
      Game.setStorageValue(tonumber(102),1)
      print('Zombie Event has started & waiting for players to join! Min: '.. zeMinPlayers ..'/'.. zeMaxPlayers ..'.')
      Game.broadcastMessage('The Zombie Event has started! You have '.. zeWaitMinutes ..' minutes to join!', MESSAGE_STATUS_WARNING)
      addEvent(startZombie, zeWaitMinutes * 60 * 1000)
      end
      return true
    end
    
     
    Last edited: Jul 30, 2015
    Hugofasima likes this.
  7. Hugofasima

    Hugofasima Website: thenosegang.servegame.com

    Joined:
    Jun 24, 2015
    Messages:
    206
    Still the same error Sir Islam!

    Code:
    Lua Script Error: [GlobalEvent Interface]
    data/globalevents/scripts/events/zombie_think.lua:onThink
    data/globalevents/scripts/events/zombie_think.lua:4: attempt to compare nil with
    number
    stack traceback:
            [C]: in function '__lt'
            data/globalevents/scripts/events/zombie_think.lua:4: in function <data/g
    lobalevents/scripts/events/zombie_think.lua:3>
    [Error - GlobalEvents::think] Failed to execute event: zombie
     
  8. Sir Islam

    Sir Islam Never Give Up

    Joined:
    Jun 6, 2008
    Messages:
    500
    update my reply recopy
     
    Hugofasima likes this.
  9. FLE

    FLE Member

    Joined:
    Oct 5, 2008
    Messages:
    424
    Using TFS 1.1 -

    Hello, I am having some problems.. I will do my best too explain.

    1 .
    When first player enters the event it says 0/15..
    the event is not supposed too start unless 3 people have joined,
    but i just went thru the portal 3x..
    and for some reason the 1st time I went thru the tp, it said 5/15?
    --
    05:53 The Zombie Event has started! You have 4 minutes to join!
    05:54 Martin has joined the Zombie Event! [5/15].
    05:54 Martin has joined the Zombie Event! [6/15].
    05:54 Martin has joined the Zombie Event! [7/15].

    2 .
    The portal does not disappear when the event starts..
    instead -
    06:18 The Zombie Event has already started.

    3 .
    nobody wins when its over?

    ----------------------------------------------------
    No errors in console, I installed everything properly (i think)

    umm ya....

    I think its some storage value problem?

    If you can help me, please let me know what scripts you need too see!

    Thanks,
    -Martin
     
  10. Hugofasima

    Hugofasima Website: thenosegang.servegame.com

    Joined:
    Jun 24, 2015
    Messages:
    206
    Still the same Sir Islam!! I made it @Sir Islam
    dofile('data/zombie_system.lua')

    function onThink(interval, lastExecution, thinkInterval)

    if Game.getStorageValue(zeStartedGlobalStorage) ~= 1 then
    local teleport = Game.createItem(1387, 1, zeCreateTeleportPosition)
    teleport:setDestination(zeWaitingRoomPos)
    Game.setStorageValue(zeStartedGlobalStorage, 1)
    print('Zombie Event has started & waiting for players to join! Min: '.. zeMinPlayers ..'/'.. zeMaxPlayers ..'.')
    Game.broadcastMessage('The Zombie Event has started! You have '.. zeWaitMinutes ..' minutes to join!', MESSAGE_STATUS_WARNING)
    addEvent(startZombie, zeWaitMinutes * 60 * 1000)
    end
    return true
    end

    I'm trying to puzzle this storage configuration too @FLE.. I'm completely lost xD
    How did you solve this problem
    Code:
    Lua Script Error: [Main Interface]
    in a timer event called from:
    (Unknown scriptfile)
    data/zombie_system.lua:49: attempt to compare number with nil
    stack traceback:
            [C]: in function '__lt'
            data/zombie_system.lua:49: in function 'doSummonZombie'
            data/zombie_system.lua:62: in function 'doStartZombieEvasion'
            data/zombie_system.lua:45: in function <data/zombie_system.lua:28>
    This attempt to compare number with nil is annoying me!!!
     
    Last edited: Jul 30, 2015
  11. RazorBlade

    RazorBlade Snek Premium User

    Joined:
    Nov 7, 2009
    Messages:
    1,996

    Change
    zeJoinedCountGlobalStorage = 101 --Zombie spawned Count
    to
    zeZombieCountGlobalStorage = 101 --Zombie spawned Count

    Just a small typo. Can you update that in post 2 @Printer
     
    Hugofasima likes this.
  12. Lava Titan

    Lava Titan High Exp OTS Developer

    Joined:
    Jul 25, 2009
    Messages:
    1,450
    any1 else got this?

    Code:
    Lua Script Error: [GlobalEvent Interface]
    data/globalevents/scripts/events/zombie/zombie_think.lua:onThink
    data/globalevents/scripts/events/zombie/zombie_think.lua:4: attempt to compare n
    il with number
    stack traceback:
            [C]: in function '__lt'
            data/globalevents/scripts/events/zombie/zombie_think.lua:4: in function
    <data/globalevents/scripts/events/zombie/zombie_think.lua:3>
    [Error - GlobalEvents::think] Failed to execute event: zombie
     
  13. Awesomedudei

    Awesomedudei My BFF is outside closet

    Joined:
    Jan 20, 2010
    Messages:
    171
    Getting this [​IMG]
     
  14. vininadin

    vininadin New Member

    Joined:
    Jul 1, 2009
    Messages:
    4
  15. VitorNM

    VitorNM New Member

    Joined:
    Sep 18, 2015
    Messages:
    10
    any map to this event??????
     
  16. Gram

    Gram New Member

    Joined:
    Nov 19, 2016
    Messages:
    1
    Helpme
    [​IMG]
     

Share This Page