#Removing weapons not working

1 messages · Page 1 of 1 (latest)

flint niche
#

So i have this code in a module script that handles character selection in my battlegrounds game. For some reason, instead of deleting the instance of the weapon on the player it deletes the original in replicated storage so if you switch back to that character it won't make a new weapon. The most confusing oart is that this only happends with the character with one weapon. Another character that dual weilds doesnt have this issue, but instead it only deletes the right hand sword, but i may be able to fix that myself. Please help

vocal sequoia
#

maybe they're related thonkoof

chrome oyster
#

FindFirstChild("Weapon") is only grabbing one weapon at a time, which is why your dual-wield character only loses one sword. And somehow it's reaching back and deleting the original in ReplicatedStorage instead of just the copy on the character

vocal sequoia
#

they're probably moving the original weapon on equip instead of cloning it

chrome oyster
#

could make sense which would explain why the original would be getting destroyed

flint niche
#

@chrome oyster im cloning the weapon from replicated storage

#

this is part of the get weapon

#

the other parts do it for the other hand and for both hands

chrome oyster
#

your getWeapon function you're parenting the original weapon instead of the clone. You have weapon.Parent = char but it should be clonedWeapon.Parent = char. That's why the original in ReplicatedStorage is getting moved

vocal sequoia
#

you create the clone but parent the original anyway hehe

flint niche
#

bro i feel stupid now lol