I have this script that I've tried to make fade out after you teleport, and i've made the screen black with a gui. Since I don't want to clone a million of the guis to the player when he spawns, and I don't know how to add it to the player every time they respawn so I made it add to the playergui and then remove it afterwards, and it works a few times then says in the output The Parent property of aaaa is locked, current parent: NULL, new parent PlayerGui

here's my script:

local PassId = 4835177
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local MarketplaceService = game:GetService("MarketplaceService")
local bloxy = workspace:WaitForChild("itemgiver1")
local debounce = false
local aa = game.ServerStorage.aaaa

local pos = CFrame.new(3.112, 5.216, -183.121)
local getPlayerFromCharacter
local player

getPlayerFromCharacter = function(model)
    local plr = Players:GetPlayerFromCharacter(model)

    if plr then 
        return plr
    else
        return nil 
    end
end

-- the code that matters

script.Parent.Touched:Connect(function(hit) 
    

local player = getPlayerFromCharacter(hit.Parent)

    if player then
	if not debounce then
		
	debounce = true

	

		
	
            player.Character:SetPrimaryPartCFrame(pos)
-- the not working part ----
aa:Clone()
aa.Parent = player.PlayerGui
for i = 0, 1, 0.1 do
	player.PlayerGui.aaaa.ImageLabel.ImageTransparency = i
	wait(.1)
end

	wait(.5)
	player.PlayerGui.aaaa:Destroy()
	debounce = false
-----------------------
	
	end
	
	end
	

    

        end)


10 comments

0

Is Archivable activated/on for "aaaa"?

0

yes

0

Which line is printing the error?

0

i don't know, how could i check that

0

It should output with the error

0

this is it's entire output 13:06:30.298 - The Parent property of aaaa is locked, current parent: NULL, new parent PlayerGui

0

Have you called :Destroy() on aaaa in any of your scripts?

0

no

0

Ew don't do that. Don't modify GUI on the server.

0

why is it bad? i thought it would be easier than doing it locally