Hello,

I'm andrewzs, an intermediate scripter, i got a problem with this gui i'm doing, i scripted this on filtering enabled, inside a local script that i placed on starter player scripts.

As the title says, when a player joins the game, the gui is cloned perfectly, however when they die or they respawn, the gui won't clone, and i'm not sure why this happens, hope you can help

local plr = game.Players.LocalPlayer
game.ServerStorage.AD:Clone().Parent = plr.PlayerGui
	local appear = false
        while true do
		plr.PlayerGui:WaitForChild('AD').Advertisement.Text = 'Welcome to our roleplay site, '..plr.Name
	    wait(500)
        local appear = true
		if appear ~= true then
	    else
		plr.PlayerGui:WaitForChild('AD').Advertisement.Text = 'Hey you! yes you, '..plr.Name
		wait(10)
		plr.PlayerGui:WaitForChild('AD').Advertisement.Text = 'Interested in joining a new and fresh starting SCPF'
		wait(10)
		plr.PlayerGui:WaitForChild('AD').Advertisement.Text = 'Well, today is your lucky day, we are advertising a new and fresh SCPF!'
		wait(10)
		plr.PlayerGui:WaitForChild('AD').Advertisement.Text = 'You might have chances of getting an important rank, but dont get cocky, join us and help this great community grow!'
		wait(10)
		plr.PlayerGui:WaitForChild('AD').Advertisement.Text = 'https://www.roblox.com/Groups/Group.aspx?gid=3889962'
		wait(20)
		appear = false
		end
end