Why isn't this remote event working?

Hi, i’m trying to fire a remote event when a player dies so that it updates the 1v1 score board.
Here are my lines in the server script that fire it:
game.ReplicatedStorage.ScoreBoardEvent:FireClient(player1, player1.Name, player2.Name)
game.ReplicatedStorage.ScoreBoardEvent1:FireClient(player2, player1.Name, player2.Name)

and here is my local script:

local plr1Kills = 0
local plr2Kills = 0

game.ReplicatedStorage.ScoreBoardEvent.OnClientEvent:Connect(function(Name1, Name2)
	plr2Kills = plr2Kills + 1
	Name1.PlayerGui.ScoreBoard.Frame.Visible = true
	Name1.PlayerGui.ScoreBoard.Frame.TextLabel.Text = plr1Kills.." : "..plr2Kills
	Name2.PlayerGui.ScoreBoard.Frame.TextLabel.Text = plr1Kills.." : "..plr2Kills
end)
game.ReplicatedStorage.ScoreBoardEvent1.OnClientEvent:Connect(function(Name1, Name2)
	plr1Kills = plr1Kills + 1
	Name2.PlayerGui.ScoreBoard.Frame.Visible = true
	Name2.PlayerGui.ScoreBoard.Frame.TextLabel.Text = plr1Kills.." : "..plr2Kills
	Name1.PlayerGui.ScoreBoard.Frame.TextLabel.Text = plr1Kills.." : "..plr2Kills
end)

Let me know if you need to see the whole of the server script, I would really appreciate any help!

Use the RemoteEvent and Update it with a Server Script, The First Variable is the Player

1 Like

if you’re trying to access the playergui of a non-local player from a localscript, you can’t

2 Likes

Thank you, so how would I make this work?

Where did you put the script ?
If it is in the Remote Event, move it to the workspace.
If the Replicated Storage is the Ancestor of the script, the code in it won’t be able to run.
A script mustn’t be here.

I heavily recommend you to make a ServerScript if you want to access in someone else’s StarterGui. You can put the ServerScript in ServerScriptService.

1 Like

don’t try to access the gui of another player from a localscript, you can just change the text of your own gui

I think you can also just do it all through a serverscript maybe? I have no idea, I haven’t tested it before.

2 Likes

I could give you scripts but I am not a good scripter. I will do my best.

1 Like

Hi, thank you very much for your response, my script that fires the event is a server script and the script that runs when the event is fired is a local script inside the startergui

I am sorry, I don’t have enough experience to accomplish your goal.

I would recommend you to make a leaderboard and add values to it.
Maybe I could make a script but I really need to know if there is only 2 players maximum in your game.

No there are 18 players in the game, but multiple arenas. Each with their own ‘player1’ and player2

Well it will be more difficult. I could maybe do something but it will take to much time to make an entire script and arena.