Hello i wanted to make a cave and i noticed it was dark.So I had a idea of putting a spotlight inside a Part too make it brighter then I wanted to make it move back and forth in the cave in a line.
I watched a video on Tweenservice and it worked my part did move but not in a strait line forward.For some reason my Part moved forward and down but i only made it so that it should only move x.Is it heading towards something?
script -
local TweenService = game:GetService("TweenService")
local part = script.Parent
local Info = TweenInfo.new(
5,
Enum.EasingStyle.Linear,
Enum.EasingDirection.In,
-1,
true,
0
)
local Goals =
{
Position = Vector3.new(10,0,0); -- i want it to only move the x position but i moves all of them?
}
local movepartx = TweenService:Create(part, Info, Goals)
wait(1)
movepartx:Play()

5 comments
put it in a code block for god sake
Please put a block gode in goddamnit
whats a code block?
When you press LUA icon there is two line of ~~~~ Put the code inside (not outside) that 2 time of ~~~~~
edit:- fixed codeblock