-
-
Notifications
You must be signed in to change notification settings - Fork 225
Expand file tree
/
Copy pathServer-Example Plugin.luau
More file actions
37 lines (30 loc) · 1.35 KB
/
Server-Example Plugin.luau
File metadata and controls
37 lines (30 loc) · 1.35 KB
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
--[[
SERVER PLUGINS' NAMES MUST START WITH "Server:" OR "Server-"
CLIENT PLUGINS' NAMES MUST START WITH "Client:" OR "Client-"
Plugins have full access to the server/client tables and most variables.
You can use the MakePluginEvent to use the script instead of setting up an event.
PlayerJoined will fire after the player finishes initial loading
CharacterAdded will also fire after the player is loaded, it does not use the CharacterAdded event.
service.Events.PlayerAdded:Connect(function(p)
print(`{p.Name} Joined! Example Plugin`)
end)
service.Events.CharacterAdded:Connect(function(p)
server.RunCommand('name', plr.Name, 'BobTest Example Plugin')
end)
--]]
return function(Vargs)
local server, service = Vargs.Server, Vargs.Service
server.Commands.ExampleCommand = {
Prefix = server.Settings.Prefix; -- Prefix to use for command
Commands = {"example"}; -- Commands
Args = {"arg1"}; -- Command arguments
Description = "Example command"; -- Command Description
Hidden = true; -- Is it hidden from the command list?
Fun = false; -- Is it fun?
AdminLevel = "Players"; -- Admin level; If using settings.CustomRanks set this to the custom rank name (eg. "Baristas")
Function = function(plr,args) -- Function to run for command
print("HELLO WORLD FROM AN EXAMPLE COMMAND :)")
print(`Player supplied args[1] {args[1]}`)
end
}
end