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

Expected ')' (to close at '(' at column 37), got '.', anyone help????

Asked by 6 years ago

This server script is not working for me and i dontknow why, i need the player data and the player here

01local rep = game.ReplicatedStorage
02local events = rep.Events
03local event = events.event
04 
05--Event calling
06event.OnServerEvent:connect(function(player.data)
07 if data.reason=="changeTeam" then
08    player.Team=data.team
09 end
10end)

1 answer

Log in to vote
2
Answered by 6 years ago
Edited 6 years ago

This error is explaining that it expected a ) to close the function(player.data) but instead got . meaning that the syntax is incorrect.

Replace the . with , as this is the separator used when defining parameters.

Example

1event.OnServerEvent:connect(function(player, data)
2    -- code
3end)

hope this helps.

Ad

Answer this question