#What am I doing wrong 😭

1 messages · Page 1 of 1 (latest)

maiden totem
#

the tool gets loaded in faster than the connection gets time to register it

static turtle
#

I take the object in my hands and put it back in my backpack, how does it work?

#

tool in starter pack

maiden totem
#

like you want to see when your player unequips the tool?

static turtle
#

yes

maiden totem
#
for _, v in plr.Backpack:GetChildren() do
  v.Unequipped:Connect(function()
    print("tool unequipped")
  end)
end
#

and you can do a backpack.childadded if you want it to register tools that get added later on

static turtle
maiden totem
#

what do you mean by wait for the player to load

#

what do you mean by loading

static turtle
#

if you wait 5 seconds and connect ChildAdded, it will start working, but if you connect it immediately, nothing will happen

grim widgetBOT
#

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

maiden totem
#

can you show the code that supposedly doesn't work with connecting it immediately

static turtle
#

yeah

#

i send video

maiden totem
#

alright

static turtle
#

It doesn't work without wait

river robin
#

Player:WaitForChild("Backpack")?

static turtle
#

I tried it

river robin
#

Didn't work?

static turtle
#

no response

river robin
#

Uh

#

Can you show us what happens when you press play?

#

Like loading into the game

#

Nvm

#

Saw it

static turtle
#

uhh okay

river robin
#

Uh

#

Did it print when you added the wait?

#

Like child added

#

Oop

#

Saw it

#

Yeah it didnt print

#

Anything

#

It didnt print 1

#

It's because starter pack won't signal it

static turtle
river robin
#

Yeahh I overlooked it mb

#

Uh

static turtle
#

sending new video

river robin
#

Okay

static turtle
grim widgetBOT
#

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

static turtle
#

@river robin Any ideas?

#

I ran into this problem when I was doing the inventory limit, but the item counter wasn't updated in any way, so I created a test location and am trying to figure out what I am doing wrong.

river robin
#

Maybe try waiting for character added?

#
    player.CharacterAdded:Connect(function(character)
        local backpack = player:WaitForChild("Backpack")
        backpack.ChildAdded:Connect(function(item)
            print(player.Name .. " received item: " .. item.Name)
        end)
    end)
end)```
#

Yeah there's something about backpacks being tied to player characters

#

@static turtle try this out