Script v1_7_1_0
- AI
- Animals
- Collections
- Contracts
- Debug
- Economy
- Elements
- EnvironmentalScore
- Errors
- Events
- GUI
- Handtools
- Hud
- I3d
- Input
- Jobs
- Maps
- Materials
- Misc
- Objects
- Parameters
- Placeables
- Placement
- Player
- Shop
- Sounds
- Specialization
- Specializations
- StateMachine
- Statistics
- Tasks
- Triggers
- Utils
- Vehicles
Engine v1_7_1_0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- general
- General
- I3D
- Input
- Lighting
- Math
- Network
- Node
- NoteNode
- Overlays
- Particle System
- Physics
- Rendering
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- VoiceChat
- XML
Foundation Reference
PlayerStateThrow
ParentPlayerStateBaseFunctions
activate
DescriptionActivate method.Definition
activate()Code
41 | function PlayerStateThrow:activate() |
42 | PlayerStateThrow:superClass().activate(self) |
43 | |
44 | self.player:throwObject() |
45 | self:deactivate() |
46 | end |
isAvailable
DescriptionDefinitionisAvailable()Return Values
bool | true | if player can idle |
28 | function PlayerStateThrow:isAvailable() |
29 | if self.player.isClient and self.player.isEntered and not self.player:hasHandtoolEquipped() then |
30 | if self.player.isCarryingObject or (not self.player.isCarryingObject and (self.player.isObjectInRange and self.player.lastFoundObject ~= nil)) then |
31 | if self.player.lastFoundObjectMass <= Player.MAX_PICKABLE_OBJECT_MASS then |
32 | return true |
33 | end |
34 | end |
35 | end |
36 | return false |
37 | end |
new
DescriptionCreating instance of state.Definition
new(table player, table stateMachine)Arguments
table | player | instance of player |
table | stateMachine | instance of the state machine manager |
table | instance | instance of object |
19 | function PlayerStateThrow.new(player, stateMachine) |
20 | local self = PlayerStateBase.new(player, stateMachine, PlayerStateThrow_mt) |
21 | |
22 | return self |
23 | end |