So I'm making a weapon select GUI with one master script for each category of weapons that gives you the weapon you want, if you have enough points for it, and it does this for each button, as long as the options inside them exist. So far, it works perfectly, except for one thing. Clicking the button clears your player's StarterGear and puts the new weapon inside it, so you get the weapon next time you respawn. It works fine with singleplayer testing, but in a server, it doesn't give me my startergear tools when I spawn in, even though it does put the weapon in there, handle and everything. Is this a problem with my script, or a problem with roblox? Here's the part of my script that puts the weapon in your player's startergear, where weapon is a variable for the button's "Weapon" ObjectValue, which links to a tool in ReplicatedStorage
local startergears = player.StarterGear:GetChildren() for i = 1, #startergears do startergears[i]:Destroy() end local newweapon = weapon.Value:Clone() newweapon.Parent = player.StarterGear
I really hope this isn't a problem with Roblox, because other than startergear, I have no idea how to make the weapon you've selected save after you die, and I don't want my players to have to select the weapon again everytime they respawn by putting the weapon in their backpack. If you need need more of my script, please let me know.