FireClient problem

So I am yet again posting another forum about my remote events. Basically what I am trying to achieve here is to show the GUIS once a player dies in a game and in the lobby again. But because of my small brain I cannot find the right way to script this, can someone please help me fix what I have done here? It will be much appreciated if you are willingly to help me :slight_smile:

The code when the player dies

The code receiving the fireclient message

The output shows no sign of “SPS” and “EPS” by the way.

Starter gui is something that is cloned to PlayerGuis in each player if you edit startergui it doesnt replicated to player the actual gui you should be editing is in the player instance in a folder called “PlayerGuis” – I think thats the name

how do i access playerGUI in my script? For some reason playerGUI just leaves me a red line in the code

you could put a local script in your gui that does the responding like I did with my game
image

the problem is I want to show two gui’s, so i don’t really know where to put it

Well, the problem is that you are changing the Starter Gui, but you need to change the Player Gui, Using this script:

local SPS = game.ReplicatedStorage.SpectatePlayerShow
local EPS = game.ReplicatedStorage.EquippedPlayerShow

SPS.OnClientEvent:Connect(function(player)
player.PlayerGui:WaitForChild("SpectateGui").SpectateBtn.Visible = true
end)

EPS.OnClientEvent:Connect(function(player)
player.PlayerGui:WaitForChild("Shop").EquippedItemViewport.Visible = true
end)

instead of sending the player as an argument since its a local script you can do

local player = game.Players.LocalPlayer

just tried what you suggested me to do but still no success :sleepy:

Can you please send what Output says about it?

the print statement i put does not appear whatsoever

You could put the localscript they suggested in StarterPlayerScripts.

local player = game.Players.LocalPlayer
local SPS = game.ReplicatedStorage.SpectatePlayerShow
local EPS = game.ReplicatedStorage.EquippedPlayerShow

SPS.OnClientEvent:Connect(function(player)
player.PlayerGui:WaitForChild("SpectateGui").SpectateBtn.Visible = true
print("SPS - onClientEvent")
end)

EPS.OnClientEvent:Connect(function(player)
player.PlayerGui:WaitForChild("Shop").EquippedItemViewport.Visible = true
print("EPS - onClientEvent")
end)

ok I’m going to test this out be right back

this does seem to work but another problem arise, I have this death message system in my game, it only appears during the death message, but when I’m actually back in the lobby it just disappears again. I am super confused rn

Is the ScreenGui’s ResetOnSpawn boolvalue set to true?

yes, the resetonspawn button is set to true.

Set the ResetOnSpawn boolvalue to false, that should fix your issue.

it seems like the guis are showing again, thanks for helping me fixing this issue! If possible can you please explain how this work? I don’t really get why setting it to false solves the problem…

A GUI object resets everytime a player respawns when it is toggled, meaning that any changes would be reverted