I tried to make a random position script inside a part to go into randomly chosen CFrames that are being held in a variable.
positions = "-5.8, 0.1, -11.3" , "8.2, 0.1, -25.3" , "-25.8, 0.1, -14.7" , "8.6, 0.1, 6.3"
while true do
wait(1)
script.Parent.CFrame = Vector3.new(1, #positions)
end
It doesn't seem to work though, every time I use Vector3 instead of CFrame, it says this in the output:
Workspace.BUX.Teleporter:4: bad argument #3 to 'CFrame' (CFrame expected, got userdata)
When I use CFrame instead of Vector3, I get this:
Workspace.BUX.Teleporter:4: bad argument #1 to 'new' (Vector3 expected, got number)
I made an alternative script, but people can cheat the game by staying in the same place:
while true do
script.Parent.CFrame = CFrame.new(-5.8, 0.1, -11.3)
wait(1)
script.Parent.CFrame = CFrame.new(8.2, 0.1, -25.3)
wait(1)
script.Parent.CFrame = CFrame.new(-25.8, 0.1, -14.7)
wait(1)
script.Parent.CFrame = CFrame.new(8.6, 0.1, 6.3)
wait(1)
script.Parent.CFrame = CFrame.new(-25.8, 0.1, -14.7)
wait(1)
script.Parent.CFrame = CFrame.new(-5.8, 0.1, -11.3)
wait(1)
script.Parent.CFrame = CFrame.new(8.2, 0.1, -25.3)
wait(1)
end

1 comment
It works! Thank you.