I've made a code that checks if a tool is in the Backpack or not. If it is in the backpack, the code is supposed to bypass the primary action and move on. Unfortunately, it runs the primary action regardless if the tool is in the Backpack or in the Player. I used a print code to test this, and sure enough, each time it runs, if the tool was in the Backpack it printed "Backpack" and if it was in the player it printed my name. Any ideas why? This is in a local script inside of a tool. Thanks in advance!
if player.Backpack.MyValue.Value == false then
FanimTrack:Play()
wait(.4)
player.Character.Head.MySound:Play()
wait(.6)
if bin.Parent ~= "Backpack" then
enabled = false
print(bin.Parent.Name)
player.Backpack.MyValue.Value = true
--My FireServer Event
wait(4)
player.Backpack.MyValue.Value = false
wait(4)
enabled = true
end
FanimTrack:Stop()
end

2 comments
If statements are not ignored, if its running then the conditions you've given it have been met.
Right, that is my understanding of it as well. In the code above though, it doesn't matter if the parent is the Player or the Backpack, it runs the command either way. Though I specify that it should run if it is not in the Backpack, it still does..