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

Need help with a Gui involving a text button opening a Gui?

Asked by 8 years ago
Edited 8 years ago

Here is my current code...

NOTE: This is a local script, it is in the submitbutton

local plr = game.Players.LocalPlayer
local gui = plr.PlayerGui.godus.Frame
local textbox = plr.PlayerGui.ENGINE.Background.TextBox
local code = "test"

script.Parent.MouseButton1Click:connect(function(submitcode)
if textbox.Text == code then
gui.Visible = true
end
end)

0
What are you trying to do with this code, also the "~~~~~~~~~~~~~~~~~" must be on its own line User#5423 17 — 8y
0
I'm trying to make a gui open when a specfic code is entered in the textbox Unicodium 0 — 8y
0
Can you confirm that the event is being ran by adding a print at the 1st line of the mouseButton1Click User#5423 17 — 8y
0
Here is the output for the gui : 14:03:55.090 - godus is not a valid member of PlayerGui 14:03:55.091 - Script 'Players.Player1.PlayerGui.ScreenGui.Background.SubmitButton.LocalScript', Line 2 14:03:55.091 - Stack End Unicodium 0 — 8y
View all comments (3 more)
0
godus is the other gui that I've been trying to open... Unicodium 0 — 8y
0
I see try plr.PlayerGui:waitForChild('godus').Frame thiw will eather stop the script as the gui is not found or will wait till its found. In both cases the problem is how you are trying to access the gui User#5423 17 — 8y
0
Where do insert that piece of code? Unicodium 0 — 8y

1 answer

Log in to vote
0
Answered by
Bulvyte 388 Moderation Voter
8 years ago
Edited 8 years ago

if textbox.Text == code Here i think u made a mistake, if the text doesn't exist make it visible

Try this.

Replace your line

if textbox.Text == code

With:

if textbox.Text ~= code
0
Tried it, the other gui didn't open :v Unicodium 0 — 8y
Ad

Answer this question