What do you want to achieve?
I wanna fix some weird GUI issue
What is the issue?
The gui won’t enable, even making frames visible isn’t possible
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)
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.
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
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.
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.