So I was trying to make a CFrame, and got this error:
Invalid number of arguments: 4 - Server - Script:8
Here is my script:
local startPosition = game.Workspace.StartPosition
local Block = script.Parent
local Position1 = game.Workspace.Position1
local lastPosition = game.Workspace.LastPosition
while true do
wait(10)
Block.CFrame = CFrame.new(startPosition.Position,Position1.Position,lastPosition.Position,Position1.Position)
wait(5)
end
i was pretty confused with what you were trying to achieve, but from the code you provided it seemed like you were trying to make a block go back and fourth. the thing you did wrong was put in several positions in one place. here’s the fixed script:
local startPosition = game.Workspace.StartPosition
local Block = script.Parent
local Position1 = game.Workspace.Position1
local lastPosition = game.Workspace.LastPosition
while true do
wait(10)
Block.Position = Vector3.new(startPosition.Position)
wait(1) -- put in the time you want to wait for the block to move
Block.Position = Vector3.new(Position1.Position)
wait(1) -- put in the time you want to wait for the block to move
Block.Position = Vector3.new(lastPosition.Position)
wait(1) -- put in the time you want to wait for the block to move
Block.Position = Vector3.new(Position1.Position)
wait(5)
end
Your post really doesn’t give any proper information, all you’re saying is “Trying to make a CFrame” which doesn’t make any sense to me. If you just want the problem to be solved, then its just that you passed on 4 arguments to CFrame.new()
Instead of doing position do CFrame so
while true do
wait(10)
Block.CFrame = CFrame.new(startPosition.CFrame,Position1.CFrame,lastPosition.CFrame,Position1.CFrame)
wait(5)
end