Need help sending Role data to client

I need help sending my role Data to the client side so the Role can appear for the choosen player. I am thinking about using a RemoteEvent and have tried.

I am having trouble and have tried multiple methods.

	local Murderer = playerFolder[math.random(1, #playerFolder)]
	table.remove(playerFolder, table.find(playerFolder, Murderer))
MurdererEvent:FireClient(Murderer, "Murderer")
local repStorage = game:GetService("ReplicatedStorage")
local RemoteEvents = repStorage.RemoteEvents
local MurdererEvent = RemoteEvents.Murderer

local players = game:GetService("Players")

MurdererEvent.OnClientEvent:Connect(function(Murderer)
	
end)

What issue are you having exactly?

I have tried Murderer.PlayerId = game.Players.LocalPlayer.PlayerId

i tried this,

MurdererEvent:FireClient(Murderer)

MurdererEvent.OnClientEvent:Connect(function(Murderer)

if Murderer then
	print("Murderer found")
end

end)

you’re removing the reference to the Murderer by removing it from the table before sending it to the client, do this:

    local Murderer = playerFolder[math.random(1, #playerFolder)]
	RoachEvent:FireClient(Murderer, "Murderer")
    table.remove(playerFolder, table.find(playerFolder, Murderer))

I see what you mean, but this script does not work. I tried printing it too

MurdererEvent.OnClientEvent:Connect(function(Murderer)

if Murderer then
script.Parent.Text = “Murderer”
end

end)

Can you print the murderer on the Server-Side script?

Also, instead of doing this, maybe you can use a “RoundStarted” RemoteEvent with a table of all players and what role they have.

Well the reason on why I am sending it to the Client is because so the player knows what they are.

What are you trying to do with the Information sent to the client?

I am trying to make the text say “You are the Murderer” using the Murderer information.

Hey Stevie, do you need to remove the player from the table?

What do you mean? When assigning roles, it removes the player from the players table.

Just to confirm, playersFolder is game.Players:GetPlayers() right?

Yes the folder is game.Players:GetPlayers()

Okay, that probably means you cannot remove the player from the table. You may be trying to remove a player instance. Try to make a player name table, and then randomize and remove. Only then can you turn the player name into a player instance.

What do you mean by making a player name table?

Instead of storing players in a table, store the names.
So instead of {game.Players.Whoever1, game.Players.Whoever2} do {“Whoever1”, “Whoever2”}

However following this I have just tested the code in your question, but it does print Murderer. So I do not have the issue for some reason

Can I see the screenshots, it might be a mistake on my end.