Ad
Log in to vote
0

Why is my tool not going in the backpack inventory?

Asked by 12 days ago

Basically, my tool isn't equipping right and i made a script for it.

script.Parent.Parent.Equipped:Connect(function()
    local player = game.Players.LocalPlayer
    local tool = script.Parent.Parent:Clone()
    tool.Parent = player.Backpack
end)

No errors. I checked the backpack and saw nothing was there. Am I doing something wrong?

0
Is the event firing properly? Put a print in there and see if it fires. Benbebop 949 — 12d
0
k xbendaiialt 37 — 12d
0
... i added a print and it made an error. "Equipped is not a valid member of Backpack "Players.xBenDaii.Backpack" xbendaiialt 37 — 12d
0
woops, i didnt put the model in the tool, still doesnt work in the tool though xbendaiialt 37 — 12d
View all comments (3 more)
1
Are you going too far back? It seems like you are indexing the backpack instead of the tool, try removing one of the ".parents". Benbebop 949 — 12d
0
Are you sure that "script.Parent.Parent" is referring to the tool? oilsauce 196 — 12d
0
yes xbendaiialt 37 — 8d

1 answer

Log in to vote
0
Answered by 11 days ago

May or may not fix issues for you:

script.Parent.Parent.Equipped:Connect(function()
2       local player = game.Players.LocalPlayer
3       local tool = script.Parent.Parent
4       tool:Clone().Parent = player.Backpack
5   end)
Ad

Answer this question