undefined Posted June 2, 2018 Share Posted June 2, 2018 player_tbl = { index = { in_zone = false, zombie_proof = false, zombies = {}, zombie_limit = 60, create_zombie = function(player) outputChatBox("test") if player.zombie_proof or not player.in_zone or isPedDead(player.element) then return end local zombie_count = 0 while zombie_count < 3 do triggerClientEvent ("find_spawn_location", player.element) zombie_count = zombie_count + 1 end end }, players = {} } addEventHandler("onResourceStart", resourceRoot, function() for i, player in ipairs(getElementsByType("player")) do local self = setmetatable({ element = player }, { __index = player_tbl.index }) table.insert(player_tbl.players, self) Timer(function(self) self:create_zombie() -- this line --self.create_zombie(self) -- or this line end, 10000, 0, self) end end) What is the cause of the mistake? Link to comment
Ryan2233 Posted June 3, 2018 Share Posted June 3, 2018 The screenshot isn't working, can you share the error? Link to comment
undefined Posted June 3, 2018 Author Share Posted June 3, 2018 Quote ERROR: attempt to call field 'create_zombie' (a nil value) Link to comment
opnaiC Posted June 3, 2018 Share Posted June 3, 2018 (edited) - deleted Edited June 3, 2018 by opnaiC Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now