Made a moving block code… Doesn’t work for some reason, checked more than 5 times.
Changed the code a few times. Do not know what I am doing wrong.
function move(x,y,z)
for i=1,5 do
script.Parent.Position = script.Parent.Position + Vector3.new (x,y,z)
wait(0.1)
end
end
while true do
move(0, -1, 0)
move(0, -1.5, 0)
move(0, 1.5, 0)
move(0, 1, 0)
end
local TweenService = game:GetService("TweenService")
local part = script.Parent
local info = TweenInfo.new(
10, -- how long the tween will take
Enum.EasingStyle.Linear, -- How the tween will play
Enum.EasingDirection.Out, -- which way itll go
5, -- how many times itll repeat
true, -- if you want it to repeat
1 -- delay time
)
local goal = {Position = Vector3.new()}
local tweening = TweenService:Create(part, info, goal)
tweening:Play()
If the code doesnt work try watching a tutorial. I havent used tweening in weeks so i am pretty rusty.