My issue not working but it seems logic I tried many solutions none worked Output says that its table expected got boolean
function MapVoting(ProioritizedMap,Person) local function cool () if table.find(MoonMapChoosers,Person) then return MoonMapChoosers elseif table.find(SkyMapChoosers,Person) then return SkyMapChoosers elseif table.find(RockMapChoosers,Person) then return RockMapChoosers else return false end end cool() local PreviousVotedMap = cool() print(PreviousVotedMap) if PreviousVotedMap == RockMapChoosers or SkyMapChoosers or MoonMapChoosers then for i,v in pairs(PreviousVotedMap) do if v == Person then table.remove(PreviousVotedMap,i) table.insert(ProioritizedMap, Person) print(i) elseif ProioritizedMap == false then table.insert(ProioritizedMap, Person) print(Person) end end end end
I’m not really sure how are you determining the players, however since it’s expecting a table but you gave it a boolean, I can’t really help you much based on the script you gave me.
However, make a check and see if the function returns false.
function MapVoting(ProioritizedMap,Person) local function cool () if table.find(MoonMapChoosers,Person) then return MoonMapChoosers elseif table.find(SkyMapChoosers,Person) then return SkyMapChoosers elseif table.find(RockMapChoosers,Person) then return RockMapChoosers else return false end end cool() if cool() then local PreviousVotedMap = cool() print(PreviousVotedMap) if PreviousVotedMap == RockMapChoosers or SkyMapChoosers or MoonMapChoosers then for i,v in pairs(PreviousVotedMap) do if v == Person then table.remove(PreviousVotedMap,i) table.insert(ProioritizedMap, Person) print(i) elseif ProioritizedMap == false then table.insert(ProioritizedMap, Person) print(Person) end end end end end