jawwel Posted March 31, 2018 Share Posted March 31, 2018 function signUpToTDM(plr) if (tonumber(getPlayersInDimension(860)) >= 1) then outputChatBox("TDM are in progress, please, wait for them to finish and re-try", plr, 255, 255, 0) return end if (not signedPlayers[plr]) then table.insert(signingPlayers, plr) signedPlayers[plr] = true outputChatBox("You have joined TDM! Try get as many team kills as possible!", plr, 255, 255, 0) outputChatBox("/leave to cancel TDM.", plr, 255, 255, 0) for k, v in ipairs(signingPlayers) do outputChatBox(""..#signingPlayers.."/"..playerLimit.." are now signed up", v, 255, 255, 0) end if (#signingPlayers == playerLimit) then setTimer(stopDx, 50, 1) warpPlayersToField() destroyMarker() timeOutTimer = setTimer(timeOutEvent, tonumber(timeToFinish), 1) timeOut = false for k, v in pairs(signingPlayers) do if (isElement(v)) then triggerClientEvent(v, "TDM.Countdown", v) end end end end end whats wrong ? table index nil Link to comment
Hoffmann Posted March 31, 2018 Share Posted March 31, 2018 (edited) I'm not sure if this line makes sense: if (tonumber(getPlayersInDimension(860)) >= 1) then It supposed to be if (tonumber(getPlayersInDimension(plr)) >= 1) then If I'm not wrong. Write number of line where error appears. Edited March 31, 2018 by NeverUnbeatable Link to comment
Moderators Patrick Posted March 31, 2018 Moderators Share Posted March 31, 2018 Maybe: Change this: for k, v in pairs(signingPlayers) do if (isElement(v)) then triggerClientEvent(v, "TDM.Countdown", v) end end To this: for k, v in ipairs(signingPlayers) do if (isElement(v)) then triggerClientEvent(v, "TDM.Countdown", v) end end Link to comment
jawwel Posted March 31, 2018 Author Share Posted March 31, 2018 the error is here: table.insert(signingPlayers, plr) signedPlayers[plr] = true Link to comment
Moderators Patrick Posted March 31, 2018 Moderators Share Posted March 31, 2018 Maybe the signedPlayers or signingPlayers are not definied as table before. 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