Touch a part to open a GUI shop

This would be a Client Script either in StarterGui or StarterPlayer.StarterPlayerScripts

Alright. So would I need to delete the current ServerScriptService script and LocalScript inside the Shop GUI? Like if yes.

1 Like

You could just disable them. But in theory that should replace them yeah.

1 Like

image
Should this work? Putting it in StarterPlayer.StarterPlayerScripts did not work.

That would work too. In that case you could remove Player.PlayerGui and PlayerGui:WaitForChild(“Shop”)

and just do

local ShopFrame = script.Parent:WaitForChild("ShopFrame")

Ya you’ll need to replace “Shop” with “script.Parent”

1 Like

This is still not working. I don’t know why

Does it return any errors in the Output? This works perfectly fine for me.

Also make sure it is Enabled. It looks greyed out but I can’t tell

It is enabled. And alr lemme check the output


idk if it’s any of this. I think this is the right stuff

One question, does the gui even appear if you set it to visible in studio?

1 Like

That looks like an error with the other script. Are you able to send your GUI as a file? I can test it and send back

I can. the shop part is called ShopButton. Give me one second to get it for you

ShopGUI.rbxm (12.3 KB)


This seems to work perfectly fine for me. I didn’t edit anything?

Perhaps the script is running before the Part has loaded. You could try:

local MainPart = workspace:WaitForChild("ShopButton")

Where do I put the local MainPart = workspace:WaitForChild("ShopButton") ?

Replace

local MainPart = workspace.ShopButton -- This is the Part that Opens the Shop

You probably don’t need any server code for that,

  • Have an invisible trigger block to open the shop connected with a .Touched
  • Start a loop every X seconds (or connect it to a runservice event, ur choice) that uses the Spatial Query API (the new region3 and no weird modulescripts needed) to tell if the player’s humanoid root part is no longer in the trigger

Yeah my script basically does this lol