GUI not Enabling from FireClient

  1. What do you want to achieve?
    I wanna fix some weird GUI issue

  2. What is the issue?
    The gui won’t enable, even making frames visible isn’t possible

  3. What solutions have you tried so far?
    Everything I could

So basically I made a script whenever a value changes and is at 0, the script will fire some events to the player. However, 2 of them seem to work completely fine, however the last one just won’t work and I have no clue why that happens. It just won’t enable a Gui and not making anything visible.
[Btw, the ReturnLobby event does kill the player and respawns 1 second later]

Server script which is in StarterGui:

wait(10)
script.Parent.Parent.Damage.Changed:Connect(function()
	if script.Parent.Parent.Damage.Value == 0 then
		game.ReplicatedStorage.Remotes.ReturnLobby:FireClient(script.Parent.Parent) --works fine
		wait(1)
		game.ReplicatedStorage.Remotes.ToMenu:FireClient(script.Parent.Parent) --works fine

wait(3)
		
		game.ReplicatedStorage.Remotes.Dead:FireClient(script.Parent.Parent) -- maybe fires or doesn't at all

		

	end
end)


The localscript which is also in StarterGui:

game.ReplicatedStorage.Remotes.Dead.OnClientEvent:Connect(function()

	script.Parent.Parent.EndScreens.Enabled = true --Never becomes enabled
	script.Parent.Parent.EndScreens.DeathScreen.Visible = true --never gets visible


end)

I even checked on the client side and nothing was enabled, also literally not a single error in the output.
Any help is appreciated

You can check the properties of those Death Screen to see if they are actually visible. Or you could make a print function in the OnClientEvent function to see if the function is really running.

1 Like

Tried both, but it did not show anything.

You mean that the GUI isn’t visible? Like not ticked?

Yea, also, the ReturnLobby event does kill the player and respawn them 1 second later (don’t knowi f anything has to do with that

Hmm. Did you tick off ResetOnSpawn on each GUI?

Try to use WaitForChild(“ReturnLobby”) for remote event and instead game.ReplicatedStorage game:GetService(“ReplicatedStorage”)

Yes, all are off, so this is really weird

I could, but the Returnlobby event works just fine, It’s only the dead that doesn’t work

Is this a player object?

Yea, the script is placed into startergui, so script.Parent.Parent should be the player

So is the script placed in like a character or something?

No It’s in Startergui, and since Startergui is always inside the player, script.Parent.Parent is definitely the player. Besides, all the other remotes seem to work fine with Script.Parent.Parent. It’s only the dead remote that just refuses to work

Oh sorry, I didn’t read the original post. But how does the Dead RemoveEvent not work? There is something that stands out from the other RemoveEvents.

Can you show your explorer in StarterGui?

Okay guys, I think I found the solution.
I have no idea why but apparently the script won’t go any further after the player died.
Basically the player dies when the ReturnLobby event fires, and since the player is already alive again before the dead remote fires, the dead remote won’t work anymore. Now if I fire it immediately it works.

1 Like

I mean like why would you put the script inside of a StarterGui? Can’t you put in other places like ServerScriptService? But hey you already found the solution so that’s nice.

Oh,then try to use it WaitForChild(“Dead”) in local script

No because it needs to know the numbervalue

1 Like

Anyways this was the solution I sent in this post here