Hello, my name is SuperPogr!
Here I will ask for your help to help me improve my script. So in this script I want to create an object that when clicked will display a UI that contains the question “Do you want to grab this thing?” and after that is the option Yes or no well this is where my problem is when pressing the yes or no button I try to hide the UI by using
--Script inside yes and no button
local Grab = game.StarterGui.ScreenGui.GrabGui --Local
script.Parent.MouseButton1Click:Connect(function() --ClickDetector Setting
script.Parent.Visible = false --"No" button become invisible
Grab.Visible = false --Ui suppose to be invisible
end)
The following is also a script in the part that will be pushed by the player and will bring out the UI.
local Part = game.Workspace.Part
local TextUI = game.Workspace.Part.BillboardGui.TextBoxUI
local Edge1 = game.Workspace.Edge.Edge1
local Edge2 = game.Workspace.Edge.Edge2
local Edge3 = game.Workspace.Edge.Edge3
local Edge4 = game.Workspace.Edge.Edge4
local Edge5 = game.Workspace.Edge.Edge5
local Edge6 = game.Workspace.Edge.Edge6
local Edge7 = game.Workspace.Edge.Edge7
local Edge8 = game.Workspace.Edge.Edge8
local Edge9 = game.Workspace.Edge.Edge9
local Edge10 = game.Workspace.Edge.Edge10
local Edge11 = game.Workspace.Edge.Edge11
local Edge12 = game.Workspace.Edge.Edge12
script.Parent.ClickDetector.MouseClick:Connect(function(player)
player:WaitForChild("PlayerGui").ScreenGui.GrabGui.Visible = true --change it into "true"
Edge1.Transparency = 0
Edge2.Transparency = 0
Edge3.Transparency = 0
Edge4.Transparency = 0
Edge5.Transparency = 0
Edge6.Transparency = 0
Edge7.Transparency = 0
Edge8.Transparency = 0
Edge9.Transparency = 0
Edge10.Transparency = 0
Edge11.Transparency = 0
Edge12.Transparency = 0
wait(2)
Edge1.Transparency = 1
Edge2.Transparency = 1
Edge3.Transparency = 1
Edge4.Transparency = 1
Edge5.Transparency = 1
Edge6.Transparency = 1
Edge7.Transparency = 1
Edge8.Transparency = 1
Edge9.Transparency = 1
Edge10.Transparency = 1
Edge11.Transparency = 1
Edge12.Transparency = 1
end)
Video how the UI works
PartUiGrab.wmv (2.3 MB)
Here is a photo from Exlorer
-
StarterGui
-
Part to be clicked
The issue i got
So my problem here is that I can’t make the Ui invisible anymore by pressing the yes/no button.
You can test the game via the following link
Test Game
I would be very grateful if you could help me.