I am currently making an admin commands system. It is working really good, and this is my function for a server message. I send a table when a player chats called args. For example, if I say:
:smsg Hello Guys!
The args table would be:
{"Hello","Guys!"}
For some reason, the message reads: “1 2”
I think it is reading off how many arguments there are but that isn’t what I want. Here is my code:
commands.smsg = function(sender,args)
print("ServerMessage function fired by: "..sender.Name)
local strings = {}
local severMessage = ""
for i = 1,#args,1 do
table.insert(strings,args[i])
end
for i = 1,#strings,1 do
severMessage = severMessage.." "..i
end
game.ReplicatedStorage.ExplorerAdminRemotes.Message:FireAllClients("Server Message",severMessage)
end
I think this might be causing the problem, although I do not know how to fix it.
for i = 1,#args,1 do
table.insert(strings,args[i])
end