How to make if you have a tool equipped when you interact with the proximity prompt something happens else do something else the proximity prompt

how to make if you have a tool equipped when you interact with the proximity prompt something happens else do something else the proximity prompt

I need to have an idea of how to do it because i dont think how it could work

2 Likes

just check if the tool you are looking for is a child of the player’s character then if that’s the case then do the thing you are trying to do

1 Like

I tried this, do you think this will work?
local SpecificTools = {
“Tool”, “Tool2”
}

script.Parent.ProximityPrompt.Triggered:Connect(function(player)
	    local character = player.Character
	 
	    if character:FindFirstChildOfClass("Tool") then -- Checks if a player has a tool equipped.
	       if table.find(SpecificTools, character:FindFirstChildOfClass("Tool").Name) then
		            print("outcome 1")
		        else
		            print("outcome 2")
		        end
	    else
	      print("outcome 2")
		    end
	end)

yeah that looks good, if you have any other questions then just ask :slight_smile:

1 Like