Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

You could also use :TweenPosition

ThingYouWantMoving:TweenPosition(UDim2.new(new position )

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

3 comments

0

Will this loop? What I mean is it will keep moving.

0

Ah, i see what you want.

0

The current position is {-1,0},{0.2,0} and I want it to stop at {0.2,0},{0.2,0}.

This discussion is preserved as it was. New answers, comments, and votes are closed.