game.Players.PlayerAdded:Connect(function(Player)
Player.Chatted:connect(function(msg)
local msgs = string.gmatch(msg,"%S+")
for i,v in pairs(msgs) do
print(v)
end
end)
end)
When I do this, I get an error that msgs is a function.
game.Players.PlayerAdded:Connect(function(Player)
Player.Chatted:connect(function(msg)
local msgs = string.gmatch(msg,"%S+")
for i,v in pairs(msgs) do
print(v)
end
end)
end)
When I do this, I get an error that msgs is a function.
game:GetService("Players").PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
local msgs = string.gmatch(msg,"%S+")
for v in msgs do
print(v)
end
end)
end)
Edited so that I don't get comments about the deprecated lowercase connect or accessing PlayerService by name.
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Just simply remove
pairs. ;3Well, that and remove the 'i' also.