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

Help with If Then and UDim2?

I want the frame to reach the position (0,50,0,0) and print ok but it won't,why?

frame = script.Parent
wait(1)
print("Start")
frame:TweenPosition(UDim2.new(0,50,0,50),"Out","Bounce",1,false)
if frame.Position == UDim2.new(0,50,0,0)
    then
print("Ok")
end

Edited because I made a typo

1 answer

✓ Accepted answer

You put 0,50,0,50 not 0,50,0,60 You put the below Now it says

frame:TweenPosition(UDim2.new(0,50,0,0),"Out","Bounce",1,false)

not

frame:TweenPosition(UDim2.new(0,50,0,60),"Out","Bounce",1,false)

If you want it to raise please ask me.

WOrking script

frame = script.Parent
wait(5)
print("Start")
frame:TweenPosition(UDim2.new(0,50,0,50),"Out","Bounce",1,false)
wait(1)
if frame.Position == UDim2.new(0,50,0,50) then
print("Ok")
end

Put in script in a frame!!

17 comments

0

By raise I mean it starts at 0,50,0,50 then goes up to 0,50,0,60

0

My bad

0

Well please Accept Answer or at the least Up Vote, thanks!

0

It still doesn't print...

0

I'll give a working script then!

0

It said 0,50,0,0 it says if frame.Position == UDim2.new(0,50,0,0) then

0

wut

0

Try the script I put in the answer.

0

Okay, fixed it. Try the script below "WOrking script".

0

I tried the new working script and it still didn't work. :l

0

Worked for me. Did you put in localscript or script?

0

script

0

Do you want the model?

0

Try it now.

0

It works now,thanks.

0

You're welcome! Oh and thanks for the thumbs up!

0

Why did this get downvoted or why did you remove your upvote?

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