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

GUI Visible yet Not Showing?

Asked by 8 years ago

Heya Guys! I am Currently making a model to where when you click a part a GUI Becomes visible


Menu = game.StarterGui.PopUpMenu.Frame function onClicked() Menu.Visible = true end script.Parent.ClickDetector.MouseClick:connect(onClicked)

For some reason it didnt become visible. While I was testing in character on studio, I scrolled down its Properties and it read Visible. Any help?

3 answers

Log in to vote
0
Answered by
AZDev 590 Moderation Voter
8 years ago

Your problem is that your setting the gui in StarterGui visible. You need to set the gui in the player to visible.

function onClicked(player)
    player.PlayerGui.Menu.Visible = true
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

This should work. Let me know if it doesn't.

Ad
Log in to vote
1
Answered by 8 years ago

StarterGui is where gui's are cloned from, into the player. If you respawn, you will see the changes made. Instead, you need to access the player's PlayerGui. I recommend changing your script to a LocalScript, then making it's code as follows:

local player = game.Players.LocalPlayer

local menu = player.PlayerGui:WaitForChild("PopUpMenu").Frame

script.Parent.ClickDetector.MouseClick:connect(function() -- shorter way of doing functions
    menu.Visible = true
end)
0
Workspace.Model.Menu.Script:3: attempt to index local 'player' (a nil value) TayLife12 69 — 8y
0
Is it a LocalScript? TheDeadlyPanther 2460 — 8y
Log in to vote
-1
Answered by 8 years ago

mamamia Pizza ria.

Answer this question