Server Script:
game.Players.PlayerAdded:connect(function(player)
local admins = {}
local maps = {}
local switcher = ";"
local func = require(game.ServerStorage.Chk)
local commands = {["insert"..switcher] = function(message)
local get = nil
for _, name in next, maps do
if message:Find(name.Name) then
get = name
break
end
end
local clone = get:Clone()
clone.Parent = Workspace
clone:MakeJoints()
end}
player.Chatted:connect(function(message)
local admin = func:AdminCheck(admins)
if admin then
newCall = func:CommandFind(message, commands)
newCall(message)
end
end)
end)
Module Script:
tab = {}
function tab:AdminIndex(player, admins)
for _, v in next, admins do
if v:lower() == player.Name:lower() then
return true
end
end
return false
end
function tab:CommandFind(message, commands)
for Name, func in next, commands do
if message:find(Name) then
return func
end
end
end
return tab
1 comment
Don't just post code! Explain what you're doing in detail!