So as you can see this is supposed to make my gui move when I join the game you can see LocalPlayerArrivedFromTeleport but its not moving and for the repeat loop only the print works so that means its working just ImageLabel is not moving or any of the guis are not moving
TeleportGui = game.StarterGui:WaitForChild("TeleportGui") Frame = TeleportGui:WaitForChild('Frame') ImageLabel = Frame:WaitForChild('ImageLabel') ContentProv = game:GetService("ContentProvider") TP = game:GetService("TeleportService") if TP.LocalPlayerArrivedFromTeleport then repeat ImageLabel.Rotation = ImageLabel.Rotation + 1 wait() until ContentProv.RequestQueueSize == 0 end if ContentProv.RequestQueueSize == 0 then Frame:TweenPosition(UDim2.new(100,100,100,100,'Linear',9)) end
First error: You're using the StarterGui
instead of the PlayerGui
. You should read over this:
https://wiki.roblox.com/index.php?title=Player_vs._Starter_GUIs
Second of all, you are not closing your UDim2.new() properly on your tween, and you're setting your arguments wrong. Also, you should compact everything together when you can.
TeleportGui = game:GetService("Players").LocalPlayer:WaitForChild("TeleportGui") Frame = TeleportGui:WaitForChild('Frame') ImageLabel = Frame:WaitForChild('ImageLabel') ContentProv = game:GetService("ContentProvider") TP = game:GetService("TeleportService") if TP.LocalPlayerArrivedFromTeleport then repeat ImageLabel.Rotation = ImageLabel.Rotation + 1 wait() until ContentProv.RequestQueueSize == 0 Frame:TweenPosition(UDim2.new(100,100,100,100),'Out','Linear',9) end
You were also missing an EasingDirection. Here's a useful link on how to tween:
https://www.robloxdev.com/api-reference/function/GuiObject/TweenPosition
Also note, that UDim2.new(100,100,100,100)
is way off the screen. If that's what you want, keep it that way.
I wish you luck! Please accept my answer to let me know if it helped you, and leave me a comment if you are confused with anything or if it didn't work.