So if I were to type in "Insert; bla" as the map name = bla, how could I make it connect to my speech?
-- What would go above here, before inserting the map? local Map = game.ReplicatedStorage:FindFirstChild("MAPNAME") function InsertMap() local map = Map:Clone() map.Parent = game.Workspace end
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