The weld constraint i put only works after i use the move once.
local UIS = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = game.Players.LocalPlayer
local Character = player.Character
local HumanoidRootPart = Character.HumanoidRootPart
local Humanoid = Character.Humanoid
local SlashFX1 = ReplicatedStorage.Assests.Effects.Slash1:Clone()
local SlashFX2 = ReplicatedStorage.Assests.Effects.Slash2:Clone()
local SlashFX3 = ReplicatedStorage.Assests.Effects.Slash3:Clone()
local face = require(game.ReplicatedStorage.Modules.FaceMouseModule)
local FX = workspace.FX
local VFXhelp = require(ReplicatedStorage.Modules.VFXHelp)
local slashremote = ReplicatedStorage.Remotes.Slashes
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Replicate = ReplicatedStorage.Remotes.Slashes
local Hitfx = ReplicatedStorage.Assests.Effects.HitFX
local soundmodule = require(game.ReplicatedStorage.Modules.SoundModule)
local function EmitAll(Parent: Instance)
for _, v in Parent:GetChildren() do
if v:IsA("ParticleEmitter") and v:GetAttribute("EmitCount") then
task.delay(v:GetAttribute("EmitDelay"), function()
v:Emit(v:GetAttribute("EmitCount"))
end)
end
end
end
UIS.InputBegan:Connect(function(input,gpe)
if gpe then return end
if input.KeyCode == Enum.KeyCode.C then
SlashFX1.CFrame = HumanoidRootPart.CFrame * CFrame.new(0,0,-5)
SlashFX2.CFrame = HumanoidRootPart.CFrame * CFrame.new(0,0,-5)
SlashFX3.CFrame = HumanoidRootPart.CFrame * CFrame.new(0,0,-5)
SlashFX1.Anchored = false
SlashFX2.Anchored = false
SlashFX3.Anchored = false
local weld = Instance.new("WeldConstraint")
weld.Part0 = SlashFX1
weld.Part1 = HumanoidRootPart
weld.Parent = SlashFX1
local weld2 = Instance.new("WeldConstraint")
weld2.Part0 = SlashFX2
weld2.Part1 = HumanoidRootPart
weld2.Parent = SlashFX2
local weld3 = Instance.new("WeldConstraint")
weld3.Part0 = SlashFX3
weld3.Part1 = HumanoidRootPart
weld3.Parent = SlashFX3
slashremote:FireServer()
local Slash1 = Character.Humanoid:LoadAnimation(game.ReplicatedStorage.Assests.Animations.S1)
local Slash2 = Character.Humanoid:LoadAnimation(game.ReplicatedStorage.Assests.Animations.S2)
local Slash3 = Character.Humanoid:LoadAnimation(game.ReplicatedStorage.Assests.Animations.S3)
local Slash4 = Character.Humanoid:LoadAnimation(game.ReplicatedStorage.Assests.Animations.S4)
task.wait(.2)
SlashFX1.Parent = FX
EmitAll(SlashFX1.Slash1)
soundmodule.PlaySound(4085939047,ReplicatedStorage.Assests.Sounds["Blade Swing 1"])
Slash1:Play()
task.wait(.5)
SlashFX2.Parent = FX
Slash2:Play()
EmitAll(SlashFX2.Slash2)
soundmodule.PlaySound(4085939047,ReplicatedStorage.Assests.Sounds["Blade Swing 1"])
task.wait(.5)
SlashFX3.Parent = FX
Slash3:play()
EmitAll(SlashFX3.Slash3)
soundmodule.PlaySound(4085939047,ReplicatedStorage.Assests.Sounds["Blade Swing 1"])
weld:Destroy()
task.wait(.2)
weld2:Destroy()
task.wait(.2)
weld3:Destroy()
end
end)