Hello readers! My name is Dev_Cron aka Cron. I’m a Builder/Scripter. And I’d like to get someone help in the following script.
What happened?
I made a part with TweenPosition. When you click the part it will do Tween. It’s working with ClickDetector. My question is what can I add to the script that if I click it again the tween will change from + Vector3.new(0, 0, 8) to - Vector3.new(0, 0, 8) ?
The current script:
local ClickDetector = script.Parent.ClickDetector
local Part = script.Parent.Parent.ForTest
local TweenService = game:GetService("TweenService")
ClickDetector.MouseClick:Connect(function(click)
wait()
local PartTween = TweenService:Create(Part, TweenInfo.new(1), {Position = Part.Position - Vector3.new(0, 0, 8)})
PartTween:Play()
end)