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

How do I fix error for calling Vector3 with incorrect arguments?

I'm trying to move a part for Z+0.001 and that works, but I want to make it so if the position is -29.185, 114.095, 85.489 then it will teleport part back to -29.185, 114.095, 0.927 where he started. But it sends me this error:

  • Trying to call method on object of type: Vector3 with incorrect arguments.
  • Stack Begin -.......Part.Script', Line 9
  • Stack End
local part = script.Parent
local X = part.Position.X
local Y = part.Position.Y
local Z = part.Position.Z
while true do
	wait(0.1)
	part.CFrame = CFrame.new(X, Y, Z+0.001)
	if part.Position(-29.185, 114.095, 85.489) then -- This is the position that when parts goes to, then it turns him back to his starting position
		part.CFrame = CFrame.new(-29.185, 114.095, 0.927) --Starting position
	end
end


Can someone help me plz?

1 answer

local part = script.Parent
local X = part.Position.X
local Y = part.Position.Y
local Z = part.Position.Z
while true do
    wait(0.1)
    part.CFrame = CFrame.new(X, Y, Z+0.001)
    if part.Position = Vector3.new(-29.185, 114.095, 85.489) then--im sure you understand
        part.CFrame = CFrame.new(-29.185, 114.095, 0.927) --Starting position
    end
end


1 comment

0

It's not working, part moves for Z+0.001 but almost instant teleports back to starting position

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