# Need help with making a PART RISE THEN STOP (should be simple)

I want to make part that a rises until it reaches a certain point.

The issue is that I can’t figure out how the code is meant to work so I am having trouble. It’s probably a simple fix. I am new to scripting which is another reason I can’t figure out this code so please keep it simple. Whenever I run the code, it says “Vector3 is not a valid member of Vector 3” which is in the if statement. Just so you know that in the picture the Output menu is slightly incorrect because I changed it after I ran the code but the problem is still the same.

I have searched youtube tutorials on if statements and since this is a very specific problem I don’t know if I will be able to find it in the forum.

Thanks for helping! I am sure I am just not very smart and that this is a rookie mistake.
I am a modeller but not a scripter but I am trying to learn scripting
Can you please tell me how to fix the if statement at the bottom of the script.

Edit: I fixed one part of the if statement but it still doesn’t work.

In the line 23 you’re doing

``````if DumbJuiceFlood.Position.Vector3(20.5, 8.3, 12) == false then ...
``````

`DumbJuiceFlood.Position` is already a Vector3, what are you trying to check?

Edit: IF you want to make sure the `DumbJuiceFlood` position is not a `Vector3.new(20.5, 8.3, 12)`, just do what @domboss37 said

3 Likes

I believe you meant `if DumbJuiceFlood.Position ~= Vector3.new(20.5, 8.3, 12) then`

1 Like

Thank you both Tobi and TSL for the help, It stopped the error from occurring but it still doesn’t rise.

Edit: niceMike40, I didn’t realise you could do that. I tried it, it still doesn’t work but thanks.

You also generally don’t want to compare entire vectors like this. It looks like you just care about the Y position.

Also you can’t do exact equality checks on decimal numbers so you’ll have to use < rather than ~=

``````if DumbJuiceFlood.Position.Y < 8.3 then
``````
4 Likes

Oh! I think I realized what you want, shouldn’t there be a `while` instead of `if` so that it’ll rise until this certain position?

Something like this:

``````while DumbJuiceFlood.Position ~= Vector3(20.5, 8.3, 12) then ...
``````
1 Like

I just realised that, thats probably what I should do instead thanks. It now says that I attempted to call a table value though.

Edit: Here you go

Can you send the error please?

Change `Vector3(20.5, 8.3, 12)` to `Vector3.new(20.5, 8.3, 12)`

2 Likes

Whoops, I should have figured that out by myself. Thanks allot, it worked!!!
Thank you all so much for helping me, each and every comment helped me and made me learn something knew!

2 Likes

I think I messed it up. Anybody know what I did?

Like what @nicemike40 mentioned, you should only check the Y axis because that’s the only axis that you are moving in the script. Try something like this:

``````while DumbJuiceFlood.Position.Y ~= 2 do
DumbJuiceFlood.Position += Vector3.new(0,.1,0)
end
``````
1 Like

on line 17 you can also do

``````DumbJuiceFloodSummon.Name = "DumbJuiceFlood"
``````

instead of trying to reference through the workspace

and instead of setting DumbJuiceFlood again you can use the same DumbJuiceFloodSummon variable

you can also do some if statements to make sure that the part doesnt overshoot your target

Hello everybody I found a new way to do which is a timer! I got it working and it works the way I want it to!