I am not certain, but I believe the error is caused by an issue with the table called, arguments.
It looks like the table called, arguments is nil, which causes the loop to output an error.
print("TP Function fired by"..sender.Name)
for i, playerName in pairs(arguments) do
print(playerName)
end
that is definitely not going to work.
you need to have a player.Chatted event being listened to, and from that event handle the TP command.
Spoonfeeding
player.Chatted:Connect(function(msg)
arguments = msg.split(" ")
if string.lower(arguments[1]) == "tp" then
table.remove(arguments,1)
for i, playername in pairs(string.split(arguments[1],",")) do
print(playername)
end
end
end)