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)
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.