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

My gui is not visible in game when told to be visible. What do I do?

Asked by 5 years ago
Edited 5 years ago
local code = script.Parent.Parent.Code
local Pass = script.Parent.Parent.Pass
local Admin = game.StarterGui.ScreenGui.Admin



script.Parent.MouseButton1Click:Connect(function()
    if Pass.text == code.Value then
        script.Parent.Text = 'Correct'
        wait(2)
        script.Parent.Parent.Visible = false
        Admin.Visible = true
        Admin.Active = true
    else script.Parent.Text = 'Incorrect'
        wait(2)
        script.Parent.Text = 'Try Again'
    end
end

ok so I have a locked gui(admin panel) that when it puts a password in it should open the admin frame it makes it visible but the admin frame is not showing do I have a problem in my code? I also have a Rainbow script that Makes the border color change colors

function zigzag(X) return math.acos(math.cos(X*math.pi))/math.pi end

counter = 0

while wait(0.2)do
 script.Parent.BorderColor3 = Color3.fromHSV(zigzag(counter),1,1)

 counter = counter + 0.01
end


0
~~game.StarterGui~~ greatneil80 2647 — 5y
0
Greatneil80? chulodertoten 2 — 5y
0
I dont understandd chulodertoten 2 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

The above comment means this: the player's gui is found in the PlayerGui object, not the StarterGui once you are in a game.

Simply change Line 3 to

local player = game:GetService("Players").LocalPlayer
local Admin = player:WaitForChild("PlayerGui"):WaitForChild("ScreenGui"):WaitForChild("Admin")
Ad

Answer this question