I am essentially scripting a drop-down screen that hangs from a roof.
Collapsed Data: Position: -37.907, 29.45, -175.686 Size: 46.2, 0.1, 0.514
Expanded Data: Position: -37.907, 20.55, -175.686 Size: 46.2, 22.1, 0.514
Below is my thought process. I've tried using various for loops, but I have run into the issue of the part expanding in both directions, whereas I only need it expanding down and back up. The button referenced is a GUI button that acts as a toggle.
--[[ Coded by: wattleman Date: 09/10/2018 Purpose: To lower/raise the screen (change the size). --]] debounce = false print (debounce) if(not debounce) then debounce = true --Variables screen = game.Workspace.SlidingScreen.Screen button = script.Parent --Functions function switch() if screen.Size == Vector3.new(46.2, 22.1, 0.514) then -- Checks if the screen is lowered, else, lower the screen. slideUp() else slideDown() end end function slideUp() --Raise the screen. button.Style = "RobloxRoundButton" end function slideDown() --Lower the screen. button.Style = "RobloxRoundDropdownButton" end --Final debounce = false end --Trigger script.Parent.MouseButton1Click:Connect(switch)