Hey, im making a rng game, and i need to move all the content from my vfx folder, to the HumanoidRootPart
Anything i could do?
(Here is my code)
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")
local button = script.Parent
local gui = button.Parent
local auraFolder = game:GetService("ReplicatedStorage"):WaitForChild("AurasT")
local auras = auraFolder:GetChildren()
local vfxfolder = game:GetService("ReplicatedStorage"):WaitForChild("AuraVfx")
local rollText = gui.AuraLabel
local playerInv = Instance.new("Folder")
playerInv.Parent = game.Players.LocalPlayer
playerInv.Name = "playerinv"
button.MouseButton1Click:Connect(function()
local aura = auras[math.random(1, #auras)]
for i=1, #auras do
wait(.1)
local randomAura = auras[math.random(1, #auras)]
rollText.Text = randomAura.Name
end
wait(.1)
rollText.Text = aura.Name
print(aura.Name)
local gottenaura = aura:Clone()
gottenaura.Parent = playerInv
local auraVfx = vfxfolder:WaitForChild(gottenaura.Name, 3)
if auraVfx then
local vfx = auraVfx:WaitForChild("Vfx")
local particles = auraVfx:WaitForChild("Particles")
local text = auraVfx:WaitForChild("Text")
local partcont = particles:GetChildren()
local textcont = text:GetChildren()
local vfxcont = vfx:GetChildren()
for i=1,#partcont do
for i2,v in pairs(partcont) do
if v:IsA("ParticleEmitter") then
local newAtt = Instance.new("Attachment")
newAtt.Name = v.Name
newAtt.Parent = hrp
v.Parent = newAtt
end
end
end
for i,v in pairs(textcont) do
if v:IsA("BillboardGui") then
v.Parent = char.Head
end
end
print(vfxcont.Parent)
end
end)
in the print(vfxcont.Parent)
line, i got nil
in my console, so that didn’t work…