I made a playerGui that stores the amount of gold a player currently has after buying a citizen. I read that setting ResetPlayerGuiOnSpawn = false would prevent this. I put this script into both a Local and regular script and the playerGui still resets after they die. I use print(guiReset) and it comes back with false.
wait(3) -- Waits for the player to load before starting the script. Will change to a WaitForChild later while wait(0.5) do for i,v in pairs (game.Players:GetPlayers()) do -- GetPlayers return the players in the game. V refers to any objects in the players tab wait(1) guiReset = game:GetService("StarterGui").ResetPlayerGuiOnSpawn guiReset = false print(guiReset) goldGui = v.PlayerGui.resources.resourcesFrame.Gold goldGui.Text = goldGui.amount.Value end end