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

Can someone teach me how to use GuiObject:TweenPosition() ?

Asked by 4 years ago

So I am trying to tween a GUI. I looked at some tutorials and they did not make sense to me or were outdated. Not requesting anything just need to know what it is. Thanks for reading!

2 answers

Log in to vote
1
Answered by 4 years ago

Just write the UDim2 value that you want it to move to and the movement direction, style and time taken moving. example:

script.Parent:TweenPosition(UDim2.new(0,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.5)

This makes the GuiObject move to the corner in while being faster at the beginning and slower in the end (EasingDirection.Out), makes it move in a linear fashion (EasingStyle.Linear), and does that all in 0.5 seconds. You don't need to write the starting place because it automatically moves to the place you want it in the required time. For more info and easing properties (to make it move in a different style) check out the dev hub's article on tweening: Tweening Article

0
I have a question, can exploiters move these gui’s around since it’s in there client? 123nabilben123 499 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Hi,

in my example, I use a TextLabel object, which I put in StarterGUI -> ScreenGUI and make it invisible for startup. Later I call this in a local script:

local coinBubble = player.PlayerGui.ScreenGui.PointLabel:Clone()

coinBubble.Parent = player.PlayerGui.ScreenGui

coinBubble.Visible = true

coinBubble:TweenSizeAndPosition(UDim2.new(0.4, 0, 0.4, 0), UDim2.new(0.5, 0, 0.5, 0))

wait(0.7)

coinBubble:Destroy()

So, I clone the Textlabel, make the current players ScreenGUI its parent, tween it and after while destroy it again.

0
I have a question, can exploiters move these gui’s around since it’s in there client? 123nabilben123 499 — 4y
0
@123nabilben123 yes they can but it doesn BlackOrange3343 2676 — 4y
0
doesn't matter since their hacking their own gui. They can't access other players gui BlackOrange3343 2676 — 4y
0
@BlackOrange3343 I am making a case opening system and I need to detect the slot the roll has stopped on. I don’t want the exploiters to change the slots around and make them get a certain class they want. Is there another way to detect what slot the roll has stopped? 123nabilben123 499 — 4y

Answer this question