So I have my original admin commands that I made approx. 20 months ago and they work fine, but, they are incredibly laggy due to the immense load of if statements, checking if it's this command or that command. At the moment I am currently switching to one small script requiring separate modules to execute said commands, here is an example of the server script to module script code:
-- // Server
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
require(script[msg:split(" ")[1]]):Execute(plr, msg)
end)
end)
(
-- // Module
return{
Execute = function(s, plr, msg)
-- (code)
end;
}
Is this fine? Could I do something more efficient? Thanks for your help.

1 comment
I see