Hey, so pretty much im trying to see if a player has a designated tool or not. It doesnt give me any errors in console. Code:
local Tool = plr.Backpack:FindFirstChild("LadderTool") or plr.Character:FindFirstChild("LadderTool")
if Tool then
if equipped then
elseif Tool == nil then
print("No tool found")
When a tool is equipped the tool will be parented to the player character/model.
and when it is unequipped it will be parented to the backpack.
So, there is no need for the equipped Boolean.
If you are using a server script you cant really define the player outside the function, you gotta do it in the click function.
As the first variable in the function is the player who clicked.
Lastly, when a player has a tool equipped it does not allow them to activate click detectors. So best case right now is to find the tool in their backpack instead.
local clickDetector = script.Parent:WaitForChild("ClickDetector")
clickDetector.MouseClick:Connect(function(player) --Get the player who clicked!
--Find the tool!!!!!
local findTool = player.Backpack:FindFirstChild("LadderTool")
--Check if tool is there!
if findTool then
print("tool not found!")