I am trying this script out but it won't work. I looked at the output and not showing there. But the goal of the script is not working.... Here is the script:
script.Parent.MouseClick:Connect(function() game.StarterGui.NpcChat.Background.Visible = true end)
Key: NpcChat = ScreenGui Background = Frame Parent = a dummy r6 model
(The goal of this script is that when you click the Npc's torso, a frame appears)
Currently the Background is not visible and I'm really confused... Is there anything I need to change in the StarterGuy? Or is their a error? Please help!
I think what you could do is put a click detector in the torso and do a .MouseClicked event, then just set the frame Visiblity = true if it has been clicked.
StarterGui
is not the authentic storage location of the local UI. Each Player has their own GUI container called PlayerGui
. Upon joining, all the contents of StarterGui
are actively moved into said container to effectively give the Player their own UI. This is done because if all GUI Objects get stored and read from one place, such a StarterGui
, everyone would see the same GUI appear, and would loose the personal use of their own screen.
You need to call upon the Players
PlayerGui` container to actively manage their UI properly.
local ClickDetector = script.Parent ClickDetector.MouseClick:Connect(function(PlayerClicked) PlayerClicked.PlayerGui.NpcChat.Background.Visible = true end