Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Chatted event, any help?

Asked by
FiredDusk 1466 Moderation Voter
8 years ago

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

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

0
You never began the function on line 1, it's game.Players.PlayerAdded:connect(function(Player) M39a9am3R 3210 — 8y
0
HELP!!! FiredDusk 1466 — 8y

1 answer

Log in to vote
1
Answered by
M39a9am3R 3210 Moderation Voter Community Moderator
8 years ago
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
Ad

Answer this question