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!