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

How come this local script does not make a frame appear when clicked?

Asked by 3 years ago
Edited 3 years ago
script.Parent.MouseButton1Click:Connect(function()
    game.StarterGui.WhichGive.BACKVIII.Visible = true
end)

BACKVIII is the Frame I wanted the script to make visible.

2 answers

Log in to vote
0
Answered by 3 years ago

The problem is that you put StarterGui instead of the PlayerGui

Fixed code here:

local player = game.Players.LocalPlayer
local playerGui = player:FindFirstChild("PlayerGui")

script.Parent.MouseButton1Click:Connect(function()
    playerGui.WhichGive.BACKVIII.Visible = true
end)

also make sure this is in a localscript

0
cool now i just need to figure out how to make the frame invisible aftrer clicking again Jakob_Cashy 79 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

There's something weird going on with your brackets

0
What do you mean? Jakob_Cashy 79 — 3y
0
when you wrote: (function() Pigred72 0 — 3y
0
It is supposed to be that way Pigred72. Jakob_Cashy 79 — 3y

Answer this question