What I'm trying to do is when a player dies, their name is added to a table, I know how to add a string to a table, but not how to use remoteEvents to pass the player's name.
--Inside ServerScriptStorage
local deadPlayers = {}
local event = Instance.new("RemoteEvent")
event.Parent = game.Workspace
event.Name = "MyServerEvent"
event.OnServerEvent:connect(function()
table.insert(deadPlayers, --[===[Not sure what to add here]===])
end)
--Inside StarterGui/StarterPack as a local script
game:GetService('Players').PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
character:WaitForChild("Humanoid").Died:connect(function()
game.Workspace.MyServerEvent:FireServer()[===[Not sure what to add here in order to send the player's name.]===]
end)
end)
end)
