How can I get a GUI to be visible even after a player resets/dies

Greetings, developers!
I have a GUI button that I want to have visible to specific players in a group rank. It seems to be working fine when they spawn into the game, however, the issue is that the button goes away if the player ever respawns or dies. I want the button to still be visible even after they reset, or else they will need to rejoin the game in order to have access to those buttons again.

I have not tried any solutions so far, since I don’t really know where to start.

Here’s the current code:

local Settings = {
["GroupId"] = 0000000;
["AllowedRank"] = 19
}

game.Players.PlayerAdded:Connect(function(player)
    if player:IsInGroup(Settings.GroupId) and player:GetRankInGroup(Settings.GroupId) >= 19 then
         script.Button:Clone().Parent = player:WaitForChild("PlayerGui")
    end
end)

Keep in mind for the code above, this script is located in ServerScriptService and the GUI is located in the script. It clones the GUI to the player’s PlayerGui if the player meets the requirement.

Any help is appreciated, thanks in advance!

1 Like

Try disabling ResetOnSpawn in ScreenGui properties:
image

4 Likes

Oh my goodness, I didn’t even realize that. Thank you so much!

The more you know, I guess.

1 Like