Hello all, apologies if my forum etiquette is poor, this is my first time posting.
Today I'm giving an open source holographic training center framework to the public that uses rudimentary chat commands and has support for custom commands.
If you aren't aware of the concept, think the 'Holodeck' from Star Trek, but purposed in a way that it could be a sparring room, or obby, or parade room, etcetera.
The story behind it
The reason I am releasing this is because long ago, probably over 5 years at this point, I was a young kid who had a dream to make a neat clan type-group, but I never had the ability to make something along these lines, so I was held back compared to the other better-equipped groups, wishing I could find someone to help me for free, since after all, kids don't have money to throw at developers. I decided that armed with the knowledge I have now, I'd become the person that wasn't there for me and provide systems and scripts for budding group-owners and developers to use.
Features
- Chat-based command recognition with custom prefix
- Map changing with custom maps
- Team changing with combat team swapping, team randomization, and simulation ending team resets
- Tool giving to both teams and players
- Custom command creation
Built-in Commands
-
authorize
-
changemap
-
team
-
sword & gun (tools not included
Creating custom commands
Inside of the holoService
folder you put into ServerScriptService
, open the chatManager
script and scroll down to the commands
table. make a new function within the table following this format:
COMMAND = function(...)
local args = table.pack(...)
local arg1 = args[2]
local arg2 = args[3]
Event:fire(arg1, arg2)
end,
COMMAND
being the command name you want to fire. args[1]
will be the command run itself, args[2]
will be the first argument, and args[3]
will be the second argument. args[2]
will often be a Player name or Team name, and in the event that it isn’t, args[3]
should be the Player name or Team name.
Now, create a new BindableEvent
with whatever name you’d like inside of the holoEvents
folder under ReplicatedStorage
. Then, set the Event
fired inside your chatManger
command to the name of your event, adding a reference to it at the top of chatManager
. e.g. local exampleEvent = holoEvents:WaitForChild("exampleEvent")
Inside of ServerScriptService
, open the holoService
folder and make a new Server Script
, following the nomenclature of [lowercase utility name]Manager
. Add local holoModule = require(script.Parent.MainModule)
at the top so that you can utilize holoModule functions, and create whatever function you would like your command to run inside the Script
. Now, at the bottom of the script hook the function to the BindableEvent
you created earlier. e.g. exampleEvent.Event:Connect(exampleFunction)
Congrats, you have made a custom command!
Feedback
Feel welcome to give me feedback, positive or critical, so that I may improve this and future products.
Additionally, please let me know how I can improve my forum etiquette and posts in the future!