StatusAdded (Event): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>ArceusInator
page for StatusAdded
 
>Camoy
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{|
<onlyinclude>{{Event
|<onlyinclude>{{Event|name = StatusAdded
|name = StatusAdded
|arguments = [[Status (Enum)|Status]] ''status''
|arguments = [[Status]] ''status''
|description = Fired when an [[Enum]] [[Status (Enum)|Status]] is added to the [[Humanoid]].
|description = Fired when a [[Status]] is added to the [[Humanoid]].
|object = Humanoid
|object = Humanoid
|}}</onlyinclude>
}}</onlyinclude>
|}
 
{{clear floats}}
 
{{Example|<pre>
{{Example|<pre>
function onStatusAdded( status )
function onStatusAdded( status )
Line 22: Line 24:


</pre>}}
</pre>}}
[[Category:Events]]

Latest revision as of 15:49, 29 January 2011

StatusAdded ( Status status )
Description Fired when a Status is added to the Humanoid.
Member of: Humanoid


Example
function onStatusAdded( status )
   if status == Enum.Status.Poison then
      print "The humanoid is now poisoned!"
   elseif status == Enum.Status.Confusion then
      print "The humanoid is now confused!"
   end
end

humanoid = game.Players.LocalPlayer.Character.Humanoid

humanoid.StatusAdded:connect( onStatusAdded )

humanoid:AddStatus( Enum.Status.Poison ) --> The humanoid is now poisoned!