Issue with Shop Gui

Edit: Issue solved. I literally just made it go off screen when non visible, and deleted the reparent script, and the tween it already had brings it back on screen.

So, I’m working on a gui and I’ve made a SetParent Script to, well, set the parent.


It’s very simple code, and I’m getting this error.

No idea what it means. Any help?

Out of curiosity, why are you wanting to parent 1 local script into another?

Also, would you be able to send screenshots of your explorer and of where everything is placed?

EDIT: Also this is #help-and-feedback:scripting-support

I’m reparenting a gui to playerscripts. script.Parent reffering to the parent of the script, so script.Parent.Parent = (instance) to change the script’s parent’s parent. I’m still working on the gui but I want to be able to have it in the playerscripts, where it goes, to work for the shop. But I want it to be testable without repeatedly moving it.

I’m slightly confused, but a simpler way of doing what I believe you want to do is by putting the screen gui Instance inside of one of the local scripts. that way, you can easily call on it via
local Gui = script:FindFirstChildOfClass("ScreenGui"):Clone() -- or obviously just the name of the ScreenGui

Gui.Name = "Test"

then from there, if you want to move it, to and from the players view, you can do

Gui.Parent =game.Players.LocalPlayer.PlayerGui

OR

game.Players.LocalPlayer.PlayerGui:FindFirstChild("Test"):Destroy() to remove it

What it sounds like you want to do is have the shop “pop up” when the player triggers it, and remove it when the player disengages with it, is that correct?

Its coded to be inside the local script. But, I’m still working on the gui so I’ve had it in startergui. This ascript is to make it easier where I don’t have to keep moving it (especially sincee moving it will glitch it out and shrink it sometimes)

Oh, if it’s just in your way while you are working on your game, there’s also the “view UIs” button you can press :o

no, i need to be able to see the gui. i need to move it to startergui to see it. i know of this feature. it can’t be in startergui for the code, but it needs to for me to edit the gui look.