Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Keeps saying that HumanoidRootPart is not a valid member of player?

Asked by 4 years ago

The error occurs at the line where it says: local Position = Character.HumanoidRootPart.CFrame*CFrame.Angles(7.85,0,0)

function module:DashEffects(Character,Direction)
    for i,v in pairs(Character:GetChildren()) do
        if v:IsA("BasePart") then
            local Clone = v:Clone()
            for i,e in pairs(Clone:GetChildren()) do
                if not e:IsA("SpecialMesh") then
                    e:Destroy()
                end
            end
            Clone.Color = Color3.fromRGB(255,255,255)
            Clone.Material = "SmoothPlastic"
            Clone.Name = "ShadowPart"
            Clone.Parent = workspace
            Clone.CanCollide = false
            Clone.Anchored = true
            Clone.Transparency = 0.5
            local Goal = {}
            Goal.Transparency = 1
            Goal.Size = Clone.Size+Vector3.new(0.5,0.5,0.5)
            TweenService:Create(Clone,TweenInfo.new(0.5),Goal):Play()
            game:GetService("Debris"):AddItem(Clone,0.5)
        elseif v:IsA("Accessory") then
            local Clone = v.Handle:Clone()
            for i,e in pairs(Clone:GetChildren()) do
                if not e:IsA("SpecialMesh") then
                    e:Destroy()
                else
                    e.TextureId = ""
                end
            end
            Clone.Color = Color3.fromRGB(255,255,255)
            Clone.Material = "SmoothPlastic"
            Clone.Name = "ShadowPart"
            Clone.Parent = workspace
            Clone.CanCollide = false
            Clone.Anchored = true
            Clone.Transparency = 0.5
            local Goal = {}
            Goal.Transparency = 1
            Goal.Size = Clone.Size+Vector3.new(0.5,0.5,0.5)
            TweenService:Create(Clone,TweenInfo.new(0.5),Goal):Play()
            game:GetService("Debris"):AddItem(Clone,0.5)
        end
    end
    local Position = Character.HumanoidRootPart.CFrame*CFrame.Angles(7.85,0,0)
    if Direction == "right" or Direction == "left" then
        Position = Character.HumanoidRootPart.CFrame*CFrame.Angles(7.85,0,7.85)
    end
    Position = Position*CFrame.Angles(0,math.random(-360,360),0)
    local Shockwave = game.ReplicatedStorage.Assets.Effects.WeakShockwave:Clone()
    Shockwave.Parent = workspace
    Shockwave.Size = Vector3.new(6,0.2,6)
    Shockwave.CFrame = Position
    game:GetService("Debris"):AddItem(Shockwave,0.5)
    local Goal = {}
    Goal.Size = Vector3.new(15,0.2,15)
    Goal.Transparency = 1
    TweenService:Create(Shockwave,TweenInfo.new(0.5),Goal):Play()
end
0
Are you sure you referenced a character and not something else, like its player? Dfzoz 489 — 4y
0
Ye Justingamer700 114 — 4y
0
you should probably use :WaitForChild() and see, if it says infinite yield, you should probably use print statements AnasBahauddin1978 715 — 4y
0
It should be player.Character.HumanoidRootPart not Character.HumanoidRootPart. Try this and check if it works.. SilentsReplacement 468 — 4y
0
if Character is defined as the expect function argument then there should be no issue with this. Try again. Fifkee 2017 — 4y

Answer this question