You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
a button goes in and out -
What is the issue? Include screenshots / videos if possible!
i don’t see anything happen -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
where do i need to look
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
--script
button = script.Parent
local debounce = false
button.ClickDetector.MouseClick:Connect(function()
print("You clicked me!")
if debounce then
return ''
else
debounce = true
end
local holder = script.Parent.Parent.Holder
local TweenService = game:GetService("TweenService")
local TweenTime = 5
local TweenInfoIn = TweenInfo.new(
TweenTime,--time
Enum.EasingStyle.Back,
Enum.EasingDirection.Out,
0,
false,
0
)
local goalIn = {Position = holder.Position,Orientation = holder.Orientation}
local tween1 = TweenService:Create(button,TweenInfoIn,goalIn)
tween1.Completed:Wait()
wait()
local TweenInfo_ = TweenInfo.new(
TweenTime,--time
Enum.EasingStyle.Back,
Enum.EasingDirection.In,
0,
false,
0
)
local goal = {Position = holder.Position + Vector3.new(0,0,-1),Orientation = holder.Orientation}
local tween2 = TweenService:Create(button,TweenInfo_,goal)
tween2.Completed:Wait()
wait()
debounce = false
end)
no errors