Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Chatted event, any help?

Error: 19:38:21.165 - Workspace.Script:5: '' expected near 'end'

game.Players.PlayerAdded:connect(Player)
   Player.Chatted:connect(function(Message)
print(Message)
end)
end) --error here

2 comments

0

You never began the function on line 1, it's game.Players.PlayerAdded:connect(function(Player)

0

HELP!!!

1 answer

✓ Accepted answer
game.Players.PlayerAdded:connect(Player)
    Player.Chatted:connect(function(Message)
        print(Message)
    end)
end) --error here

Your error is quite easy to solve. What you never did was set up a function on line 1, therefore the script is considering that last end as useless. As well as the script expecting a function named "Player".

This is easily fixable by including function( to line 1.

game.Players.PlayerAdded:connect(function(Player)
    Player.Chatted:connect(function(Message)
        print(Message)
    end)
end) --error here

This discussion is preserved as it was. New answers, comments, and votes are closed.