Add command /tag-color

This commit is contained in:
badgamernl
2020-11-04 00:38:01 +01:00
parent 9e150aff79
commit 61a3f92982
4 changed files with 56 additions and 5 deletions

View 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)