i was making a game and in the starting i got again question and keeping this error for a while the script type is: script. so in Y position i tried to edit it and somehow it pop ups this error: 18:55:45.133 - Vector3 is not a valid member of Vector3. is that a bug or an real error? please explain me. heres the script:
wait(5) local currPOS = script.Parent.Position local infstring=1 repeat currPOS.Vector3.new(script.Parent.Position.X , script.Parent.Position.Y + 0.25 , script.Parent.Position.Z) wait(0.25) currPOS.Vector3.new(script.Parent.Position.X , script.Parent.Position.Y + 0.25 , script.Parent.Position.Z) wait(0.25) currPOS.Vector3.new(script.Parent.Position.X , script.Parent.Position.Y + 0.25 , script.Parent.Position.Z) wait(0.25) currPOS.Vector3.new(script.Parent.Position.X , script.Parent.Position.Y + 0.25 , script.Parent.Position.Z) wait(0.25) currPOS.Vector3.new(script.Parent.Position.X , script.Parent.Position.Y - 0.25 , script.Parent.Position.Z) wait(0.25) currPOS.Vector3.new(script.Parent.Position.X , script.Parent.Position.Y - 0.25 , script.Parent.Position.Z) wait(0.25) currPOS.Vector3.new(script.Parent.Position.X , script.Parent.Position.Y - 0.25 , script.Parent.Position.Z) wait(0.25) currPOS.Vector3.new(script.Parent.Position.X , script.Parent.Position.Y - 0.25 , script.Parent.Position.Z) until infstring == 0
Like Bash and I said in the comments, you're getting the error because position is vector3 value and you are trying to get a vector3 of a vector3. If you want to change the position,
you'd instead do script.Parent.Position = Vector3.new(posX, posY, posZ)
posX, posY, and posZ being some numbers.
Here's what I was talking about in the comments when I said you could shorten your code into a for loop:
Also, I have a question for you, infstring is always going to be 1 in this example, what are you trying to do?
--idk what script parent is so i'm naming it foo for now. try to think of a better name for script.Parent please. local foo = script.Parent wait(5) local infstring=1 repeat --reapeat code inside for loop 4 times for i = 1, 4 do script.Parent.Position = Vector3.new(foo.Position.X , foo.Position.Y + 0.25 , foo.Position.Z) wait(0.25) end --reapeat code inside for loop 4 times for i = 1, 4 do script.Parent.Position = Vector3.new(foo.Position.X , foo.Position.Y - 0.25 , foo.Position.Z) wait(0.25) end until infstring == 0