how do I make a part (for example a coin) move left and right coordinately (first to one side, then it comes back and repeats the process)? I created a script, but the part (coin) does not move correctly. script:
coroutine.resume(coroutine.create(function()
while true do
wait(0.1)
local v = script.Parent.Position
for i = 1,30 do
wait(0.1)
script.Parent.Position = script.Parent.Position + Vector3.new(i/40,0,0)
print('top1')
end
for i = 1,30 do
wait(0.1)
script.Parent.Position = script.Parent.Position - Vector3.new(i/40,0,0)
print('top2')
end
end
end))

4 comments
hey bro, thanks for the script, i copied it and put it here, but it didn't work, the part (coin) was stopped. know what it can be? I also fixed some digit errors, like 'ParToMove' instead of 'PartToMove', which you wrote.
I apologize for that I wrote out the script very quick and wasn't on an editing software so I missed a few mistakes, I have updated my answer
it actually worked! it looks like my Studio was in trouble. Thanks, really!
I'm sorry for saying that it didn't work