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

GUI frame is not showing up despite having no errors?

Asked by 3 years ago
script.Parent.MouseClick:Connect(function()
    local anSwer = game.StarterGui.shopLore.AnswersFrame
    local questions = game.StarterGui.shopLore.QuestionsFrame
    if anSwer.Visible == false then
        anSwer.Visible = true
    end

end)

here is my simple local script. the script is located in a clickdetector which is located in a character model.

the MainGui is located in the starter gui which has 2 frames(AnswersFrame and QuestionsFrame); Answersframe has a text label and image label while questionsframe has 2 text buttons.

rn i only wanna see the answers frame appear, and I think I did the script correctly so I don't get what's going on. Someone correct me pls thanks

0
is the transparency 0 valk_3D 140 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

you were changing it in starter gui which will only show if you reset or rejoin. They should be changed in player gui

you also said it was in a local script, local scripts CANNOT run inside of workspace (probably why you didnt get any errors (script wasnt running)) make this in a server script

script.Parent.MouseClick:Connect(function(player) -- click detector param (player)
--    local anSwer = game.StarterGui.shopLore.AnswersFrame
 --   local questions = game.StarterGui.shopLore.QuestionsFrame
local anSwer = player.PlayerGui.shopLore.AnswersFrame
local questions = player.PlayerGui.shopLore.QuestionsFrame
    if anSwer.Visible == false then
        anSwer.Visible = true
    end

end)
Ad

Answer this question