local player = game.Players.LocalPlayer local character = player.Character local Allow for _, child in pairs(character:GetChildren()) do if child:IsA("Tool") then Allow = false else Allow = true end end
I'm trying to detect if the player has any tools equipped. Doing so would change Allow to false, disabling them from doing things that need Allow to be true. However, this part of my script isn't functioning.
You set "Allow" to false every time it sees an object that isn't a tool. Make it so that if it is a tool, set it to true, and if not, do nothing. If there is at least 1 tool, it will be true.
local player = game.Players.LocalPlayer local character = player.Character local Allow = false for _, child in pairs(character:GetChildren()) do if child:IsA("Tool") then Allow = true end end