I can't make gui appear by clicking physical objects in shop

  1. What do you want to achieve? Keep it simple and clear!

I want to make it appear

  1. What is the issue? Include screenshots / videos if possible!

It won’t appear, even though script looks for right place but it can’t find “Rocket Launcher”… It’s there! I am confused.

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I did look for solutions on Devforum, it didn’t help so I posted this. I tried other ways like GUI inside part and it didn’t work.

THIS IS WHERE TOOLS FOR SHOP IS, NEXT SCREENSHOT BELOW THIS IS WHERE PURCHASE ITEM FOR ROCKET LAUNCHER IS (SAME PLACE WHERE SCRIPT CAN’T FIND, EVEN THOUGH IT’S THERE).
**


local TRIGGER = script.Parent.ClickDetector

TRIGGER.MouseClick:Connect(function(plr)

print("Somebody clicked the Item!")

plr.PlayerGui.Noob.WebFrame:WaitForChild("Rocket Launcher").Visible = true

end)
1 Like

If this already in the workspace then you can remove this :WaitForChild line

You can do;

local TRIGGER = script.Parent.ClickDetector

TRIGGER.MouseClick:Connect(function(plr)
   print(plr.Name .. " clicked this item!")
   plr.PlayerGui:WaitForChild("Noob").WebFrame.RocketLauncher.Visible = true
end)

That is because of 2 things;

  • ScreenGuis take time to load so you need to wait for it.
  • RocketLauncher named in StarterGui has no space while in your code there has.

I appreciate some improvements in script, thank you! But unfortunately, same error still shows up

can you send a full picture of “WebFrame”
And also can you add

    print(player.PlayerGui.Noob.WebFrame:GetChildren())

somewhere into your script, and send a picture of the table expanded in the output?

its weird cause it cant find the rocket launder when its clearly included as a child. Maybe sort of script made the Parent to nil, :Destroy(), or parent changed.

That’s interesting… you might be right about that, the GUI works by copying from template and make instances of it with different names (gears)


It still remains only nothing but Template GUI as before, even though it should be there. Should I just change system and pre-make all frames instead of using template to create more instances?

Here’s full picture of WebFrame


Whole list of childrens of WebFrame.

Edit: I will move all frames that was made from Template and put it in original StarterGui and see what happens.

It worked! The purchase frame appeared but this isn’t really related to the original problem itself now. The script won’t subtract my money, either give me money after clicking purchase. :sweat_smile:

1 Like