Before, I used to have just one sword for everyone to use when they played in a match. But, recently I added more swords which players can purchase to upgrade. It seems like ever since I added that new feature my game has been failing a ton. Some players won't spawn in the match, some players don't even have a sword in the match, and others don't have leader stats for money!
I created a short video of my problems and the scripts which received the error message:
http://drive.google.com/file/d/1rA_i4K32Wd7OAZPcv9uLMcS0S3h-CdeI/view?usp=sharing
Why won't my players get there leader stats folder and their swords when they join the game?
BTW I am new to scripting so thanks!
If you think the problem is something else, and let me know.
You need to clone the sword because by only changing the parent and not cloning it, there will be no more swords to give to the other players. This causes the script to error and not get to adding the leaderstats. So instead you should replace lines 12 and 13 with the following:
local ClassicSword = game:GetService("ServerStorage").Tools.ClassicSword:Clone() ClassicSword.Parent = player.Sword