Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you locate a Tool in your Backpack?

I want to know how to find a tool in your backpack. Because currently i am struggling on that. Im trying to make a basketball game but im really struggling any help?

3 comments

0

the script is in starter gui so do i do game.Players.LocalPlayer.Backpack:WaitForChild ("TOOL")

0

Are you using a server script or a localscript?

0

localscript

1 answer

Its based on the script, if you want to locate the tool in a player's backpack, just type :

oof = script.Parent.Parent --- Goes to the backpack, not tool, remove a Parent to detect the tool.
-- then add it to anywhere you want.

That is all i know, if it didn't work, tell me :D Oh, and also, make sure to place the Script inside the Tool, do not put it inside a block which is inside the tool, if you need to do that, add a Parent to the line up there, and also, if there are more than 1 tools, then add this to find the tool you need.

oof = script.Parent.Parent:FindFirstChild("ToolName")
-- not sure if this one works :)

Those lines only work in a script which is inside a tool. You can make it simple though, like

oof = script.Parent

Good luck!

8 comments

0

the script is in starter gui so do i do game.Players.LocalPlayer.Backpack:WaitForChild ("TOOL")

0

Yes

0

ok thanks !!!!!

0

His username was incorrect! He wasn't stopped! Good job buddy! heh

0

last thing is how do u reference it again so is it game.Players.LocalPlayer.Backpack:WaitForChild("Tool").Handle or do u make a variable

0

Please explain more about your problem.

0

so like u say game.Players.LocalPlayer.Backpack:WaitForChild("TOOL") then if u wanna like change the numb value do u just say game.Players.LocalPlayer.Backpack:WaitForChild("TOOL").Value = game.Players.LocalPlayer.Backpack:WaitForChild("TOOL").Value+5

0

This would give an error, like " Value is not a member of Tool", The line you wrote is trying to find a value inside your TOOL.,  if you expect the script to find something INSIDE the tool, like blocks, the line you wrote also works i cannot explain anymore.

This discussion is preserved as it was. New answers, comments, and votes are closed.