An Error with opening a shop GUI

So I made it so that if you click on a text button, that is parented to a surface gui, which is on a part, will make the frame of a tool shop gui visible. The problem is when I click on the button, it doesn’t do anything. Here is the script:

script.Parent.MouseButton1Click:Connect(function(player)
player.PlayerGui.ToolShop.Frame.Visible = true
end)

Is there anything wrong?

tell us the error in output

Also assuming this is in starterGUI, you dont need to do

player.PlayerGui.ToolShop.Frame.Visible = true

you can just use script.Parent and so on

It doesn’t show an error in output. That’s why I haven’t been able to debug it.

Is this a screengui, suurfacegui or what

The surface gui is parented to a part in workspace.

is this a local or normal scipt

Local, oof I forgot to put alot of details.

you cant have local scritps in worksapce, change to normal

If it’s a surface GUI that’s parented to a part in the workspace, then the GUI isn’t going to be in the player’s playergui.

1 Like

This surface gui, has a text button, that when It’s clicked, will look for another different gui, which is located in the players PlayerGui, and it will find it and turn the frame visible.

gimme a sec. Gonna test it. changed it to a server.

@KingJoseon @alxzile still doesnt work.

errors?

nope. No typing errors or anything. Doesnt show anything in output either as I said earlier.

1 Like

can you show us your player with all the screengui open? in explorer

sure

https://ibb.co/P4dtDVG

The script should work, have you tried doing:

script.Parent.MouseButton1Click:Connect(function(player)
local PlayerGui = player:WaitForChild("PlayerGui")
PlayerGui.ToolShop.Frame.Visible = true
end)

also are you sure the frame is actually called Frame?

Yes I’m sure the frame is called Frame. Gimme a sec to try the new code.