I am trying to make a script that sends stat values to the client stats but it says an error "Unable to cast value to Object". I am trying to send those stats through Remote Events and it doesn't seem to work, this error applies to the line where the client is fired.
local subject = game.ReplicatedStorage:findFirstChild("ServerReloader")
subject:FireClient(raceValue, haoValue, hairValue, haircValue, hair2Value, hairc2Value, hatValue, hatcValue, hat2Value, hatc2Value, busoValue, kenValue, pwepValue, swepValue, dfValue, fstyleValue, levelValue, strengthValue, defenceValue, agilityValue, expValue, expmaxValue, moveValue, tmoveValue, jailValue, ctitleValue, roleValue, dfidValue, jobValue, birthValue, shipValue, shipc1Value, shipc2Value, skinValue, checkpointValue, factionValue, weightValue, heightValue, shirtValue, pantsValue, repValue, talentValue, racetypeValue, giantValue, istrengthValue, idefenceValue, iagilityValue, cyborgmodValue, peglegValue, eyesValue, mouthValue, eyebrowsValue, twepValue, bellyValue, saveValue)
end)

14 comments
Why do you pass so many args
they are all the stats in the game, thats why they are a lot of args.
If you did not understand I basically said you need to restructure your code. I am pretty sure you have passed the 200 local variables limit at this point. There is never a need for so many args.
will a table fix it?
maybe, i have about 55 args there.
This is a server script? Your first argument to FireClient should be the player object the server is sending all that information to. For efficiency's sake, please find areas where you may reduce the amount of information sent between the client and server.
loool
you should organize the values and put them into specific tables
fixed it by myself -.-
What was the issue?
Yes a table will reduce the amount of separate arguments
The error is not from the snippet of code you posted though so we can't really help
The issue was i didn't even have to use Remote Events.
I mean, that's not why you got the error though...