I'm trying to send the name of a audio to a local script so it can read the timelength, This is the second day I have been trying to get this stupid crap to work.
I keep getting: bad argument #2 to '?' (string expected, got nil)
Local:
events.Senders.LocalTimeLength.OnClientInvoke = function(plr, namasde) for i,v in pairs (board["Main(EDIT)"][namasde]:GetChildren()) do if v.IsPlaying == true then return v.TimeLength end end end
Server:
wait(script.Parent.Events.Senders.LocalTimeLength:InvokeClient(game.Players:GetPlayers()[math.random(1,#game.Players:GetPlayers())], script[name].Name))
(name is not a object it's the name property of an object)
I believe you need to delete the "plr" argument. Localscripts don't need a "player" argument when it comes to RemoteEvent/Functions because that would just equal game.Players.LocalPlayer -- ie, only the server needs/gets a "player" argument.