Activated (Event): Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>Camoy No edit summary |
>MrNicNac Fixed event description. |
||
Line 1: | Line 1: | ||
<onlyinclude>{{Event | <onlyinclude>{{Event | ||
|name = Activated | |name = Activated | ||
|description = Fired when a tool is | |description = Fired when the player clicks while a tool is equipped. | ||
|object = Flag, Tool | |object = Flag, Tool | ||
}}</onlyinclude> | }}</onlyinclude> | ||
Line 10: | Line 10: | ||
local tool = Instance.new("Tool") | local tool = Instance.new("Tool") | ||
tool.Parent = game.Players.Player.Backpack | tool.Parent = game.Players.Player.Backpack | ||
local function onActivation() | local function onActivation() | ||
print("Tool activated") | print("Tool activated") | ||
end | end | ||
tool.Activated:connect(onActivation) | tool.Activated:connect(onActivation) | ||
</pre>}} | </pre>}} | ||
[[Category:Events]] | [[Category:Events]] |
Revision as of 14:30, 27 December 2010
Activated ( ) | |
Description | Fired when the player clicks while a tool is equipped. |
---|---|
Member of: | Flag, Tool |
Example
local tool = Instance.new("Tool") tool.Parent = game.Players.Player.Backpack local function onActivation() print("Tool activated") end tool.Activated:connect(onActivation)