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
Is Archivable activated/on for "aaaa"?
yes
Which line is printing the error?
i don't know, how could i check that
It should output with the error
this is it's entire output 13:06:30.298 - The Parent property of aaaa is locked, current parent: NULL, new parent PlayerGui
Have you called :Destroy() on aaaa in any of your scripts?
no
Ew don't do that. Don't modify GUI on the server.
why is it bad? i thought it would be easier than doing it locally