Scripting/Squirrel/Functions/Pickup.Alpha: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
(→Syntax) |
|||
Line 11: | Line 11: | ||
== Example == | == Example == | ||
This example will create a pickup and | This example will create a pickup and you can toggle visible it by commands given below. | ||
<pre>function onScriptLoad() | <pre>function onScriptLoad() | ||
{ | { |
Revision as of 10:58, 9 March 2016
Syntax
Pickup.Alpha = alpha;
Arguments
> Pickup - The pickup instance.
- integer alpha - The alpha you want to set on pickup, 0 to 255.
Example
This example will create a pickup and you can toggle visible it by commands given below.
function onScriptLoad() { myPickup <- CreatePickup( 284, 1, Vector( -2261.12, 753.12, 211.123 ) ); } function onPlayerCommand(player, cmd, text) { if (cmd =="visible") { myPickup.Alpha = 255; MessagePlayer("The pickup is visible now",player); } else if (cmd =="invisible") { myPickup.Alpha = 0; MessagePlayer("The pickup is invisible now",player); } }