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

Can anyone help? I'm having trouble with adding items to my backpack GUI.

Asked by 4 years ago
Edited 4 years ago

I'm incredibly new to scripting and am having a bit of trouble with adding items to my Backpack GUI. What I want to happen is,when and item in the game is clicked, it disappears and is added to the backpack GUI. I have the part already scripted so that when it is clicked, it disappears but I do not know how to get it to be added to my backpack. I used the scripting from the backpack GUI created by XxxLloyd061302xxX. The mainscript, that from my understanding, is supposed to run the backpack functions is here: https://pastebin.com/B5YYShx0

My backpack GUI is set up as follows: https://pastebin.com/ppbQN6yy

If you could offer any help that would be amazing. I'm at a dead end and even if its a few commands I might be able to utilize to achieve what I need that would be amazing. Or if you could even point me in the direction of where I would find the answers I need that would be amazing too. I'll honestly take any help I can get.

If you need more info please let me know although I hope I provided enough.

If this request is too much then let me know nicely please.I don't really know how difficult what I'm asking for help for is, so if its super hard just tell me and I'll figure it out on my own.

1 answer

Log in to vote
0
Answered by 4 years ago
-- add this to your script
script.Parent.ClickDetector.MouseClick:Connect(function(player)
        local clone = game.ReplicatedStorage.Item
    clone:Clone()
    clone.Parent = game.Players[player.name].Backpack
end)

If you have the item in replicatedstorage. If not, change it. Also modify it according to your liking. Im not 100% it will work, just tell me. Change item to your item's name.

0
It doesn't seem to work but now i think I have an idea of what to do. Thanks for your help :) xXTigercatX 10 — 4y
Ad

Answer this question