Currently, I’m looking into visual effects, my combat seems to work relatively well, but the issue comes to be when I try to make the VFX work from RedPlys video. It doesn’t actually activate, but everything else seems to work properly?
Combat Module
--Enemy-Player Variables--
local enemyChar = parts.Parent
local enemyRootPart = parts.Parent.HumanoidRootPart
local enemyHumanoid = parts.Parent.Humanoid
if enemyChar:GetAttribute("IsBlocking") == true then
DMG = DMG/5
end
if enemyHumanoid:GetAttribute("Parry") == true then
CS:AddTag(Character, "Dazed")
Character.WalkSpeed = 1
Character.JumpPower = 1
end
if Count == 4 and enemyChar:GetAttribute("IsBlocking") == true then
enemyChar:SetAttribute("IsBlocking", false)
local BV = Instance.new("BodyVelocity", parts.Parent.HumanoidRootPart)
BV.MaxForce = Vector3.new(22500, 22500, 22500)
BV.P = 33300
BV.Velocity = -parts.Parent.HumanoidRootPart.CFrame.LookVector * 40
Debris:AddItem(BV, 0.005)
CS:AddTag(enemyChar, "GuardBroken")
enemyHumanoid.WalkSpeed = 0
enemyHumanoid.JumpPower = 0
coroutine.wrap(function()
enemyHumanoid.Animator:LoadAnimation(CombatHandler.Misc):Play()
coroutine.yield()
end)
end
if CS:HasTag(Player, "Stun") or CS:HasTag(Player, "GuardBroken") then
return
end
enemyHumanoid:TakeDamage(DMG)
coroutine.wrap(function()
for _, plr in pairs(game.Players:GetChildren()) do
VFX:FireClient(plr, "CombatVFX", "vfx", enemyRootPart)
end
end)()
if enemyChar:GetAttribute("IsBlocking") == false then
enemyHumanoid.Animator:LoadAnimation(CombatHandler.HitReaction[Count]):Play()
end
CS:AddTag(enemyChar, "Stun")
enemyHumanoid.WalkSpeed = 2
enemyHumanoid.JumpPower = 2
MM.DelayControl(enemyChar, "Stun", .150, enemyHumanoid, 16, 50.125)
MM.DelayControl(enemyChar, "GuardBroken", 5, enemyHumanoid, 16, 50.125)
MM.DelayControl(Character, "Dazed", 3, Hum, 16, 50.125)
--Knock-Back--
if Count == 4 then
local BV = Instance.new("BodyVelocity", parts.Parent.HumanoidRootPart)
BV.MaxForce = Vector3.new(22500, 22500, 22500)
BV.P = 33300
BV.Velocity = -parts.Parent.HumanoidRootPart.CFrame.LookVector * 40
Debris:AddItem(BV, 0.25)
end
end
break
end
end
VFX Module
local Debris = game:GetService("Debris")
local Meshes = script.Meshes
local People = workspace.LivingThings
local SSS = game:GetService("ServerScriptService")
local RS = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local COMBAT = game.ReplicatedStorage.CombatEvents.Combat
local CombatVFXHandler = {}
function CombatVFXHandler.vfx(arg)
local Folder = Instance.new("Folder")
Folder.Name = "CombatVFX"
Folder.Parent = workspace
Debris:AddItem(Folder, 1)
coroutine.wrap(function()
for i=1, 12 do
local Sphere = Meshes.Sphere:Clone()
Sphere.Size = Vector3.new(.1, .1, .1)
Sphere.CFrame = arg[3].CFrame * CFrame.Angles(math.rad(math.random(-180, 180)), math.rad(math.random(-180, 180)), math.rad(math.random(-180, 180))) * CFrame.new(0, 0, -.5)
Sphere.Parent = Folder
Debris:AddItem(Sphere, .5)
TweenService:Create(Sphere, TweenInfo(.25),{CFrame = Sphere.CFrame * CFrame.new(0, 0, -10)}):Play()
TweenService:Create(Sphere, TweenInfo(.125), {Size = Vector3.new(.2, .2, 5)}):Play()
task.delay(.125, function()
TweenService:Create(Sphere, TweenInfo(.125), {Size = Vector3.new(.1, .1, .1), Transparency = 1}):Play()
end)
end
end)
end