#Need help with fixing Inventory system

170 messages · Page 1 of 1 (latest)

sinful raft
#

Idk how to delete an item's button in Inventory if the item got removedcrying

I have a Crafting System where you can craft 2 items into one but idk how to delete the buttons in Inventory after the crafting.
Dm for more info i only made 3 scripts for these.

celest gust
#

Send photo

sinful raft
#

Inventory script that checks stuff

#

Inventory script that makes textbutton

#

Crafting script

#

So yeah when an item gets picked up it makes a TextButton for it in the InventoryGui

celest gust
#

Hm

sinful raft
#

And when a player clicks that button the item gets dropped

#

so the problem is that when i craft the stuff the textbuttons dont disappear

sinful raft
#

probably the "WoodItemButton" and "BoxItemButton" is the wrong stuff

#

just idk if theres a way to find the right button for the right item and delete it after crafting

celest gust
#

Your saying that

#

When you press the craft button known as "CraftButton" The text doesn't disappear?

sinful raft
#

yeah

#

the textbuttons

#

like it destroys the wrong buttons

celest gust
#

Oh

sinful raft
#

like i pick up 2 Wood and 2 Box

#

so theres 2 wood and 2 box buttons in inventory

celest gust
#

Ok

sinful raft
#

then i craft once

#

2 buttons disappear then the other 2 dont work

celest gust
#

Oh

#

H

sinful raft
#

like they do the same but they wont drop the item

novel bronzeBOT
#

studio** You are now Level 1! **studio

celest gust
sinful raft
#

i mean the buttons dont work

celest gust
#

Oh

sinful raft
#

wait lemme make a vid on how it works

celest gust
#

Ok

sinful raft
#

bruh why in mkv

celest gust
#

Ok

#

I'ma look

#

Their is 100 different things going on in one video

#

😭

#

But I saw the problem

sinful raft
#

so uh how am i supposed to fix dat

celest gust
#

I'm not familiar with your game style

celest gust
sinful raft
#

so as you could see in the first part when i picked up an item it created a Button for each of them in Inventory

#

and when i clicked a button it dropped the item

#

in this part when i clicked those 2 buttons the items didnt get dropped

sinful raft
#

so yeah 4 items in inventory = 4 buttons in inventory. then 2 items in inventory = 2 buttons in inventory bc i crafted

celest gust
#

I fully understand now

sinful raft
#

yea

crude holly
celest gust
#

Limit<Erorr

crude holly
#

Oh yeah

#

Show the errors in the output if any

#

@sinful raft

sinful raft
#

alr wait a sec

crude holly
#

I have never seen that

#

in my life

sinful raft
#

this was after i clicked 2 remaining buttons which didnt work

crude holly
#

locked parent?

sinful raft
#

idk what that

crude holly
#

Dw

#

It's just in Studio, it isn't from ur script I believe

#

So those two items don't drop right?

sinful raft
#

yeah

novel bronzeBOT
#

studio** You are now Level 2! **studio

crude holly
#

@sinful raft

#

Ah okay

#

May you tell me how you make them drop?

celest gust
crude holly
#

Do you parent it in workspace or smth?

sinful raft
#

yes

#

they just have a position and i parent the item clones to workspace

crude holly
#

Oh clone

#

Don't clone it

sinful raft
#

yeah the original items are from replicated

#

wha

#

then how am i supposed to make multiple of the same item

crude holly
#

Clone can get rid of your ordinary item and just place one more

#

It's like y'know this process

sinful raft
#

uhh

crude holly
#

--Clone me()

--Cloned

--Amount of clones = 1

--Clone me()

--Cloned

--Amount of clones = 1
#

What I'm trying to say is

#

if you're cloning it, it'll just get that replicated item and make the previous one disappear

sinful raft
#

so there can only be 1 clones at once?

crude holly
#

But the thing is you're only doing this once

crude holly
sinful raft
#

so should i change the script or what

crude holly
#

Not yet

#

I could be wrong, bcuz you're only doing it once

#

so both items should've dropped I assume

#

it depends on how you did the process of your cloning tho

sinful raft
#

u can scroll up i alr sent all the scripts i used here

crude holly
#

@sinful raft Send me a screenshot of the script line that has the clone

crude holly
sinful raft
#

i mean i use remoteevents

crude holly
#

so am just trying my best to understand this fully lol

sinful raft
#

so this script checks if an item gets added to inventory then fires the event if yes

#

and this one creates a textbutton for the item when the event arrives

#

then if the button is pressed, the button gets deleted and it sends back the event to the first script

#

and in the first script when that event arrives after the button was clicked, it drops the item

#

so yeah this part works for now the problem is with just the crafting

crude holly
#

it doesn't drop it right?

sinful raft
#

yeah

crude holly
#

just disappears?

sinful raft
#

the crafting script removes the 2 items that are needed for the crafting and it also removes 2 buttons with the names of those items

crude holly
#

And you did say it parents to workspace when dropped

sinful raft
#

yeah

crude holly
#

Alright, check your explorer > workspace and check if the items are not nil

#

Do the crafting thingy, and check if it's in workspace

#

If not, then try to find where those both are parented to

#

Btw, what is this supposed to be?

sinful raft
#

it destroys the 2 items that were used for the crafting

#

i just gave them random names for now btw

crude holly
#

I'm pretty sure that's the problem :')

sinful raft
#

hmm

crude holly
#

And you're saying it clones right?

sinful raft
#

yeah

crude holly
#

And where does the clone parent it to?

sinful raft
#

wait wdym

#

the item?

crude holly
#

yeah

sinful raft
#

like the item is a clone from replicated

crude holly
#

Since it's in replicatedStorage

sinful raft
#

and when i pick it up that clone gets parented to the Inventory folder

crude holly
#

Ah, I see

sinful raft
#

and if i click the button in the gui it parents back to workspace

crude holly
#

and then the :Destroy

sinful raft
#

yeah

crude holly
#

I'm assuming it destroys it in inventory

#

not replicated?

sinful raft
#

yes only in inventory

#

if it got destroyed in replicated the clones would stay and the original item couldnt be cloned anymore

crude holly
#

When you do the crafting, are the items still visible in ReplicatedStorage

#

or are they gone

sinful raft
#

they stay there

novel bronzeBOT
#

studio** You are now Level 3! **studio

crude holly
sinful raft
#

they just get cloned

crude holly
#

How many times do they get cloned

#

once?

#

or twice

sinful raft
#

just once

#

like in the vid theres a spawner

sinful raft
#

ye theyre not

crude holly
#

so they're actually in workspace

#

huh...

sinful raft
#

i mean when they are dropped

#

bro the problem is just that something goes wrong with the buttons in inventorygui after i do the crafting

#

it has to be smth with the crafting script

#

like should i send back an event or

sinful raft
#

u saw the vid

crude holly
#

Mhm

sinful raft
#

at first i picked up 4 items and it made 4 buttons and they all worked

#

then i crafted

#

the crafting removed 2 items and 2 buttons

#

but the remaining 2 other buttons didnt work after

#

so a button drops the item from inv, but after crafting, those buttons wont drop the 2 remaining items from inv

#

for some reason

#

i just gotta know what is locked parent

crude holly
#

Search in the devForumn

#

I never saw that b4

#

Oh and btw, I'm going to sleep

#

I really don't follow, I apologize 🤧