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

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

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

local rep = game.ReplicatedStorage
local events = rep.Events
local event = events.event

--Event calling
event.OnServerEvent:connect(function(player.data)
 if data.reason=="changeTeam" then
  	player.Team=data.team
 end
end)

1 answer

✓ Accepted answer

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

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

hope this helps.

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