Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Click a brick and a tween gui pops up?

Asked by
Athox 0
3 years ago

so i already have the script when it comes to clicking the gui and the gui coming up and closing. but i need help with making it so that when you click the brick, the gui comes up from the bottom of the screen. i imagine you use tweening but i really am lost on how to do this. thanks!

2 answers

Log in to vote
0
Answered by 3 years ago

I would recommend using this resource as it will help you get a basic understanding of Tweening GUIs.

https://www.youtube.com/watch?v=W-vzIohhWr4&list=PLhieaQmOk7nK9ob348Yc_PTcIyHjDCnem&index=5

Ad
Log in to vote
0
Answered by 3 years ago
local clickDetector = your part, for example workspace.part
local players = game:GetService("Players") 
local localPlayer = players.LocalPlayer
local PlayerGui = localPlayer:WaitForChild("PlayerGui") 


clickDetector.MouseClick:Connect(function()
for i, PlayerGui in pairs(PlayerGui:GetDescendats()) do
if PlayerGui.Name == "Frame" then
PlayerGui:TweenPosition(
UDim2.new(0, 0, 0) -- Edit it up to your guis relative position just change y to 0 or less than that which is -0.1
) 

end
end
end
end)


For click detection you have to put click detector in your selected part. Then you know what to change in the scripf.

For this to work you need a screengui and a frame to it. Your frame name must be what is the script's inputted name. You have to not make a duplicate name of frames otherwise it will select all of the frames. There are other way to get the frame, however I just did get descendants and filter it out it is faster.

For the tweening part just change the xyz position from what is your frame's position. To make it go from bottom to top make sure your gui is y position is at 1 or more than that.

Click these links it may help you:

Click Detector

Tweening

Answer this question