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

How do I make a player automatically hold an item upon grabbing it?

Asked by 5 years ago

When I touch a tool off the ground and pick it up it's only in my inventory, it's never held automatically.

How do I make the Tool held automatically without removing the backpack?

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

You could try a ChildAdded event on the Backpack, it would look something like this.

local player = game.Players.LocalPlayer
local char = player.CharacterAdded:wait() -- Waits for the character

player.Backpack.ChildAdded:connect(function(child) -- Child added event returns the child
    char.Humanoid:EquipTool(child) -- Equip the child that was returned
end)

I don't use those often so let me know if this works, and if anyone knows a better way, let us know.

0
Thanks for replying. I'm a bit stupid on scripting, where should I put it? kenappleby -8 — 5y
0
Local script inside of starter pack should be good, hope this helps. jackfrost178 242 — 5y
0
Thanks for the help. Sadly, it doesn't work though. kenappleby -8 — 5y
0
Well that sucks, maybe someone else will answer it. I kinda wanna know the answer too now. jackfrost178 242 — 5y
View all comments (2 more)
0
Actually I fixed it. There was a script I put in the tool that was apparently breaking it. Thanks for all your help. kenappleby -8 — 5y
0
Anytime. jackfrost178 242 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

I fixed it by deleting a script that ruined it. Thanks for the help, it's solved.

Answer this question