This script works just fine, but I can't figure out how to make it into a proper tool! Please help! Thank you!!
local player = game.Players.LocalPlayer local mouse = player:GetMouse() local Players = game.Players:GetChildren() local contraband = player:WaitForChild('Illegal').Contraband tool = script.Parent function SearchPerson() if mouse.Target ~= nil then for _,v in pairs(game.Players:GetChildren()) do if mouse.Target.Parent.Name == v.Name then local selectedPlayer = v local character = selectedPlayer.Character player.PlayerGui.Searching.Frame.Visible = true wait (5) player.PlayerGui.Searching.Frame.Visible = false if v.Illegal.Contraband.Value == 1 then player.PlayerGui.BadGuy.Frame.Visible = true else player.PlayerGui.GoodGuy.Frame.Visible = true print ('This person is in players') print ("Searching " ..v.Name .. " for illegal substances") end end end end end mouse.Button1Down:connect(SearchPerson)
roblox tools have a .Equipped event Equipped