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

Lua Zombie event small changes..

therrax

Member
Joined
Jul 12, 2012
Messages
262
Solutions
1
Reaction score
11
Hi.
TFS 1.0
script:
http://otland.net/threads/zombie-event-beta-tfs-1-0-vers-0-5.213758/
I want to fix some bugs with zombie event script in talkactions..
Bugs:
1.One player can 15x use this command.. for example
Code:
When I use command !zombie
Therrax join to zombie [1/15]
again
!zombie
Therrax join to zombie [2/15]  and again to 15... :D 1 player can use it 15 times ...
2. Player can't use it when he is not in protection zone, and i want change it. [only in PZ]
script:
Code:
dofile('data/zombie_system.lua')
function onSay(cid, words, param)
    local player = Player(cid)
    if player:getGroup():getAccess() then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "Game master can't join.")
        return false
    end
    if ze_started == started then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "The Zombie Event has already started.")
        return false
    end
    if ze_started == true then
        if ze_joined_count < ze_max_players then
            if not player:isPzLocked() then
                player:teleportTo(ze_waiting_room_pos, false)
                ze_joined_count = ze_joined_count + 1
                broadcastMessage(""..player:getName().." has joined the Zombie Event! ["..ze_joined_count.."/"..ze_max_players.."].", MESSAGE_STATUS_WARNING)
                player:setStorageValue(ze_join_storage, 1)
            else
                player:sendCancelMessage("You can't join the zombie while you are in a fight!")
            end
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "The Zombie Event is already full! ["..ze_joined_count.."/"..ze_max_players.."]")
        end
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, "The Zombie Event has not started yet.")
    end
    return false
end
 
Last edited:
To check if someone already joined the event
Code:
if player:getStorageValue(ze_join_storage) ~= 1 then
   -- teleport and stuff
else
   player:sendCancelMessage("You already joined the event!")
end

To check for pz
Code:
if Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then
 
Back
Top