I'm trying to pass the local player from a local script to a server script in workspace through a remote event, yet it is telling outputting "error: attempt to index local 'player' (a number value)
--serverscript setDotEvent.OnServerEvent:connect(function(numDots, player) char = player.Character--Error pointing to this line --more code end) --localscript game.Workspace.SetupDots:FireServer(NumDots, game.Players.LocalPlayer)
The player is already submitted when you send information to client over to the server. This would be the fix:
--serverscript setDotEvent.OnServerEvent:connect(function(player, numDots) -- The client automatically sends the player! Easy. if player and player.Character then local character = player.Character end --more code end) --localscript game.Workspace.SetupDots:FireServer(NumDots)
By the way, use "local" when you aren't using variables in a global scale. They will be moved to the top of the stack
Also, I recommend organising your events in a folder in ReplicatedStorage or some other place where both can access. Organization is key. Functionality will still be the same, just update where it points.