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

My Inventory Script has a slight problem, I was wondering if someone could take look at it?

Asked by 7 years ago
Edited 7 years ago

Im trying to do an inventory script... When you click an item a script inside the item changes the first empty slot and changes the image and an itemId inside... What im trying to do is make it so if you drop the 3rd item or some item and have some behind it like... lets say you have 5 items and you drop the 3rd one, I was trying to get it move up the line and now have 25 slots but only the first 4 filled. I tried a few different things like adding a few denounces and watchers to make sure it didn't delete all of them but I wouldn't work for me. I then asked a friend and he had no clue, hints when I'm coming here for help.

local Player = game.Players.LocalPlayer
local Gui = script.Parent
local Observing = script.Observer.Value
local Item = script.Parent.ItemNumber
local Pic = script.Parent.Image
script.Observer.Value.ItemNumber.Changed:connect(function()
    if script.Observer.Value.ItemNumber.Value == 0 then
        Item.Value = 0
            Observing.ItemNumber.Value = Item.Value 
                Observing.Image = Pic
                    Pic = ""
    end
end)
1
That sounds like a request. Link150 1355 — 7y

Answer this question