Gui Won't open line 41/42

On line 41/42 the Frame won’t go visible. I’ve tried:

Frame.Visible = true

Still won’t go visible what is the possible issue??
Here is what I have set for now:

 Frame.Visible = not Frame.Visible
local Load = script.Parent.Parent.Parent.Load
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Teams = game:GetService("Teams")
local Frame = script.Parent.TeamChanger

Frame.Prisoner.MouseButton1Click:Connect(function()
    Load.Visible = true
    Load.Text = "Loading." 
    wait(1)
    Load.Text = "Loading.." 
    wait(1)
    Load.Text = "Loading..." 
    wait(1)
    Load.Text = "Loading...." 
    wait(1)
    Load.Text = "Successfully Loaded" 
    wait(1)
    Load.Visible = false
    Frame.Visible = false
    ReplicatedStorage.Handler:FireServer("SwitchTeam", tostring(Frame.Prisoner.Name))   
end)

Frame.RCMP.MouseButton1Click:Connect(function()
    Load.Visible = true
    Load.Text = "Loading." 
    wait(1)
    Load.Text = "Loading.." 
    wait(1)
    Load.Text = "Loading..." 
    wait(1)
    Load.Text = "Loading...." 
    wait(1)
    Load.Text = "Successfully Loaded" 
    wait(1)
    Load.Visible = false
    Frame.Visible = false
    ReplicatedStorage.Handler:FireServer("SwitchTeam", tostring(Frame.RCMP.Name))
end)

script.Parent.Switcher.MouseButton1Click:Connect(function()
    Frame.Visible = not Frame.Visible
end)

ReplicatedStorage.Handler.OnClientEvent:Connect(function(Argument, Prompt)
    if not Argument then return end
    if Argument == "HidePrompt" then
        for _, v in ipairs(Players:GetPlayers()) do
            if v.Arrested.Value == true then
                v.Character.HumanoidRootPart.ProximityPrompt.Enabled = false
            end
        end
    elseif Argument == "PlayerTeam" then
        for _, v in ipairs(Players:GetPlayers()) do
            if v.Team == Teams.RCMP then
                if v.Character:FindFirstChild("ArrestTool") then
                    Prompt.Enabled = true
                end
            end
        end
    end
end)

The ScreenGui is enabled?
Also I recommend using task.wait() instead of wait(), its just a more accurate/newer version of wait

1 Like

Are you sure that the code is running? Add a print statement prior to the Frame.Visible bit to try and narrow down the issue

1 Like

Can we see the script and gui’s hierarchy?

1 Like

Yes it is enabled, and thanks I will try that.

I hope this is what you are wanting

I did that and found the issue thanks for the print suggestion

I added too many .parents for the local load part

Thank u everyone!!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.