Difference between revisions of "Begin"
added section "note on operators"
imported>GreyWanderer (added section "note on operators") |
|||
Line 148: | Line 148: | ||
; Note that the unparameterized OnAdd block will ALSO be run in this case. | ; Note that the unparameterized OnAdd block will ALSO be run in this case. | ||
end | end | ||
==Note on operators== | |||
Also note that when using valid block types you are also allowed to use operators as part of the Begin command. Whether it makes sense or not depends on the particular situation. | |||
begin OnDrop || OnSell | |||
; some script | |||
; this will run if the calling object is either being dropped or sold. | |||
; for the case the item has been removed by removeallitems with target container ref you | |||
; have to store the ref of the target in a ref var and check against it within an OnAdd block | |||
end | |||
begin OnHit player && OnHitWith SpecialWeapon | |||
; some script | |||
; this will run if the calling object is hit by the player with SpecialWeapon | |||
end | |||
begin OnAdd && OnAdd player != 1 | |||
; some script | |||
; this will be run if the calling object is added to the inventory of anyone but the player | |||
end | |||
[[Category: Commands]] | [[Category: Commands]] |