I want to rotate these parts like a tween however it is welded
Really unsure of how to do this and need some pointers, please don’t rewrite my script for me.
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character
local tool = script.Parent
local mouse = Player:GetMouse()
local Charging = script:WaitForChild("Charging")
local ChargeAnim = script.Charge
local AttackAnim = script.Attack
local ChargeParticles = script.ChargeVFX.ParticleEmitter
local ChargeRed = script.ChargeVFX.ChargeRed
local ChargeBlack = script.ChargeVFX.ChargeBlack
local TweenService = game:GetService("TweenService")
tool.Equipped:Connect(function(mouse)
mouse.Button2Down:Connect(function()
Charging.Value = true
local Humanoid = tool.Parent.Humanoid
local anim = Humanoid:LoadAnimation(script.Charge)
anim:Play()
local vfx1 = ChargeParticles:Clone()
vfx1.Parent = tool.Handle
vfx1.Name = ("vfx1")
local vfx2 = ChargeRed:Clone()
vfx2.Parent = tool
vfx2.Name = ("vfx2")
local Weld1 = Instance.new("Weld", tool.Handle);
Weld1.Part0 = tool.Handle;
Weld1.Part1 = vfx2;
Weld1.C1 = CFrame.new(0,0,0)*CFrame.Angles(0,0,math.rad(90));
vfx2.Anchored = false;
vfx2.Transparency = 1
local vfx3 = ChargeBlack:Clone()
vfx3.Parent = tool
vfx3.Name = ("vfx3")
local Weld2 = Instance.new("Weld", tool.Handle);
Weld2.Part0 = tool.Handle;
Weld2.Part1 = vfx3;
Weld2.C1 = CFrame.new(0,0,0)*CFrame.Angles(0,0,math.rad(90));
vfx3.Anchored = false;
vfx3.Transparency = 1
while Charging.Value == true and wait do
vfx2.Transparency = vfx3.Transparency - 0.05
vfx3.Transparency = vfx3.Transparency - 0.05
wait(0.1)
if vfx2.Transparency == 0 then
break
end
end
end)
mouse.Button2Up:Connect(function()
Charging.Value = false
tool.Handle.vfx1:Destroy()
local Humanoid = tool.Parent.Humanoid
local AnimationTracks = Humanoid:GetPlayingAnimationTracks()
for i, track in pairs (AnimationTracks) do
track:Stop()
end
end)
end)