Error with tweening

Hello, I made a script that tween a image color to green

But nothing is happening, here is the script:

local loadingUIcube = game:GetService("StarterGui").adminPanel.LoadingScreen.loadingTheUI.cube
local connectingAPIcube = game:GetService("StarterGui").adminPanel.LoadingScreen.connectingToAPI.cube
local connectingDataCube = game:GetService("StarterGui").adminPanel.LoadingScreen.connectingDataBase
local finishingCube = game:GetService("StarterGui").adminPanel.LoadingScreen.finishingUp
local TweenService = game:GetService("TweenService")

-- // Start coding...

wait(3)
--
local TweenService = game:GetService("TweenService")
local transitionInfo = TweenInfo.new(0.5, Enum.EasingStyle.Back)


local tween = TweenService:Create(loadingUIcube, transitionInfo, {ImageColor3 = Color3.fromRGB(255, 128, 0)})
tween:Play()





I think the issue stems from you altering something in the StarterGui model instead of the Player’s specific Gui.

You can do this by:

local loadingUIcube = game.Players.LocalPlayer.PlayerGui.adminPanel.LoadingScreen.loadingTheUI.cube

This will access the UI that the player is currently look at. You should consult this article to better get familiar with the StarterGui folder and how it actually copies objects to the PlayerGui folder for each player when they join the game and when they respawn.
StarterGui (roblox.com)

Let me check it. like changing the vars path to the player gui?

1 Like

Correct. Everything in the StarterGui gets cloned into the player’s PlayerGui when they join. Changing the StarterGui doesn’t do anything.

Yes, @therikald has the right idea.

Make sure this script is running client side then add this line,
local playerGui = game:GetService("Players").LocalPlayer.PlayerGui
then you can just call playerGui for this particular player’s Gui.