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

How can i make this gui give me tools if i click it, any help please?

Asked by
ali7682 17
6 years ago

Hi i have a script that removes your tools if you click this gui and it makes an image appear too and when you click the gui again the image will disappear but i want the tools that got removed to come back too. The problem is i really have no idea how to do that. Can someone please help me. Here is my script. (I'd like to get the tools i had in my inventory before instead of getting specific tools since my game has a shop and you can have 1-3 items at a time). Thanks :D

state = true
f = script.Parent.Parent.EpixShop
f.Visible = false

function click()
    if state == true then
        script.Parent.ImageTransparency = 0.5
        f.Visible  = true
        state = false
        for _,child in pairs(script.Parent.Parent.Parent.Parent.Backpack:GetChildren()) do
            if child.ClassName == "Tool" or child.ClassName == "HopperBin" then
                print ("Removed "..child.Name.."!")
                child:remove()
            else
                script.Parent.ImageTransparency = 0
                f.Visible = false
                state = true
            end
        end
    end
end

script.Parent.MouseButton1Down:connect(click)
0
I would advise you to read up about FilteringEnabled and Experimental Games as you obviously dont have it on and this makes your game open for hacking lukeb50 631 — 6y
0
Oh okay i will, thanks for the advice. (Btw what kind of hacking, like hacking in to your whole game or getting what?) ali7682 17 — 6y
0
Anything. Inserting gear, creating, deleting, moving parts are all possible. Not to mention your game will be hidden from most players. lukeb50 631 — 6y
0
Okay, thanks. ali7682 17 — 6y
0
I have filtering enabled on and i watched a video about it i understand pretty mutch about it thank you but is it true that it might break some localscripts/normal scripts? ali7682 17 — 6y

Answer this question