i want to make this script where if the player already has this gui in it's playergui then don't clone it, but if the player doesn't then you do clone it. But this script doesn't work.
local debounce = false
local Players = game:GetService("Players")
local storage = game:GetService("ServerStorage")
local aaaa = storage.aaaa
script.Parent.Touched:Connect(function(hit)
local player = Players:GetPlayerFromCharacter(hit.Parent)
if player.PlayerGui.aaaa then
print("already has")
else
if not debounce then
debounce = true
aaaa:Clone().Parent = player.PlayerGui
print("cloned gui")
wait(99999999999999999999999999999999999999999999999999999999999999999999)
debounce = false
end
end
end)

1 comment
Do elseif not player.PlayerGui:FindFirstChild(‘aaaa’) then