Roblox Studio is telling me errors even though they aren't

So my scripts are working as intended but they are still showings errors … It’s for a loading screen:

They’re showing these errors:
image (this is the 1st code)

image (this is the 2nd code)

I tried relaunching studio but it’s still showing me these errors

The scripts are working but it’s just strange because i’m almost sure that I made no mistake while scripting. (Or maybe yes)

If you do find a mistake please tell me!

1st code:

game.Players.PlayerAdded:connect(function(player)
local gui = game.ReplicatedStorage:WaitForChild(“EcranDeChargement”):Clone()
gui.Parent = player.PlayerGui
gui.Script.Disabled = false
end

2nd code:

script.Parent.Frame.Visible = true
local contentprovider = game.ContentProvider

while wait() do
if contentprovider.RequestQueueSize == 0 then
script.Parent.Frame:TweenPosition(UDim2.new(0, 0, -1, 0),“In”,“Quart”)
wait(1)
script.Parent:Destroy()
end
end

Paths: image

image

Also some words are in french sorry about that

On your 1st code. Did you forget to close the connect with )?
For your 2nd code, try checking if the parent exists first, before running script.Parent.Frame:TweenPosition(UDim2.new(0, 0, -1, 0),“In”,“Quart”), as it looks like script.Parent no longer exists once you did script.Parent:Destroy() thus it’ll return nil if it didn’t exist.

1 Like

ok i’ll check and try to fix it thanks

ok thanks now the 1st script is fixed but I didn’t unserstand what do in the 2nd code…

I’m starting to code so I make quite some errors

whelp no response

1 Like

Over here you destroyed the frame, so the second time the loop runs there won’t be any frame left and you won’t be able to tween it.

1 Like