mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 20:41:41 +09:00
Add command /tag-color
This commit is contained in:
16
config/expcore/command_color_parse.lua
Normal file
16
config/expcore/command_color_parse.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
--- This will make commands only work when a valid color from the presets has been selected
|
||||
-- @config Commands-Color-Parse
|
||||
|
||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
||||
local Colours = require 'utils.color_presets' --- @dep utils.color_presets
|
||||
|
||||
Commands.add_parse('color',function(input, player, reject)
|
||||
if not input then return end
|
||||
local color = Colours[input]
|
||||
if not color then
|
||||
player.print("invalid")
|
||||
return reject{'expcore-commands.reject-color'}
|
||||
else
|
||||
return input
|
||||
end
|
||||
end)
|
||||
Reference in New Issue
Block a user