LUADOC - Farming Simulator 19

Script v1.7.1.0

Engine v1.7.1.0

Foundation Reference

PlayerStateThrow

Parent
PlayerStateBase
Functions

activate

Description
Activate method.
Definition
activate()
Code
41function PlayerStateThrow:activate()
42 PlayerStateThrow:superClass().activate(self)
43
44 self.player:throwObject()
45 self:deactivate()
46end

isAvailable

Description
Definition
isAvailable()
Return Values
booltrueif player can idle
Code
28function 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
37end

new

Description
Creating instance of state.
Definition
new(table player, table stateMachine)
Arguments
tableplayerinstance of player
tablestateMachineinstance of the state machine manager
Return Values
tableinstanceinstance of object
Code
19function PlayerStateThrow:new(player, stateMachine)
20 local self = PlayerStateBase:new(player, stateMachine, PlayerStateThrow_mt)
21
22 return self
23end