I have 2 module script that i need to use for a spectate gui, 1 for alive and finished players and another one for dead players so players cant spectate players in the dead players table, but idk how to move them,
--the script
DeadPlayers = require(game.ServerStorage.DeadPlayers) AlivePlayers = require(game.ServerStorage.FinishedAndAlivePlayers) script.Parent.Touched:Connect(function(hit) for i,v in pairs(game.Players:GetPlayers()) do if hit:IsDescendantOf(v.Character) and not table.find(DeadPlayers,v) then if hit.parent.Humanoid then hit.Parent.Humanoid.Health = 0 table.remove(ALivePlayers.--idkk) table.insert(DeadPlayers,1,v) end end end end)
In line 8, you can do
table.remove(ALivePlayers,table.find(ALivePlayers,v))
table.find returns the index (number) of the found value. if table.find and can't found the value then it's nil.