Can't locate gui

So I have a gui that when you press the button it activates, but I placed inside starter pack to make it easier and to have the same variables. But for some reason it says the screen gui is nil even though it exsists.
Output:

PowersGui is not a valid member of PlayerGui "Players.SilentSuprion.PlayerGui"

Script:

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

PlayerGui.PowersGui.Holder.Button1.MouseButton1Down:Connect(function()
	if Debounce == false  then
		Debounce = true
		Event:FireServer(Player)
		local RightSlash = Player.Character.Humanoid:LoadAnimation(Animation)
		RightSlash:Play()
		Speed()
		wait(Cooldown)
		Debounce = false
	end
	end)
end)

ScreenShot:
Screenshot 2021-07-25 130435
Thanks for reading

Try using PlayerGui:WaitForChild("PowersGui"), as there can be delays in how fast GUIs are cloned into PlayerGui from StarterGui.

I hope this helps!

2 Likes