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

5 comments

0

Are you sure you referenced a character and not something else, like its player?

0

Ye

0

you should probably use :WaitForChild() and see, if it says infinite yield, you should probably use print statements

0

It should be player.Character.HumanoidRootPart not Character.HumanoidRootPart. Try this and check if it works..

0

if Character is defined as the expect function argument then there should be no issue with this. Try again.