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

How Do I Get This WATER To Move Up And Down Constantly?

i = 1
while true do
for i = i, 5 do
P = script.Parent	
	P.Position = Vector3.new(0,1,0)
	wait(1)
	P.Position = Vector3.new(0,-1,0)
end
end

What I did was made the script - Or at least tried - to make this part/baseplate to move up and down constantly. Going 5 up and -5 down. I assumed if the 'for' loop ran 5 times, it'd make them move a little. Which it didn't work at all. Because as soon as the script starts. It makes the part/baseplate move up and then never runs or move the part at all.

Help?

1 answer

✓ Accepted answer

If you change the position on an anchored part, it won't change anything, use CFrame instead.

while wait(1) do
for i = 1,5,1 do
	wait(.4)--you can change all the waits()
P = script.Parent   
    P.CFrame = CFrame.new(0,i,0)
if i==5 then
	break
end
end
wait(1)
for i = 5, 1,-1 do  
	wait(.4)
    P.CFrame = CFrame.new(0,i,0)
if i==1 then 
	break
end
end
end

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