Hello there. Recently I encountered an issue with my code. A little bit information - I am trying to write a server sided script, that when a player shoots their weapon, creates copies of the two parts of the tool that hold all of the ParticleEmitters, parents them to Workspace, and enables/disables them.
The issue I encountered, is that if I unequip the tool, with the original parts, the :Clone()'d parts are deleted from Workspace. Does anyone have any idea on how I can fix this?
-- More logic above
local ShootPart = Tool.ShootPart:Clone()
local SideBlast = Tool.SideBlast:Clone()
ShootPart.Parent = workspace
SideBlast.Parent = workspace
-- Redacted part that enables and disables ParticleEmitters
Out of curiosity, I added the following code to the bottom, and got an error.
wait(5)
-- I would unequip before the wait(5) is done waiting
print(ShootPart.Parent.Name)
Error:
Players.MentallyDisturbedNub.Backpack.Musket.Server:288: attempt to index nil with 'Name'
I’ve tried everything I can think of to fix this, and have been stuck on this for over 2 hours. Could this be a ROBLOX bug?
