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

GlobalEvent [TFS 1.2] Zombie Arena

has somebody converted this to revscripts?
I converted the scripts menthioned below to revscripts and the other just added to the datapack as they were/are, but when i use /zombieevent !zombieevent nothing occurs, any tips ideas?

data/creaturescripts/scripts/zombie_arena/death.lua
data/creaturescripts/scripts/zombie_arena/kill.lua
data/creaturescripts/scripts/zombie_arena/logout.lua
data/talkactions/scripts/zombie_arena.lua

Lua:
---1
local creatureevent = CreatureEvent("zombie_death")
-- When player dies in Zombie Arena
function creatureevent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)

    -- Has the event started?
    if not zombieArena:isStarted() then
        return false
    end

    -- Did a player die?
    if player:isPlayer() then
     
        -- Is the player doing the event?
        if not zombieArena:isPlayerOnEvent(player) then
            return false
        end

        zombieArena:removePlayer(player)
        zombieArena:debug(player:getName() .. " got teleported to " .. player:getTown():getName() .. ".")

        zombieArena:checkArena()
    end
    return true
end
---1
creatureevent:register()
---2
local killevent = CreatureEvent("zombie_kill")
-- When player kills a Zombie in Zombie Arena
function killevent.onKill(player, target)

    -- Has the event started?
    if not zombieArena:isStarted() then
        return false
    end

    -- Was the killer a player?
    if player:isPlayer() then

        -- Is the player doing the event?
        if not zombieArena:isPlayerOnEvent(player) then
            return false
        end
     
        -- Was the monster killed a zombie?
        if target:getName() == zombieArena.config.monster then
            zombieArena:onKill(player)
            return true
        end

        return false
    end
end
killevent:register()
---2
---3
-- When player logs out in Zombie Arena
-- This is written just in case
-- The code should never happen
local logout = CreatureEvent("zombie_logout")
function logout.onLogout(player)

    -- Has the event started?
    if not zombieArena:isStarted() then
        return true
    end

    -- Did a player logout?
    if player:isPlayer() then
     
        -- Is the player doing the event?
        if not zombieArena:isPlayerOnEvent(player) then
            return true
        end
     
        player:teleportTo(player:getTown():getTemplePosition())
        zombieArena:removePlayer(player)
    end  
    return true
end

logout:register()
---3
creatureevent:register()

local login = CreatureEvent("zombie_register")

function login.onLogin(player)
    player:registerEvent("zombie_kill")  
    player:registerEvent("zombie_death")
    player:registerEvent("zombie_logout")
    return true
    end
login:register()
and
data/talkactions/scripts/zombie_arena.lua
Code:
local talk = TalkAction("/zombiearena", "!zombiearena")

function onSay(player, words, param)
  
    if not player:getGroup():getAccess() then
        return true
    end

    if player:getAccountType() < ACCOUNT_TYPE_GOD then
        return false
    end

    if zombieArena:openEvent() then
        zombieArena:autoStart()
    end

    return true
end

talk:separator(" ")
talk:register()
 
Last edited:
Back
Top