So I have this error that says AnimationFrame is not a valid member of PlayerGui “Players.venomousgamerthe4.PlayerGui” and it showing on this line.
local LevelFrame = Startergui.AnimationFrame.MainFrame
I go on Explorer and lo and behold it right there.

I genuinely don’t know how to fix this. I checked to see if I had a spelling error or something but I don’t
1 Like
StarterGui holds contents that replicate to PlayerGui. You can access your frame using the following lines:
local Players = game:GetService("Players")
local PlayerGui = Players.LocalPlayer:WaitForChild("PlayerGui")
local LevelFrame = PlayerGui.AnimationFrame.MainFrame
This belongs in local script. That’s the place where you should take care of player’s graphical interface. I assume you have your script stored in StarterPlayerScripts or StarterCharacterScripts. The easiest way would be to place it inside your AnimationFrame. That way you can use relative paths. If script is inside MainFrame, you can access it from there by typing:
local LevelFrame = script.Parent
You can also access PlayerGui from server, for instance by using the following code:
game:GetService("Players").PlayerAdded:Connect(function(player)
local gui = player:WaitForChild("PlayerGui")
local LevelFrame = gui:WaitForChild("AnimationFrame").MainFrame
end)
However, it is without doubt better to handle visual appearance client-side. That’s why StarterGui exists. It’s not “server’s concern” what client sees directly on their screen when it comes to GUIs. Handling every player’s visuals would burden the server significantly, and at the same time not be effective, since exploiters can change what they see on their machine.
There are only specific cases when server should interfere. For example, if some GUI has to be inserted or removed.
2 Likes
You’re refering to StarterGUI not PlayerGui where the MainFrame actually is…
Clearly my inability to read PlayerGui on the screenshot is my bad
Actually, once the game is run all children of StarterGui get put into PlayerGui.
Can you please refer where you put the code?