I have an OOP sword system, and am having trouble when a player equips the item for the second time.
function Sword:new()
self.LastSwing = 0
self.SwingIndex = 1
self.DoingCombo = false
self.Moving = true
self.Swung = false
self.SwordsData = SwordData[self.Sword]
self.Model = self.Character:WaitForChild("Item")
print(self.Model.HitAttach)
print(self.Model:GetFullName())
end
The first time they equip, everything is printed correctly. But when I equip again, I get
HitAttach is not a valid member of Part "Workspace.NinjoOnline.Item"
Unsure why it works the first time but not the second time. Is there a way to wait for all objects to exist?? When I look in workspace, the sword does have the hitattach attachments.
I can’t just do :WaitForChild(“HitAttach”) either, as there are 10+ (depending on sword) so I need all loaded before