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

Zombie Event BETA! [Tfs 1.0] Vers: 0.5

Can you post your Zombie_teleport and Zombie_think.lua please
dofile('data/zombie_system.lua')

function onStepIn(cid, item, position, fromPosition)
local player = Player(cid)
if not player then
return false
end
if Game.getStorageValue(zeStartedGlobalStorage) == 2 then
player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Zombie Event has already started.')
player:teleportTo(fromPosition, true)
return false
end
if Game.getStorageValue(zeStartedGlobalStorage) == 0 then
player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Zombie Event has not started yet.')
player:teleportTo(fromPosition, true)
return false
end
if Game.getStorageValue(zeJoinedCountGlobalStorage) > zeMaxPlayers then
player:teleportTo(fromPosition, true)
player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Zombie Event is already full! ['.. Game.getStorageValue(zeJoinedCountGlobalStorage) ..'/'.. zeMaxPlayers ..']')
return false
end
player:teleportTo(zeWaitingRoomPos)
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)
return true
end

dofile('data/zombie_system.lua')

function onThink(interval, lastExecution, thinkInterval)
if Game.getStorageValue(zeStartedGlobalStorage) < 1 then
local teleport = Game.createItem(1387, 1, zeCreateTeleportPosition)
if teleport then
teleport:setAttribute(ITEM_ATTRIBUTE_UNIQUEID, 7000)
end
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 have one problem
zombiebug.png

and this is the code

Code:
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
 
EDIT:

zeJoinedCountGlobalStorage = 101 --Zombie spawned Count

Should be : zeZombieCountGlobalStorage = 101 --Zombie spawned Count

You also need to do this: Under ------Other Variables put this:

if Game.getStorageValue(zeStartedGlobalStorage) == nil then
Game.setStorageValue(zeStartedGlobalStorage, 0)
end

if Game.getStorageValue(zeJoinedCountGlobalStorage) == nil then
Game.setStorageValue(zeJoinedCountGlobalStorage, 0)
end

if Game.getStorageValue(zeZombieCountGlobalStorage) == nil then
Game.setStorageValue(zeZombieCountGlobalStorage, 0)
end

using this modification my server kept sending error message, but now broadcast message, i solved the problem removed the initial "Game." before every broadcast command
ex:
Game.broadcastMessage (string.format ('% s has joined the Zombie Event [% s /!' .. ZeMaxPlayers .. '].' Player: GetName (), Game.getStorageValue (zeJoinedCountGlobalStorage)), MESSAGE_STATUS_WARNING)

Should be:
broadcastMessage (string.format ('% s has joined the Zombie Event [% s /!' .. zeMaxPlayers .. '].' player: GetName (), Game.getStorageValue (zeJoinedCountGlobalStorage)), MESSAGE_STATUS_WARNING)

and if you only have two or fewer characters in the event does not work

now everything is running nice, thx everyone
 
using this modification my server kept sending error message, but now broadcast message, i solved the problem removed the initial "Game." before every broadcast command
ex:
Game.broadcastMessage (string.format ('% s has joined the Zombie Event [% s /!' .. ZeMaxPlayers .. '].' Player: GetName (), Game.getStorageValue (zeJoinedCountGlobalStorage)), MESSAGE_STATUS_WARNING)

Should be:
broadcastMessage (string.format ('% s has joined the Zombie Event [% s /!' .. zeMaxPlayers .. '].' player: GetName (), Game.getStorageValue (zeJoinedCountGlobalStorage)), MESSAGE_STATUS_WARNING)

and if you only have two or fewer characters in the event does not work

now everything is running nice, thx everyone

What Version are you using? TFS 1.0?
 
i have one problem
zombiebug.png

and this is the code

Code:
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
Same question to you.. what version are you using?
 
I have this is error..

Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/zombie_think.lua:eek:nThink
data/globalevents/scripts/zombie_think.lua:4: attempt to compare nil with number
stack traceback:
[C]: ?
data/globalevents/scripts/zombie_think.lua:4: in function <data/globalevents/scripts/zombie_think.lua:3>
[Error - GlobalEvents::think] Failed to execute event: zombie

Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/zombie_think.lua:eek:nThink
data/globalevents/scripts/zombie_think.lua:4: attempt to compare nil with number
stack traceback:
[C]: ?
data/globalevents/scripts/zombie_think.lua:4: in function <data/globalevents/scripts/zombie_think.lua:3>
[Error - GlobalEvents::think] Failed to execute event: zombie
 
I have this is error..

Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/zombie_think.lua:eek:nThink
data/globalevents/scripts/zombie_think.lua:4: attempt to compare nil with number
stack traceback:
[C]: ?
data/globalevents/scripts/zombie_think.lua:4: in function <data/globalevents/scripts/zombie_think.lua:3>
[Error - GlobalEvents::think] Failed to execute event: zombie

Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/zombie_think.lua:eek:nThink
data/globalevents/scripts/zombie_think.lua:4: attempt to compare nil with number
stack traceback:
[C]: ?
data/globalevents/scripts/zombie_think.lua:4: in function <data/globalevents/scripts/zombie_think.lua:3>
[Error - GlobalEvents::think] Failed to execute event: zombie

I got the same problem @Printer. What could cause this ?
 
If I remember correctly this system had a -big- bug/exploit in TFS 1.0, The player would be able to win every single zombie event with it... I might test it later.
 
What can I say, you are the golden star of Otland :D
Cheers mate :p
If I remember correctly this system had a -big- bug/exploit in TFS 1.0, The player would be able to win every single zombie event with it... I might test it later.
If you find out how, please tell me :p
 
Code:
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]: ?
        data/talkactions/scripts/zombie_join.lua:11: in function <data/talkactio
ns/scripts/zombie_join.lua:3>
 
Thank your printer, thats a good works, after some errors little, for a missing functions, i get it on gitbub added to global.lua and working 100% , you do a perfect work bro, i see all of your scripts and you do it very good, im expected for your pet system , See more of your scripts! thanks!:)

TFS : 1.0
 
Hello, i have this problem:

Code:
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/zombie_death.lua:eek:nDeath
data/creaturescripts/scripts/zombie_death.lua:5: attempt to index local 'monster' (a nil value)
stack traceback:
        [C]: in function '__index'
        data/creaturescripts/scripts/zombie_death.lua:5: in function <data/creaturescripts/scripts/zombie_death.lua:3>

My zombie_death.lua is:

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

function onDeath(cid, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
    local monster = Monster(cid)
    monster:say("I WILL BE BACK!", TALKTYPE_MONSTER_YELL)
    monster:getPosition():sendMagicEffect(CONST_ME_MORTAREA)
    doSummonZombie()
    Game.setStorageValue(zeZombieCountGlobalStorage, Game.getStorageValue(zeZombieCountGlobalStorage) - 1)
end

function onPrepareDeath(cid, killer)
    local player = Player(cid)
    local winner = 0
    if player:getStorageValue(zeJoinStorage) == 1 then
        Game.setStorageValue(zeJoinedCountGlobalStorage, Game.getStorageValue(zeJoinedCountGlobalStorage) - 1)
        player:teleportTo(player:getTown():getTemplePosition())
        player:setStorageValue(zeJoinStorage, 0)
        player:addHealth(player:getMaxHealth())
        if Game.getStorageValue(zeJoinedCountGlobalStorage) <= 1 then --Event ended, someone won!
            local players = Game.getPlayers()
            for _, tmpPlayer in ipairs(players) do
                local stor = tmpPlayer:getStorageValue(zeJoinStorage)
                if stor == 1 then
                    winner = tmpPlayer:getId()
                    break
                end
            end
            winner = Player(winner)
            if winner then
                winner:teleportTo(winner:getTown():getTemplePosition())
                local trophy = winner:addItem(zeTrophy, 1)
                local reward = winner:addItem(zeReward, 1)
               
                if trophy then
                    trophy:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, '['.. winner:getName() ..'] has won the Zombie Event.')
                end
                 broadcastMessage(string.format('%s is the winner of Zombie Event Versus %s Zombies.', winner:getName(), Game.getStorageValue(zeZombieCountGlobalStorage)), MESSAGE_STATUS_WARNING)
            end
            doClearZombieArena()
            resetVariables()
        end
        return false
    end
    return true
end

Thanks for help.
 
Back
Top