local crusher = game.Workspace.Crusher.Crusher if crusher.Position(Vector3.new(57.89, 12.335, 5.205) then crusher.Position(Vector3.new(57.89, -2.665, 5.205) end end)
for some reason "then" has a red underline
Wouldn't you need to change
if crusher.Position(Vector3.new(57.89, 12.355, 5.204) then
To
if crusher.Position == Vector3.new(57.89, 12.355, 5.204)
and remove the end) since theres no event
It is because crusher.Position(Vector3.new(57.89, 12.335, 5.205)
does not have a second closing bracket.
I doubt this would do anything anyway. Its hard to tell what you are trying to do. I assume you want to move the crusher
when it reaches a certain position. If so it should look like this:
local crusher = game.Workspace.Crusher.Crusher if crusher.position == Vector3.new(57.89, 12.335, 5.205) then crusher.Position = Vector3.new(57.89, -2.665, 5.205) end
if crusher.position == Vector3.new(57.89, 12.335, 5.205) then
this is how comparative statements should look, you have the first value (crusher.position
) then a comparative operator (==
) lastly the second value (Vector3.new(57.89, 12.335, 5.205)
). This will only execute the code contained within it when value one is exactly equal to value two.
crusher.Position = Vector3.new(57.89, -2.665, 5.205)
this is how you set variables, you have your first value (crusher.Position
) an equal sign and your second value that you will append to the first (Vector3.new(57.89, -2.665, 5.205)
).
Though I'm not sure if this is the goal.