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

Help me with Welcome GUI. Can someone help me?

Asked by 10 years ago

I have made a GUI for my game. But everytime when I hit play on my GUI it doesn't close down that GUI. Can someone fix the script of it. I got part of it, but it isn't working. http://www.roblox.com/GUI-item?id=183072897

1 answer

Log in to vote
1
Answered by 10 years ago

I have checked out your script, there was nothing wrong with it, but I edited it anyway;

print("Gui Closer Located and initiated.") --This worked

local function onClicked(GUI) --Before, you didn't use 'GUI'
if GUI then --This checks if 'GUI' exists
GUI:Destroy() --This will Destroy the 'GUI'
end --This ends the code block for the 'if' statement
end --This ends the code block for the function

script.Parent.MouseButton1Down:connect(function() --This will, eh, I forgot, but this will connect the Event to the function
onClicked(script.Parent.Parent.Parent) --When the TextButton is clicked, it'll destroy the GUI
end) --This ends the code block for the Event/function

Another thing I noticed was that you were using a 'Script' type instance for the GUI, Roblox did an Update so that you [I think] can only use 'LocalScript' type instances for Client-Sided scripts, so, try using a 'LocalScript' for your Script, and maybe it'll work. :) Hope this helped!

0
Thank you TheAlphaStigma. I haven't tried yet, but I am glad I got an answer from you and you helped me out. May God bless you. User#5689 -1 — 10y
0
No problem :) I was glad to help you out. :) TheeDeathCaster 2368 — 10y
Ad

Answer this question