LUADOC - Farming Simulator 22

Script v1_7_1_0

Engine v1_7_1_0

Foundation Reference

JumpEvent

Description
Event for horse jumping
Parent
Event
Functions

emptyNew

Description
Create instance of Event class
Definition
emptyNew()
Return Values
tableselfinstance of class event
Code
13function JumpEvent.emptyNew()
14 local self = Event.new(JumpEvent_mt)
15 return self
16end

new

Description
Create new instance of event
Definition
new(table object, boolean isPlaying)
Arguments
tableobjectobject
booleanisPlayinghonk is playing
Code
22function JumpEvent.new(object)
23 local self = JumpEvent.emptyNew()
24 self.object = object
25 return self
26end

readStream

Description
Called on client side on join
Definition
readStream(integer streamId, integer connection)
Arguments
integerstreamIdstreamId
integerconnectionconnection
Code
32function JumpEvent:readStream(streamId, connection)
33 if not connection:getIsServer() then
34 self.object = NetworkUtil.readNodeObject(streamId)
35 self:run(connection)
36 end
37end

run

Description
Run action on receiving side
Definition
run(integer connection)
Arguments
integerconnectionconnection
Code
52function JumpEvent:run(connection)
53 if self.object ~= nil and self.object:getIsSynchronized() then
54 self.object:jump(true)
55 end
56end

writeStream

Description
Called on server side on join
Definition
writeStream(integer streamId, integer connection)
Arguments
integerstreamIdstreamId
integerconnectionconnection
Code
43function JumpEvent:writeStream(streamId, connection)
44 if connection:getIsServer() then
45 NetworkUtil.writeNodeObject(streamId, self.object)
46 end
47end