Hi, so I’m using a round system for my game, but the problem is that it has an error with a table:
script:
local tabla = {}
local tala2 = {}
local module = require(game.ServerScriptService.ModuleScript)
tabla = module[1]
tala2 = module[2]
game.Players.PlayerAdded:Connect(function(plr)
plr:LoadCharacter()
plr.CharacterAdded:Connect(function(char)
if plr.Team == game.Teams.gladiador then
table.insert(tabla,plr.Name)
print(tabla)
wait(3)
local char = plr.Character
char.Humanoid.Died:Connect(function(died)
table.remove(tabla,table.find(tabla,plr.Name))
end)
elseif plr.Team == game.Teams.guerrero then
table.insert(tala2,plr.Name)
print(tala2)
wait(3)
local char = plr.Character
char.Humanoid.Died:Connect(function(died)
table.remove(tala2,table.find(tala2,plr.Name))
end)
end
end)
end)
script that checks the system ( if the players are alive ) :
local modulo = require(game.ServerScriptService.ModuleScript)
local tabla = modulo[1]
local tabla2 = modulo[2]
game.Players.PlayerAdded:Connect(function(plr)
wait(10)
print("dale")
if not table.find(tabla,plr.Name) then
print(plr.Name.." si no das eres un homosexual")
end
end)
script de modulo:
local tabla = {}
local tala2 = {}
local module = {tabla,tala2}
return module
If you can help me a little, I would appreciate it. In case of something, I don’t think you need to know what I want to know, but I want that when the player dies, he is eliminated from the table, so far everything is fine, but in the 2nd script, it doesn’t work and it doesn’t I know because that’s what I need to know