Counter Strike Online Wiki
Advertisement

Studio device block

Tables[]

Game.EntityBlock.position[]

Data type representing specific block coordinates
Fields:
  • x: (int) x coordinate
  • y: (int) y coordinate
  • z: (int) z coordinate


Game.EntityBlock.EventArg[]

There are also actions
that apply only to specific device blocks of data type that contain event information of :the device block.
Fields:
  • action: (Optional string) A specific event.
  • value: (Optional string) Used as an argument of a specific action.


Fields[]

Game.EntityBlock.id[]

Get the ID of a device block.
  • id: (int)


Game.EntityBlock.position[]

Get the coordinates of a device block.


Game.EntityBlock.onoff[]

Get the current On / Off status of the device.
  • onoff: (bool)


Methods[]

Game.EntityBlock: Create (position)[]

Get the device block at that coordinate.
Parameters:
Returns:
(EntityBlock or nil) In the case of bad coordinates or a normal block, nil


Game.EntityBlock: Event (arg, index)[]

This is the function that drives the device block.
Each device has its own unique event.
The basic action is as follows.
action = "use" : If the device is available, the device is used.
action = "touch" : If it is an area block, touch the device.
action = "reset" : Reset the device.
Parameters:
  • arg: (EventArg)
  • index: The index number of the player that raised the (Game.Player.index) event.
Usage:
local door = EntityBlock.Create ( 46 , 31 , 15 ) 
door.Event ({action = "use" }, 1 )


local trigger = EntityBlock.Create ( 20 , 0 , 16 ) 
trigger.Event ({action = "touch" }, 0 )


Event Callback[]

Game.EntityBlock: OnUse (player)[]

Event callback that is called when the player uses the device block.
Parameters:
  • player: (Game.Player or nil) if it works as a signal from another device, nil


Game.EntityBlock: OnTouch (player)[]

Event callback that is called when the player touches an area device block.
Parameters:
  • player: (Game.Player or nil) if it works as a signal from another device, nil

Advertisement