this script is supposed to clone the gui to the player only if they don't have it but everytime the player dies, the gui is removed (i don't know why) and the script reads it and adds another one, but it wont work after the player dies and I don't know why


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)
    local aaaa = player.PlayerGui:FindFirstChild("aaaa")
    if aaaa then
        print("already has")

    elseif not aaaa then

    aaaa:Clone().Parent = player.PlayerGui
    print("cloned gui")

    end
    

end)

2 comments

0

Mabye an FE thing? Idk just making guesses here but i think you would have to fire an event to clone the gui??

0

ill just make the event on character added then :(