I am trying to pass the player into a module script to send some information to my server.
I am using a server script, and passing information into a ‘server’ module.
When I pass the player into the parameters, the player is nil on the other side (the server module)
local serverMods = require(game:GetService("ServerScriptService").Modules.ServerModules) print (player, player.Name) -- prints my players name local result = serverMods:SavePlayerLeaderStats(player, stage, timeLaps);
function module.SavePlayerLeaderStats(player, stage, completionTime) print (player, player.Name) -- prints nil end
I’ve tried doing some basic debugging, and searched the forums/google for a similar issue, but found no answers so far. I’d thought of just sending the player name, rather than the player; but I’d like to omit unnecessary extra code if possible, and I like to know why things don’t work
What could the issue be?
Thank you for reading