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

NPC ShopGUI not opening with no output error?

Asked by
8muq 2
3 years ago
Edited 3 years ago

Right so basically I'm making this script where you click on an NPC's torso and it opens a shop GUI, although printing no error it doesnt work. (Im 70% sure its because i dont know how to use PlayerGUI properly)

EDIT: the script is also in the torso of the NPC if that helps

local ClickDetector = game.Workspace.PassportSeller.Torso.ClickDetector
PlayerGUI = game.Players.LocalPlayer.PlayerGui
ShopGUI = PlayerGUI:WaitForChild("Frame"):WaitForChild("CloseButton")PlayerGUI:WaitForChild("Frame"):WaitForChild("TextLabel")

ClickDetector.MouseClick:Connect(function()
    PlayerGUI.ShopGUI.Visible = true

end)
0
Is it a localscript? Geobloxia 251 — 3y
0
yes 8muq 2 — 3y

Answer this question