Owner only gui disappears on death

I’m trying to make a secure owner-only GUI that no hackers can get ahold of. My solution to this was to make a server script with a GUI inside it, and clone it into my Playergui when I join the game. The only issue is that it doesn’t save when I respawn, how do I fix this?

local Whitelist = {"InkBrains"}

game.Players.PlayerAdded:Connect(function(player)
	
	if table.find(Whitelist, player.Name) then
		local CashGiver = script:WaitForChild("CashGiver"):Clone()
		CashGiver.Parent = player:WaitForChild("PlayerGui")
	end
end)
1 Like
local Whitelist = {"InkBrains"}

game.Players.PlayerAdded:Connect(function(player)
	
	player.CharacterAdded:Connect(function()
task.wait()
            if table.find(Whitelist, player.Name) then
		local CashGiver = script:WaitForChild("CashGiver"):Clone()
		CashGiver.Parent = player:WaitForChild("PlayerGui")
	end
       end)
end)
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.