Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

My Gui is not moving after I teleport into the game?

Asked by 6 years ago

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

01TeleportGui = game.StarterGui:WaitForChild("TeleportGui")
02Frame = TeleportGui:WaitForChild('Frame')
03ImageLabel = Frame:WaitForChild('ImageLabel')
04ContentProv = game:GetService("ContentProvider")
05TP = game:GetService("TeleportService")
06 
07 
08if TP.LocalPlayerArrivedFromTeleport then
09repeat
10        ImageLabel.Rotation = ImageLabel.Rotation + 1
11        wait()
12until  
13ContentProv.RequestQueueSize == 0
14end
15 
16if ContentProv.RequestQueueSize == 0 then
17    Frame:TweenPosition(UDim2.new(100,100,100,100,'Linear',9))
18end
0
what were u thinking? TheluaBanana 946 — 6y

1 answer

Log in to vote
4
Answered by 6 years ago
Edited 6 years ago

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.

01TeleportGui = game:GetService("Players").LocalPlayer:WaitForChild("TeleportGui")
02Frame = TeleportGui:WaitForChild('Frame')
03ImageLabel = Frame:WaitForChild('ImageLabel')
04ContentProv = game:GetService("ContentProvider")
05TP = game:GetService("TeleportService")
06 
07 
08if TP.LocalPlayerArrivedFromTeleport then
09repeat
10        ImageLabel.Rotation = ImageLabel.Rotation + 1
11        wait()
12until  
13ContentProv.RequestQueueSize == 0
14Frame:TweenPosition(UDim2.new(100,100,100,100),'Out','Linear',9)
15end

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.

Ad

Answer this question