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

Is there a way to detect when a tool is equipped without a function?

Asked by 10 years ago

I need to have a loop that constantly checks if a tool is equipped. Using the normal Equipped function won't work for my situation because I need to constantly check if a tool is equipped, not just have it fire once when it's equipped. The code I need would look something like this:

while wait() do
     local gun = game.Players.LocalPlayer.Backpack.Bow
     if gun.Equipped then -- obviously this won't work but it just gives an idea of what I want
             --code
     end
end

Answer this question