FrameUI is not a valid member of PlayerGui "Players.PLAYERNAME.PlayerGu

Hello,

I was wondering If anybody could perhaps tell me what this error means?
It says "FrameUI is not a valid member of PlayerGui “Players.PLAYERNAME.PlayerGui”

I have copied this from another game of mine that it works on, but when i copy it into another place, it shows this error.

Thanks!

Here is the GUI in StarterGui
image

Can you show the code you have written?

-- -- Player Stuff --

local PlayerService = game:GetService("Players")
local plr = PlayerService.LocalPlayer

--  Uis --

local MainFrames = script.Parent.FramesUI
local Buttons = script.Parent.buttonsUI

-- Sound --

local sound = Instance.new("Sound")
sound.Name = "Sound"
sound.SoundId = "rbxassetid://5852470908"
sound.Volume = 1
sound.Looped = false
sound.Parent = script

--- Tweening Functions --

local function TweenUisIn(Ui)
	Ui:TweenSize(
		UDim2.new(0.381, 0,0.753, 0),
		"In",
		"Quad",
		0.2,
		false
	)
end

local function TweenUisOut(Ui)
	Ui:TweenSize(
		UDim2.new(0.381, 0,0.353, 0),
		"In",
		"Quad",
		0.2,
		false
	)
end

---

local FramesOpen = MainFrames.cashFrame

--- Buttons --

Buttons.mainFrame.mainFrame.boostsFrame.MouseButton1Click:Connect(function() -- BoosterSideButton
	FramesOpen:TweenSize(
		UDim2.new(0.381, 0,0.353, 0),
		"In",
		"Quad",
		0.2,
		true
	)
	FramesOpen.Visible = false
	MainFrames.boostsFrame.Visible = true
	MainFrames.boostsFrame:TweenSize(
		UDim2.new(0.381, 0,0.753, 0),
		"In",
		"Quad",
		0.2,
		true
	)
	FramesOpen = MainFrames.boostsFrame
end)

Buttons.mainFrame.mainFrame.cashFrame.MouseButton1Click:Connect(function() -- CashSideButton
	FramesOpen:TweenSize(
		UDim2.new(0.381, 0,0.353, 0),
		"In",
		"Quad",
		0.2,
		true
	)
	FramesOpen.Visible = false
	MainFrames.cashFrame.Visible = true
	MainFrames.cashFrame:TweenSize(
		UDim2.new(0.381, 0,0.753, 0),
		"In",
		"Quad",
		0.2,
		true
	)
	FramesOpen = MainFrames.cashFrame
end)

Buttons.mainFrame.mainFrame.cratesFrame.MouseButton1Click:Connect(function() -- CratesButton
	FramesOpen:TweenSize(
		UDim2.new(0.381, 0,0.353, 0),
		"In",
		"Quad",
		0.2,
		true
	)
	FramesOpen.Visible = false
	MainFrames.cratesFrame.Visible = true
	MainFrames.cratesFrame:TweenSize(
		UDim2.new(0.381, 0,0.753, 0),
		"In",
		"Quad",
		0.2,
		true
	)
	FramesOpen = MainFrames.cratesFrame
end)

Buttons.mainFrame.mainFrame.gearsFrame.MouseButton1Click:Connect(function() -- GearsButton
	FramesOpen:TweenSize(
		UDim2.new(0.381, 0,0.353, 0),
		"In",
		"Quad",
		0.2,
		true
	)
	FramesOpen.Visible = false
	MainFrames.gearsFrame.Visible = true
	MainFrames.gearsFrame:TweenSize(
		UDim2.new(0.381, 0,0.753, 0),
		"In",
		"Quad",
		0.2,
		true
	)
	FramesOpen = MainFrames.gearsFrame
end)

Buttons.mainFrame.mainFrame.rebirthFrame.MouseButton1Click:Connect(function() -- RebirthButton
	FramesOpen:TweenSize(
		UDim2.new(0.381, 0,0.353, 0),
		"In",
		"Quad",
		0.2,
		true
	)
	FramesOpen.Visible = false
	MainFrames.rebirthFrame.Visible = true
	MainFrames.rebirthFrame:TweenSize(
		UDim2.new(0.381, 0,0.753, 0),
		"In",
		"Quad",
		0.2,
		true
	)
	FramesOpen = MainFrames.rebirthFrame
end)

Buttons.mainFrame.mainFrame.shopFrame.MouseButton1Click:Connect(function() -- Shopbutton
	FramesOpen:TweenSize(
		UDim2.new(0.381, 0,0.353, 0),
		"In",
		"Quad",
		0.2,
		true
	)
	FramesOpen.Visible = false
	MainFrames.shopFrame.Visible = true
	MainFrames.shopFrame:TweenSize(
		UDim2.new(0.381, 0,0.753, 0),
		"In",
		"Quad",
		0.2,
		true
	)
	FramesOpen = MainFrames.shopFrame
end)

Buttons.mainFrame.mainFrame.OpenCashFrame.MouseButton1Click:Connect(function() -- CashButtonFrame
	FramesOpen:TweenSize(
		UDim2.new(0.381, 0,0.353, 0),
		"In",
		"Quad",
		0.2,
		true
	)
	FramesOpen.Visible = false
	MainFrames.cashFrame.Visible = true
	MainFrames.cashFrame:TweenSize(
		UDim2.new(0.381, 0,0.753, 0),
		"In",
		"Quad",
		0.2,
		true
	)
	FramesOpen = MainFrames.cashFrame
end)

The fact that FramesUI isn’t apart of PlayerGUI means it loads in and the player isn’t loaded in yet. I would try put the script outside of the GUI and change the following

Change:

To:

local MainFrames = script.Parent.Parent:WaitForChild("FramesUI")

Nothing opens when I click anything on the ui.

It now has an Infinite Yield warning.
image

You’re trying to find a frame inside the player…? I don’t see any Players.2664k.PlayerGui anywhere…?

1 Like

Can u show me your whole Explorer

image

Have you tried

YOURSCREENGUIHERE.Parent = game.Players.LocalPlayer.PlayerGui

?

Is this Script from MainTweeningHandler?

yes.

idk try this…

-- -- Player Stuff --

local PlayerService = game:GetService("Players")
local plr = PlayerService.LocalPlayer
local PlayerGui = plr:WaitForChild("PlayerGui")

--  Uis --

local MainFrames = PlayerGui:WaitForChild("FramesUI")
local Buttons = PlayerGui:WaitForChild("buttonsUI")
1 Like

Working, thanks alot! It’s working now.

1 Like