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

How can I get a TextLabel re-positioning script working?

Asked by 9 years ago

I want my menu to slide from off the screen to centered on the screen after my intro is done.

I learned from a friend to use something like this:

for i = 1 do

The thing is, I'm new to scripting, and I want a script to move this frame simply without requiring me to manually put in:

wait(0.01)
script.Parent.blablabla.blablabla.blablabla.Position = {0,0.01},{0,0}

Can someone help me out with this?

2 answers

Log in to vote
2
Answered by 9 years ago

You could also use :TweenPosition

ThingYouWantMoving:TweenPosition(UDim2.new(new position )
Ad
Log in to vote
-1
Answered by
Relatch 550 Moderation Voter
9 years ago

You're problem is rather simple. You need to use UDim2.new when positioning. You were in the right direction, but you only need to fix that. Just remember, UDim2.new is for gui's. Not parts.

while wait(0.01) do
    script.Parent.blablabla.blablabla.blablabla.Position = script.Parent.blablabla.blablabla.blablabla.Position + UDim2.new(0, 0.01, 0, 0)
    if script.Parent.blablabla.blablabla.blablabla.Position == UDim2.new(0, 0, 0, 0) then --change this to the position you want it to stop at
        break --breaks the loop, basically making it quit
    end
end

Link to the UDim2.new wiki page

UDim2

0
Will this loop? What I mean is it will keep moving. User#4422 0 — 9y
0
Ah, i see what you want. Relatch 550 — 9y
0
The current position is {-1,0},{0.2,0} and I want it to stop at {0.2,0},{0.2,0}. User#4422 0 — 9y

Answer this question