My beginner Problem :P

Hi, Iā€™m a noob with scripting. Just started with AlvinBlox tutorials :smiley:

Could anyone help me out, why is this function not working?

Output:
ServerScriptService.Script:1: Expected identifier when parsing function name, got ā€˜(ā€™ - Studio - Script:1

-- function(ThePlayer)
	print(ThePlayer.Name.." has entered")
end

game.Players.PlayerAdded:Connect(ThePlayer)
1 Like

You could perhaps try changing this to this:

game.Players.PlayerAdded:Connect(function(ThePlayer)

Functions must be named and event can be used like this.

function PlrAdded(ThePlayer)
	print(ThePlayer.Name.." has entered")
end

game.Players.PlayerAdded:Connect(PlrAdded)
2 Likes

Thank you so much, makes sense now! :slight_smile: