-
What do you want to achieve? Keep it simple and clear!
I wanna make open & close button, but i don’t know what to do -
What is the issue? Include screenshots / videos if possible!
I don’t know what to do -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tryed to add loops, but didn’t help. No i didn’t
Here is my code:
local button = script.Parent
local clicks = 0
local DB = false
local Image = script.Parent.Parent.ImageLabel
local buttonGUI = game.Players.LocalPlayer.PlayerGui.MissionsButtonCloseGUI.Frame
local Bar = game.Players.LocalPlayer.PlayerGui.MissionsGUI.Bar
local Mission1 = game.Players.LocalPlayer.PlayerGui.MissionsGUI.Mission1
local TweenService = game:GetService("TweenService")
if clicks == 0 then
button.MouseButton1Click:Connect(function()
Bar:TweenPosition(UDim2.new(-0.002, 0,0.924, 0),"Out","Sine",2,false)
Mission1:TweenPosition(UDim2.new(0.05,0, 0.803, 0),"Out","Sine",2,false)
buttonGUI:TweenPosition(UDim2.new(0.45, 0, 0,435, 0),"Out","Sine",2,false)
clicks = clicks - 1
while Image.Rotation >= 91 do
Image.Rotation = Image.Rotation - 10
wait(0.01)
end
end)
end
This code only opens, i need to rework it for open & close