I have a while true do loop that checks if something in a player's backpack exists through a LocalScript. Here's the script:
repeat wait() until game.Players.LocalPlayer.Character
local gun = game.Players.LocalPlayer.Backpack:findFirstChild("Sniper Rifle")
while true do
wait(1)
if not gun then
print("gun is nil")
else
print("gun is not nil")
end
end
The problem is, though, that even if the tool is removed, the output still says "gun is not nil", despite the gun not being in the player's inventory. Why is this happening?
