Yeah, but the way I stated it is just a more cleaned up version, I guess I should of stated that.
basically,
local Aura = game:GetService("ServerStorage").RossAura.Aura --I'm pretty sure you can place this outside the function
for i, humParts in Plr:GetChildren() do
if humParts:IsA("BasePart") or humParts:IsA("MeshPart") then
if Tool and Aura then
for i, AuraPart in Aura:GetChildren() do
AuraPart:Clone().Parent = humPart
AuraPart.Enabled = true
if AuraPart.Name == "Shockwave" then
local A = Instance.new("Attachment")
A.Parent = Plr.HumanoidRootPart
end
end
end
end
end
I’m assuming the code didn’t work because one of the values probably got mixed up or something.
Other things to note,
-
I don’t really care about this but I’m pretty sure other people would and to avoid this post from getting reported you should categorized this post as Scripting Support and not Platform Usage Support
-
The Loops are called for loops, not ipair loops
-
If you’re not going to use the i values put an underscore ,
for _,v in pairs()
, just makes it more organized -
You don’t really need to use ipairs or pairs anymore as stated from this guy
- Assuming you want it attached at the center of the part, don’t do
A.Position = HRP.Position
the Attachment sets it’s Origin Position as the Parent’s Position. Basically, when the attachment says it’s Position is 0,0,0 it’s really saying it’s position is the Parent’s Position. So when you set the Attachment’s position as 0,1,0 you’re really doing, Parent’s Position plus (0,1,0). - If you care about peformance, I suggest you don’t use the parenting argument in Instance.new(), this post goes deep into it if you really care about why
PSA: Don't use Instance.new() with parent argument