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 5 years ago

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

Log in to vote
2
Answered by 5 years ago
Edited 5 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

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

hope this helps.

Ad

Answer this question