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

RBXScriptSignal error trying to make a backpack script?

Asked by 7 years ago
Edited 7 years ago
wait(1)
added = game.Players.LocalPlayer.Backpack.ChildAdded
Name = script.Parent.ScrollingFrame

game.Players.LocalPlayer.Backpack.ChildAdded:connect(function()
    if Name.Text1.Text == "" then
        Name.Text1.Text = added.Name
    end
end)

and this is the error

Name is not a valid member of RBXScriptSignal

any help because i rlly cant solve it

the problem is on line 7

1
What are you trying to do? ChildAdded is an event and RBXScriptSignal is an object passed back from an event which does not have a Name propertie. User#5423 17 — 7y
0
i am trying to make an inventory system with names of the item thats added to the backpack (picked up, loot drops, etc) TigerClaws454 48 — 7y
0
ChildAdded passes the object that was added as an arg you can simply use its name? User#5423 17 — 7y
0
yea but how do i know the items name if its picked up or randomly dropped ?? TigerClaws454 48 — 7y
View all comments (2 more)
0
What line is tihs error on? Right now it just sounds like a CoreScript error. M39a9am3R 3210 — 7y
0
@TigerClaws454 object.Name ? pls check th wiki page User#5423 17 — 7y

1 answer

Log in to vote
0
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
7 years ago
Edited 7 years ago

You try to get the name of the event ChildAdded. Thats not possible, you can however give the Child that was added, as an argument in the function like so:

game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(Child)

To fix your script we can simpfully do the following:



Name = script.Parent:WaitForChild("ScrollingFrame") game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(Child) if Name.Text1.Text == "" then Name.Text1.Text = Child.Name end end)
Ad

Answer this question