-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSynmax v1.1 Module Guide.lua
111 lines (74 loc) · 2.51 KB
/
Synmax v1.1 Module Guide.lua
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
local mod = {}
--[[ Synmax Passthrough ]]--
local Plugin, Methods
function mod._init(pluginRef, m)
Plugin = pluginRef
Methods = m
end
--[[
Plugin: we pass the plugin through so developers can utilize Plugin:OpenScript()!
Methods: these are synmax methods. These will be documented as they are added!
Be sure to avoid deleting the lines above, as doing so will break your module.
]]
--[[
module._info tells synmax what to display as contextual information for users.
This allows you to show the user their options when using your module.
]]--
mod._info = "<modName> <option1|option2>"
--[[
Synmax relies on nested dictionaries to layout your module's arguments and options.
The name of our module is our first argument. In this case, it's "template"
Lets take a look at (layerone) below.
When indexing this using synmax, the user will type:
[ template layerone ]
into the synmax terminal. This will take us to mod.layerone!
Note: It's important to keep the names of methods and tables in lowercase :)
if they are not synmax may not read them properly.
Lets dig a bit deeper!
]]--
mod.layerone = {
--[[
Below we have our first function! This function will take a tuple of arguments.
Synmax devides arguments by spaces (" "). You can parse these together as needed.
Below, we repeat the players first argument to them!
]]--
optiontwo = function(...)
print((...)[1])
end,
--[[
What if we wanted to go deeper?
]]--
optionthree = {
optionfour = {
optionfive = {
--[[
The user would need to type
'template layerone optionthree optionfour optionfive'
to get down here!
]]--
}
}
}
}
--[[
Here we have our function info function. This tells synmax what to display when encountering a function!
Notice how we have optiontwo equal to another table. This table requires two things.
optiontwo[1]: The contextual information to display (string)
optiontwo[2]: Contextual arguments (string)
these are not required, but definetly help the end user understand your module.
]]--
function mod._getFunctionInfo()
return {
optiontwo = {"-> Say a word and I'll repeat it!", "<word>"}
}
end
--[[
Okay, Now try it!
Drop this mod into game->ServerStorage->SYNMAX_PLUGINS and try typing "template"
If you have any questions on the development of modules for synmax, my DM's are always open.
Contact me:
- Dev Forum : https://devforum.roblox.com/u/frriend/
- Twitter : https://twitter.com/frriendRoblox
Made with <3 by frriend
]]
return mod