I’m trying to fire a client script but this error shows up. It’s simple but I couldnt find the solution
Here’s the code and error:
local function removePlayer(playersList, player, i)
table.remove(playersList, i)
print(player.Name .. " has been removed")
if player or player.Character then
ChangeVisibility:FireClient(player, "PlayerStats", false)
if player.Character.Humanoid and player.Character.Humanoid:FindFirstChild("Creator") then
local text = player.Character.Humanoid.Creator.Value .. " has killed " .. player.Name
Killfeed:FireClient(playersList, text)
else
local text = player.Name .. " has fallen..."
Killfeed:FireClient(playersList, text) -- error is in this line
end
else
Killfeed:FireClient(playersList,player.Name .. " has left the game...")
end
end
ohh wait sorry, i didnt see the title.
So, are you sure the “Killfeed” variable is RemoteEvent? because killfeed variable could be something that isnt remoteevent.
if that isn’t the issue, then you might check the script that receives the remoteEvent which made the error.
This means that the function expected an Object, and got a value (table). It can’t use a value as an Object. To fix the error, you should iterate the list and fire each player individually. If you want to tell all clients this, use :FireAllClients().