Server:
local Players = game:GetService("Players")
game.ReplicatedStorage.Remotes.died.OnServerEvent:Connect(function(dr)
if table.find(Array, dr) then
table.remove(Array, dr)
print(dr .. " was eliminated!")
else
print("Player was already eliminated")
print(Array)
end
end)
Localscript:
local Player = game.Players.LocalPlayer
local Char = Player.Character
local dataSend = script.Parent.Parent.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local died = ReplicatedStorage.Remotes.died
print("Death Script Ready!")
print(Player)
Char:WaitForChild("Humanoid").Died:Connect(function()
died:FireServer(dataSend)
print("FIRED!")
end)
Script to grab players:
function getPlayers()
for _,v in ipairs(game.Players:GetPlayers()) do
table.insert(Array,v.Name);
print(Array)
end
end
So I'm trying to make a basic system to tell if a certain player has been eliminated from the round and I'm having trouble with the death system. I just want it to remove the player from the array but instead it just says that they already don't exist
