I've put the GUIs in the StarterGui since having them spawned via script into the PlayerGui caused them to be deleted when the player respawned.
However, the GUIs don't function as intended after the player dies. I've asked the function in question to fire when the player clicks on the GUI. It works as intended until the player dies and respawns. That is when the GUI will stop connecting the function when it is clicked.
Here's a script that emulates this behaviour:
function ExampleFunction()
N = Instance.new("Message", game.Workspace)
N.Text = "Message"
wait(3)
N:remove()
end
game.Players.LocalPlayer.PlayerGui.Example.ExampleButton.MouseButton1Down:connect(ExampleFunction)
The function "ExampleFunction()" will stop being fired after the player resets/respawns, though the button remains. There are no error messages. Please help me.

4 comments
StarterGui still spawns a copy inside the PlayerGui every time the character respawns, so every reference you keep is to the original gui. If the LocalScripts are inside a ScreenGui then it will run again every time the gui loads.
1waffle1, are you telling me to place the local script in the StarterGui itself? I will try that ^_^
I though Message was deprecated but....
@yougottols1 It's an example, haha.