/
BaseEntity.json
507 lines (507 loc) · 12.8 KB
/
BaseEntity.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
{
"name": "Entity",
"description": "<b>Entity</b> is the base for all Classes, and all those entities share the same <b>Methods</b> and <b>Events</b> described in this page.",
"is_base": true,
"static_functions": [
{
"name": "GetAll",
"description": "Returns a table containing all Entities of the class this is called on",
"authority": "both",
"return": [
{
"type": "Entity[]",
"description": "Copy of table containing all Entities"
}
]
},
{
"name": "GetByIndex",
"description": "Returns a specific Entity of this class at an index",
"authority": "both",
"parameters": [
{
"type": "integer",
"name": "index",
"description": "The index of the Entity"
}
],
"return": [
{
"type": "Entity",
"description": "Entity at index"
}
]
},
{
"name": "GetCount",
"description": "Returns how many Entities of this class exist",
"authority": "both",
"return": [
{
"type": "integer",
"description": "Number of Entities of this class"
}
]
},
{
"name": "GetPairs",
"description": "Returns an iterator with all Entities of this class to be used with <code>pairs()</code>",
"description_long": "Returns an iterator with all Entities of this class to be used with <code>pairs()</code>. This is a more performant method than <code>GetAll()</code>, as it will return the iterator to access the Entities directly instead of creating and returning a copy of the Entities table.<br><br><b>Note:</b> Destroying Entities from inside a <code>GetPairs()</code> loop will cause the iterable to change size during the process. If you want to loop-and-destroy, please use <code>GetAll()</code>.",
"authority": "both",
"return": [
{
"type": "iterator",
"description": "Iterator with all Entities of this class"
}
]
},
{
"name": "Inherit",
"description": "Inherits this class with the <a href='/docs/core-concepts/scripting/inheriting-classes'>Inheriting System</a>",
"authority": "both",
"parameters": [
{
"type": "string",
"name": "name",
"description": "The name of the new Class"
},
{
"type": "table?",
"name": "custom_values",
"description": "An optional table with custom values to be set in the inherited class table"
}
],
"return": [
{
"type": "table",
"name": "class",
"description": "The new Class table"
}
]
},
{
"name": "GetInheritedClasses",
"description": "Gets a list of all directly inherited classes from this Class created with the <a href='/docs/core-concepts/scripting/inheriting-classes'>Inheriting System</a>",
"authority": "both",
"parameters": [
{
"type": "boolean",
"default": "false",
"name": "recursively",
"description": "Returns all inherited children"
}
],
"return": [
{
"type": "table[]",
"description": "All children Classes"
}
]
},
{
"name": "GetParentClass",
"description": "Gets the parent class if this Class was created with the <a href='/docs/core-concepts/scripting/inheriting-classes'>Inheriting System</a>",
"authority": "both",
"return": [
{
"type": "table?",
"description": "The parent class"
}
]
},
{
"name": "IsChildOf",
"description": "Gets if this Class is child of another class if this Class was created with the <a href='/docs/core-concepts/scripting/inheriting-classes'>Inheriting System</a>",
"authority": "both",
"parameters": [
{
"type": "table",
"name": "class",
"description": "The other class to check"
}
],
"return": [
{
"type": "boolean"
}
]
},
{
"name": "Subscribe",
"description": "Subscribes to an <a href='/docs/core-concepts/scripting/events-guide'>Event</a> for all entities of this Class",
"authority": "both",
"parameters": [
{
"type": "string",
"name": "event_name",
"description": "Name of the event to subscribe to"
},
{
"type": "function",
"name": "callback",
"description": "Function to call when the event is triggered"
}
],
"return": [
{
"type": "function",
"description": "Callback that was passed (useful for unsubscribing later if your callback is an anonymous function)"
}
]
},
{
"name": "SubscribeRemote",
"description": "Subscribes to a custom event called from server",
"authority": "both",
"parameters": [
{
"type": "string",
"name": "event_name",
"description": "Name of the event to subscribe to"
},
{
"type": "function",
"name": "callback",
"description": "Function to call when the event is triggered"
}
],
"return": [
{
"type": "function",
"description": "Callback that was passed (useful for unsubscribing later if your callback is an anonymous function)"
}
]
},
{
"name": "Unsubscribe",
"description": "Unsubscribes all callbacks from this <a href='/docs/core-concepts/scripting/events-guide'>Event</a> in this Class within this Package, or only the callback passed",
"authority": "both",
"parameters": [
{
"type": "string",
"name": "event_name",
"description": "Name of the event to unsubscribe from"
},
{
"type": "function",
"name": "callback",
"default": "nil",
"description": "Optional callback to unsubscribe"
}
]
}
],
"functions": [
{
"name": "GetID",
"description": "Gets the universal network ID of this Entity (same on both client and server)",
"authority": "both",
"return": [
{
"type": "integer",
"name": "id"
}
]
},
{
"name": "GetClass",
"description": "Gets the class of this entity",
"authority": "both",
"return": [
{
"type": "table",
"name": "class"
}
]
},
{
"name": "IsA",
"description": "Recursively checks if this entity is <a href='/docs/core-concepts/scripting/inheriting-classes'>inherited</a> from a Class",
"authority": "both",
"parameters": [
{
"type": "table",
"name": "class",
"description": "The Class"
}
],
"return": [
{
"type": "boolean"
}
]
},
{
"name": "Subscribe",
"description": "Subscribes to an <a href='/docs/core-concepts/scripting/events-guide'>Event</a> on this specific entity",
"authority": "both",
"parameters": [
{
"type": "string",
"name": "event_name",
"description": "Name of the event to subscribe to"
},
{
"type": "function",
"name": "callback",
"description": "Function to call when the event is triggered"
}
],
"return": [
{
"type": "function",
"description": "Callback that was passed (useful for unsubscribing later if your callback is an anonymous function)"
}
]
},
{
"name": "SubscribeRemote",
"description": "Subscribes to a custom event called from server on this specific entity",
"authority": "both",
"parameters": [
{
"type": "string",
"name": "event_name",
"description": "Name of the event to subscribe to"
},
{
"type": "function",
"name": "callback",
"description": "Function to call when the event is triggered"
}
],
"return": [
{
"type": "function",
"description": "Callback that was passed (useful for unsubscribing later if your callback is an anonymous function)"
}
]
},
{
"name": "Unsubscribe",
"description": "Unsubscribes all callbacks from this <a href='/docs/core-concepts/scripting/events-guide'>Event</a> in this Entity within this Package, or only the callback passed",
"authority": "both",
"parameters": [
{
"type": "string",
"name": "event_name",
"description": "Name of the event to unsubscribe from"
},
{
"type": "function",
"name": "callback",
"default": "nil",
"description": "Optional callback to unsubscribe"
}
]
},
{
"name": "SetValue",
"description": "Sets a <a href='/docs/core-concepts/scripting/entity-values'>Value</a> in this Entity",
"description_long": "Sets a value in this Entity, which can be accessed by any package (optionally sync on clients if called from server)<br><br>Please refer to <a href=\"/docs/core-concepts/scripting/entity-values\">Entity Values</a> for more information",
"authority": "both",
"parameters": [
{
"type": "string",
"name": "key"
},
{
"type": "any",
"name": "value"
},
{
"type": "boolean",
"name": "sync_on_clients",
"default": "false",
"description": "Server side parameter, if enabled will sync this value with all clients"
}
],
"relations": {
"functions": [
"GetAllValuesKeys"
]
}
},
{
"name": "GetValue",
"description": "Gets a <a href='/docs/core-concepts/scripting/entity-values'>Value</a> stored on this Entity at the given key",
"description_long": "Gets a <a href='/docs/core-concepts/scripting/entity-values'>Value</a> stored on this Entity at the given key. Please refer to <a href=\"/docs/core-concepts/scripting/entity-values\">Entity Values</a> for more information",
"authority": "both",
"parameters": [
{
"type": "string",
"name": "key"
},
{
"type": "any",
"name": "fallback",
"description": "Fallback value if key doesn't exist"
}
],
"return": [
{
"type": "any",
"description": "Value at key or fallback if key doesn't exist",
"name": "value"
}
],
"relations": {
"functions": [
"GetAllValuesKeys"
]
}
},
{
"name": "GetAllValuesKeys",
"description": "Gets a list of all values keys",
"authority": "server",
"return": [
{
"type": "string[]",
"description": "a list with all values keys"
}
],
"relations": {
"functions": [
"GetValue",
"SetValue"
]
}
},
{
"name": "Destroy",
"description": "Destroys this Entity",
"authority": "authority"
},
{
"name": "IsValid",
"description": "Returns true if this Entity is valid (i.e. wasn't destroyed and points to a valid Entity)",
"authority": "both",
"return": [
{
"name": "is_valid",
"type": "boolean"
}
]
},
{
"name": "CallRemoteEvent",
"description": "Calls a custom remote event directly on this entity to a specific Player",
"authority": "server",
"parameters": [
{
"type": "string",
"name": "event_name",
"description": "The Event Name to trigger the event"
},
{
"type": "Player",
"name": "player",
"description": "The remote player to send this event"
},
{
"type": "any",
"name": "args...",
"default": "nil",
"description": "Arguments to pass to the event"
}
]
},
{
"name": "CallRemoteEvent",
"description": "Calls a custom remote event directly on this entity",
"authority": "client",
"parameters": [
{
"type": "string",
"name": "event_name",
"description": "The Event Name to trigger the event"
},
{
"type": "any",
"name": "args...",
"default": "nil",
"description": "Arguments to pass to the event"
}
]
},
{
"name": "BroadcastRemoteEvent",
"description": "Calls a custom remote event directly on this entity to all Players",
"authority": "server",
"parameters": [
{
"type": "string",
"name": "event_name",
"description": "The Event Name to trigger the event"
},
{
"type": "any",
"name": "args...",
"default": "nil",
"description": "Arguments to pass to the event"
}
]
}
],
"events": [
{
"authority": "both",
"name": "Spawn",
"description": "Triggered when an Entity is spawned/created",
"arguments": [
{
"type": "Entity",
"name": "self",
"description": "The Entity that was spawned"
}
]
},
{
"authority": "both",
"name": "Destroy",
"description": "Triggered when an Entity is destroyed",
"arguments": [
{
"type": "Entity",
"name": "self",
"description": "The Entity which that was destroyed"
}
]
},
{
"authority": "both",
"name": "ValueChange",
"description": "Triggered when an Entity has a value changed with <code>:SetValue()</code>",
"arguments": [
{
"type": "Entity",
"name": "self",
"description": "The Entity that just had a value changed"
},
{
"type": "string",
"name": "key",
"description": "The key used"
},
{
"type": "any",
"name": "value",
"description": "The value that was set"
}
]
},
{
"authority": "both",
"name": "ClassRegister",
"description": "Triggered when a new Class is registered with the <a href='/docs/core-concepts/scripting/inheriting-classes'>Inheriting System</a>",
"arguments": [
{
"type": "table",
"name": "class",
"description": "The inherited Class"
}
]
}
]
}