LUADOC - Farming Simulator 19

Script v1.7.1.0

Engine v1.7.1.0

Foundation Reference

PlayerStateUseLight

Parent
PlayerStateBase
Functions

activate

Description
Activate method.
Definition
activate()
Code
37function PlayerStateUseLight:activate()
38 PlayerStateUseLight:superClass().activate(self)
39
40 self.player:setLightIsActive(not self.player.isLightActive)
41 self:deactivate()
42end

isAvailable

Description
Definition
isAvailable()
Return Values
booltrueif player can idle
Code
28function PlayerStateUseLight:isAvailable()
29 if self.player.lightNode ~= nil and not g_currentMission:isInGameMessageActive() then
30 return true
31 end
32 return false
33end

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 PlayerStateUseLight:new(player, stateMachine)
20 local self = PlayerStateBase:new(player, stateMachine, PlayerStateUseLight_mt)
21
22 return self
23end