Adding VFX To Skills

  1. What do you want to achieve?
    To learn how to add VFX / Effects to combat skills in general and i will be using Client Replication for sure
  2. What is the issue?
    I have been trying to learn how to do that but it just got more complicated for me

Let me tell you the main idea , So i have been trying to make a “Elemental Skill Fight” game and i managed to code the input , main server , and module script for a fireball skill with no vfx (hitbox) without any problems. But the issue comes here , Even tho i searched and tried to understand how to implement vfx to skills i didnt even get the main idea of it , Im just asking for someone teach me the ways to implement vfx to skills and with client replication if possible ( i kinda understand it just need the vfx part mostly)

My Fireball Module Script
Oh and yes ik i didnt impement some systems like cooldowns but thats not important as of now since im focused on vfx

local module = {}


local EffectsEvent = game:GetService("ReplicatedStorage").Remotes.EffectsEvent
local Debris = game:GetService("Debris")

function module.Fireskill(player,MouseCFrame)
	
	print("Module Fired")
	
	local FireballPart = game:GetService("ServerStorage").FireballHitbox
	local ExplosionHitboxPart = game:GetService("ServerStorage").ExplosionHitbox
	local plr = player
	local character = plr.Character
	local hrp = character:FindFirstChild("HumanoidRootPart")
	local mousePos = MouseCFrame.Position
	
	
    local hitbox = FireballPart:Clone()
	hitbox.Parent = workspace
	hitbox.CFrame = hrp.CFrame * CFrame.new(0,10,0)
	
	local Attachment = Instance.new("Attachment",hitbox)
	
	local LinearVelo = Instance.new("LinearVelocity",hitbox)
	LinearVelo.Attachment0 = Attachment
	LinearVelo.MaxForce = math.huge
	LinearVelo.VectorVelocity = (mousePos - (hrp.CFrame * CFrame.new(0,10,0).Position)).Unit * 50 
	
	hitbox.Touched:Connect(function(hit)
		local hitCharacter = hit:FindFirstAncestorOfClass("Model")
		if hitCharacter and hitCharacter == character then return end
		if hit.Name == hitbox.Name or hit.Name == ExplosionHitboxPart.Name then return end

		print(hit)
		hitbox:Destroy()
		local ExplosionHitbox = ExplosionHitboxPart:Clone()
		ExplosionHitbox.Parent = workspace
		ExplosionHitbox.CFrame = hitbox.CFrame
		
		Debris:AddItem(ExplosionHitbox,0.2)
	end)

	
	Debris:AddItem(hitbox,5)
	
end
return module

How my fireball works with hitboxes only (ignore the effect i tried to put on to it)

Example Fireball for what im trying to achieve (better or worse)

1 Like