You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: models/example-module.lua
+11-1Lines changed: 11 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -12,14 +12,24 @@ local players_data
12
12
localABS=math.abs
13
13
--#endregion
14
14
15
+
functionsay_hello()
16
+
game.print("Hello")
17
+
end
15
18
16
19
--#region Functions of events
17
20
18
21
localfunctionon_player_created(event)
19
22
localplayer=game.get_player(event.player_index)
20
23
ifnot (playerandplayer.valid) thenreturnend
21
24
22
-
player.print("Events of example mod works fine")
25
+
global.message_for_new_player="Events of example mod works fine"
26
+
player.print(global.message_for_new_player)
27
+
28
+
ifplayer.adminthen
29
+
player.print("\nYou can access to mods by their \"name\" as a prefix for commands. For example: __example-mod__ global.test = 1")
30
+
player.print("\nYou can use global functions from mods via console during the game.\nType it in console to try it: /c say_hello()")
31
+
player.print("\nAlso, you can read and change mod global data via console during the game.\nType it in console: /c __example-mod__ game.print(serpent.block(global))")
0 commit comments