PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience

Tool.Activated

Tool.Activated

Oct 01 2018, 1:43 AM PST

The below code, when ran in a test mode with Player1 present, would create a tool in the player’s backpack. It will print “Tool activated” when the player clicks while the created tool is equipped.

local tool = Instance.new("Tool")
tool.Parent = game.Players.Player1.Backpack
 
function onActivation()
    print("Tool activated")
end
 
tool.Activated:Connect(onActivation)