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

Why will my simple backpack detecting script not work?

I attempted to create a simple script that detects if a certain tool is in the players backpack. However, the script does nothing, and gives no errors in the output. Here is the script:

if game.Players.LocalPlayer.Backpack:findFirstChild("Sword1") then
	print("Test")
end

3 comments

0

Is this the whole script?

0

Yeah

0

Because you wrote findFirstChild instead of FindFirstChild. always check your spelling if the script doesn't work

1 answer

Try placing the code in a LocalScript and placeing that in the StarterPlayerScripts. It needs to be in a LocalScript to use "LocalPlayer"

1 comment

0

How are you testing this? If you are testing this immediately after you start playing and you have put "Sword1" in starter gear then you need time for the gear to load in your backpack.

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