Gui tween not playing

So I am making a frame move onto the screen when I click a button and I the tween just wont play. I have a local script in Startergui, and other tweens in the game work as well. There are no output errors

This is the full code:

Try a task.wait(0.1) before the tween plays.

1 Like

Also, on line 18, replace it with this: settingsbutton.MouseButton1Click:Connect(function()

2 Likes

I changed both of them and it still doesn’t work

Any errors? Is the settings button a TextButton object?

No errors and it is a text button. The text button has its own tween inside it but i dont know if that effects it or not.

You have to access the UI through the player (game:GetService('Players').LocalPlayer:WaitForChild('PlayerGui'))

I wouldn’t believe it does. This text will be blurred

Where would I put this. Sorry i’m not good at scripting lol

Instead of using game.StarterGui, replace it with game:GetService('Players'):WaitForChild('PlayerGui')

I got an output error saying Infinite yield possible on ‘Players:WaitForChild(“PlayerGui”)’

Yes, thank you for catching that! But the tween wouldn’t play, which is the main purpose for the GUI. If it plays, then they can edit this into the script.

That means that WaitForChild got stuck on PlayerGui. Try this:

local Player = game.Players.LocalPlayer
local PlayerGui = Player.PlayerGui or Player:FindFirstChild("PlayerGui")

Oops, forgot to add LocalPlayer

game:GetService('Players').LocalPlayer:WaitForChild('PlayerGui')

It works! Thank you both for helping me out