Script v1.7.1.0
- AI
- Animals
- Contracts
- Debug
- Economy
- Effects
- Events
- Farms
- GUI
- Handtools
- I3d
- Materials
- Misc
- Objects
- Placeables
- Player
- Player
- PlayerModelManager
- PlayerPickUpObjectEvent
- PlayerSetFarmAnswerEvent
- PlayerSetFarmEvent
- PlayerSetHandToolEvent
- PlayerStateActivateObject
- PlayerStateAnimalFeed
- PlayerStateAnimalInteract
- PlayerStateAnimalPet
- PlayerStateAnimalRide
- PlayerStateBase
- PlayerStateCrouch
- PlayerStateCycleHandtool
- PlayerStateDrop
- PlayerStateFall
- PlayerStateIdle
- PlayerStateJump
- PlayerStateMachine
- PlayerStatePickup
- PlayerStateRun
- PlayerStateSwim
- PlayerStateThrow
- PlayerStateUseLight
- PlayerStateWalk
- PlayerStyle
- PlayerSwitchedFarmEvent
- PlayerTeleportEvent
- PlayerThrowObjectEvent
- PlayerToggleLightEvent
- Shop
- Sounds
- Specializations
- Triggers
- Utils
- Vehicles
- Weather
Engine v1.7.1.0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- General
- I3D
- Input
- Lighting
- Math
- Network
- Node
- Overlays
- Particle System
- Physics
- Rendering
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- XML
- general
Foundation Reference
PlayerThrowObjectEvent
ParentEventFunctions
emptyNew
DescriptionCreate an empty instanceDefinition
emptyNew()Return Values
table | instance | Instance of object |
11 | function PlayerThrowObjectEvent:emptyNew() |
12 | local self = Event:new(PlayerThrowObjectEvent_mt) |
13 | return self |
14 | end |
new
DescriptionCreate an instanceDefinition
new(table player)Arguments
table | player | player instance |
table | instance | Instance of object |
20 | function PlayerThrowObjectEvent:new(player) |
21 | self.player = player |
22 | return self |
23 | end |
readStream
DescriptionReads network streamDefinition
readStream(integer streamId, table connection)Arguments
integer | streamId | network stream identification |
table | connection | connection information |
29 | function PlayerThrowObjectEvent:readStream(streamId, connection) |
30 | self.player = NetworkUtil.readNodeObject(streamId) |
31 | self:run(connection) |
32 | end |
run
DescriptionRun eventDefinition
run(table connection)Arguments
table | connection | connection information |
45 | function PlayerThrowObjectEvent:run(connection) |
46 | if not connection:getIsServer() then |
47 | g_server:broadcastEvent(self, false, connection, self.player) |
48 | end |
49 | |
50 | self.player:throwObject(true) |
51 | end |
sendEvent
DescriptionDefinitionsendEvent()Code
55 | function PlayerThrowObjectEvent.sendEvent(player, noEventSend) |
56 | if noEventSend == nil or noEventSend == false then |
57 | if g_server ~= nil then |
58 | g_server:broadcastEvent(PlayerThrowObjectEvent:new(player), nil, nil, player) |
59 | else |
60 | g_client:getServerConnection():sendEvent(PlayerThrowObjectEvent:new(player)) |
61 | end |
62 | end |
63 | end |
writeStream
DescriptionWrites network streamDefinition
writeStream(integer streamId, table connection)Arguments
integer | streamId | network stream identification |
table | connection | connection information |
38 | function PlayerThrowObjectEvent:writeStream(streamId, connection) |
39 | NetworkUtil.writeNodeObject(streamId, self.player) |
40 | end |