Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Click a brick and a tween gui pops up?

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

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

This discussion is preserved as it was. New answers, comments, and votes are closed.