local Clickdetector = script.Parent:WaitForChild("ClickDetector")
local ToolNames = {"Milk"}
function playerAdded (player)
if player.Name == "Player" then
wait(2)
Clickdetector.MouseClick:Connect(function(Player)
if Player and Player.Character then
if ToolNames then
game.Players.player.Backpack.Milk:remove ()
end
end
end)
end
end
local ToolNames = {"Milk"} function Clicked(Player) if Player and Player.Character and ToolNames then for i,z in pairs(game:GetService("Players"):GetPlayers()) do for i,v in pairs(ToolNames) do z.Character.Humanoid:UnequipTools() z.Backpack:FindFirstChild(v):Destroy() end end end end script.Parent.ClickDetector.MouseClick:connect(Clicked)
The script receives if the player touched. If he touched then the script will get every player by using for I,z in pairs with players, then will take every toolnames by doing for I,v in pairs. After the script will unequip the tools and remove 1 tool with the name of Milk.