game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
local split = msg:split("")
for i, v in pairs(split) do
if split[1] == "!" then
print(msg)
end
end
end)
end)
Why do you need to loop through? Just do splits[1], splits[2] etc.
Also, string.split returns an array, you should have been using ipairs rather than pairs.