How do I move a part from ReplicatedStorage to a specific limb/part of a Character?

I got this free flying script from somewhere (I forgot where from) and I’m HEAVILY modifying it, but I can’t seem to figure out how to move my wind burst effect from the ReplicatedStorage to the specific limb/part I want to move it to, let alone the HumanoidRootPart. Everything actually works, except for the animation which is a whole other issue involving animation weight, but I can’t figure out how to move the effect to the desired spot.

Video:

Portion of script where I’m trying to implement:

local Players = game:GetService("Players")
local player = Players.LocalPlayer
local humanoidRootPart = player.Character.PrimaryPart




--3rd Person Effects
local windBurst = game.ReplicatedStorage["Wind Burst Facing"]
if windBurst.ParticleEmitter.Enabled == true then
	windBurst.Parent = humanoidRootPart
end
windBurst.ParticleEmitter.Enabled = false




game:GetService("RunService").RenderStepped:Connect(function()
	if script.Parent == Character then
		if Flying == true then
			Humanoid:ChangeState(6)
			v3.CFrame = game.Workspace.Camera.CFrame
			if u2() == Vector3.new(0, 0, 0) then
				Flymoving.Value = false
			else
				Flymoving.Value = true
			end
			TweenService:Create(BodyVelocity, TweenInfo.new(0.3), {Velocity = u2() * 350}):Play()
		end
		
	end
end)

Flymoving.Changed:Connect(function(p1)
	if p1 == true then
		TweenService:Create(Camera, TweenInfo.new(0.5), {FieldOfView = 100}):Play()
		v10:Stop()
		Sound2:Play()
		windBurst.ParticleEmitter:Emit(1)
		Sound1:Play()
		v11:Play()
		return
	end
	if p1 == false then
		TweenService:Create(Camera, TweenInfo.new(0.5), {FieldOfView = 70}):Play()
		v11:Stop()
		Sound2:Play()
		Sound1:Stop()
		v10:Play()
		
	end
end)

Emitting is not the same as having the Enabled property == true, atleast I am led to believe

1 Like

In the video, the effect itself actually works, the problem is that it is not coming from the player.

I am aware but your logic to place it on the humanoidrootpart is probably the reason.

Is there a reason why you are not just parenting it to the humanoidrootpart when you run the :Emit()?

1 Like

Oh, I just realized what you were saying, I’m still getting to used to scripting and how everything has to line up exactly.

Its all good, learning takes time-- just experiment with it and you’ll get something desirable, I think what you should do is place the windBurst using :PivotTo() or just windBurst.Position = HumanoidRootPart.Position, right before you actually call the :Emit()

1 Like

It still doesn’t want to work, this is the new code:

local Players = game:GetService("Players")
local player = Players.LocalPlayer
local humanoidRootPart = player.Character.PrimaryPart


--3rd Person Effects
local windBurst = game.ReplicatedStorage["Wind Burst Facing"]
windBurst.ParticleEmitter.Enabled = false




game:GetService("RunService").RenderStepped:Connect(function()
	if script.Parent == Character then
		if Flying == true then
			Humanoid:ChangeState(6)
			v3.CFrame = game.Workspace.Camera.CFrame
			if u2() == Vector3.new(0, 0, 0) then
				Flymoving.Value = false
			else
				Flymoving.Value = true
			end
			TweenService:Create(BodyVelocity, TweenInfo.new(0.3), {Velocity = u2() * 350}):Play()
		end
		
	end
end)

Flymoving.Changed:Connect(function(p1)
	if p1 == true then
		TweenService:Create(Camera, TweenInfo.new(0.5), {FieldOfView = 100}):Play()
		v10:Stop()
		Sound2:Play()
		windBurst.ParticleEmitter:Emit(1)
		windBurst.Parent = humanoidRootPart
		Sound1:Play()
		v11:Play()
		return
	end
	if p1 == false then
		TweenService:Create(Camera, TweenInfo.new(0.5), {FieldOfView = 70}):Play()
		v11:Stop()
		Sound2:Play()
		Sound1:Stop()
		v10:Play()
		
	end
end)

Because Parent does not influence or change the parts position, you’ll have to do that with by setting its position or using :PivotTo()

I suggest using PivotTo() tho.

1 Like

I have tried both .Position and :PivotTo() and it now disappears, did I do something wrong with the HumanoidRootPart itself?
New code:

Flymoving.Changed:Connect(function(p1)
	if p1 == true then
		TweenService:Create(Camera, TweenInfo.new(0.5), {FieldOfView = 100}):Play()
		v10:Stop()
		Sound2:Play()
		windBurst:PivotTo(humanoidRootPart)
		windBurst.ParticleEmitter:Emit(1)
		Sound1:Play()
		v11:Play()
		return
	end
	if p1 == false then
		TweenService:Create(Camera, TweenInfo.new(0.5), {FieldOfView = 70}):Play()
		v11:Stop()
		Sound2:Play()
		Sound1:Stop()
		v10:Play()
		
	end
end)

I also got an output error saying “Unable to cast Instance to CoordinateFrame - Client - FlyScript:82”

lol

windBurst:PivotTo(humanoidRootPart:GetPivot())

forgot to mention

1 Like

Sorry for getting back to you so late , but that doesn’t appear to work either

You also need to parent it to the workspace still.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.