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

My shop gui does not reappear after I press close, is there a solution?

Asked by 5 years ago

After closing the shop gui, in which opens when you step on a certain part, it does not reopen, I will show you the code I did. Pop up shop:

function touch(hit)
    if game.Players:findFirstChild(hit.Parent.Name) ~= nil then
        player = game.Players[hit.Parent.Name]
        if player.PlayerGui:findFirstChild("Info") == nil then
            gui = script.Info:clone()
            gui.Parent = player.PlayerGui
            repeat
                wait() 
            until (player.Character.Position - script.Parent.Position).magnitude > 0
        end
    end 
end

script.Parent.Touched:connect(touch)
GuiNameHere.Enabled = true

Close/open: print("Close button loaded")

button = script.Parent window = button.Parent

function onClicked(GUI) window:remove() end script.Parent.MouseButton1Click:connect(onClicked)

0
**crys of laughter** iuclds 720 — 5y
0
i mean the toolbox is a start MachoPiggies 526 — 5y
0
im not a great scripter but somewere it says ~=? i dont know if thats causing an error SamZeKat 28 — 5y
0
It does not work RamenRobloxian 2 — 5y

1 answer

Log in to vote
0
Answered by
Fifkee 2017 Community Moderator Moderation Voter
5 years ago
Edited 5 years ago

you deleted the window. once you delete window, you'll have to point it to the shop gui again in order for it to work. instead of removing the window, you should set the window's visible/enabled property to false, and change the descendants inside of "window" instead of cloning the entire gui itself.

(p.s., when was playergui accessible from a serverscript :thonk:)

0
this is not possible to do RamenRobloxian 2 — 5y
Ad

Answer this question