Full Beginner's Guide on scripting Anime/Fighting VFX(Visual Effects) [Part 1]

:rofl: :rofl: :rofl:
i think Touched is pretty beginner friendly regardless of its unreliability since its hitbox can be easily visualized :slight_smile:

Oh well, my IGCSE exams will end on june 7th it will definitely be afterwards yes :sob:

3 Likes

good luck becuse i need help on

1 Year and 6 months later and unfortunately no part 2.

Thank you so much for this tutorial, it’s great. But mind you a bit, can you send me your theme editor, it’s beautiful, just need detailed pictures of colors and fonts, I thank you very much :smiley:.

it was in VS Code but I’ve moved to a new laptop so I have no idea what the theme was anymore :face_with_open_eyes_and_hand_over_mouth:

1 Like

Been HELLA busy… but I might write it if people still check this lol
I myself have been practising a lot of VFX scripting so there’s definitely a lot to cover if I ever make part 2

2 Likes

its all good, and yeah a lot of people still check this I’ve actually spread it around myself, would love to see a part 2.

yea i would like to see a part 2 aswell

I believe I did something wrong, but I don’t know what.
The hitbox drops to the ground, but when I anchor it, it does 0 damage.
Could you send your finished script so I can see what I did wrong? Thanks.
Here’s my server script:

> local ReplicatedStorage = game:GetService("ReplicatedStorage")
> local TweenService = game:GetService("TweenService")
> 
> local Remote = ReplicatedStorage.Abilities.LavaLasher.Ability1Event
> local HitBox = script.HitBox
> local Debounce = {}
> 
> local function ServerReceived(player)
> 	if table.find(Debounce, player.Name) ~= nil then
> 		print("Under Debounce")
> 	else
> 		local Character = player.Character
> 		
> 		print("Server Received")
> 		table.insert(Debounce, player.Name)
> 		
> 		local newHitbox = HitBox:Clone()
> 		local CF = Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-4)
> 		local Pos = Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-100).Position
> 		local Lavaball = ReplicatedStorage.Abilities.LavaLasher:WaitForChild("Lavaball")
> 		
> 		newHitbox.CFrame = CF
> 		newHitbox.Parent = workspace
> 		
> 		Remote:FireAllClients(CF, Pos)
> 		
> 		local function OnClient(CF, Pos)
> 			local newLavaball = Lavaball:Clone()
> 			newLavaball.CFrame = CF
> 			newLavaball.Parent = workspace
> 		
> 		TweenService:Create(
> 			newHitbox,
> 			TweenInfo.new(1),
> 			{Position = Pos}
> 		):Play()
> 		
> 		TweenService:Create(
> 			newLavaball,
> 			TweenInfo.new(1),
> 			{Position = Pos}
> 		):Play()
> 		
> 			newHitbox.Touched:Connect(function(hit)
> 				if not hit:IsDescendantOf(Character) then
> 					local Humanoid = hit.Parent:FindFirstChild("Humanoid")
> 				
> 					if Humanoid then
> 						if Humanoid:FindFirstChild(player.Name.. "Ability1Debounce") then
> 							print("Already Hit!")
> 						else
> 							Humanoid:TakeDamage(5)
> 						
> 							local DebounceValue = Instance.new("BoolValue")
> 							DebounceValue.Name = player.Name.. "Ability1Debounce"
> 							DebounceValue.Parent = Humanoid
> 						end
> 					end
> 				end
> 			end)
> 		end
> 
> 		task.wait(3)
> 		Debounce[table.find(Debounce, player.Name)] = nil
> 	end
> end
> 
> 
> Remote.OnServerEvent:Connect(ServerReceived)

Hello, thanks for reaching out about your problem! .Touched only triggers when two baseparts hit in collision, basically when one of the baseparts (either hitbox or target) moves.

I was planning to put this into part 2 but I’ll briefly explain a quick method for humanoid detection for stationary hitboxes which I use a lot;
GetPartsInPart(BasePart, OverlapParams)

this is how you use it;

local parts = workspace:GetPartsInPart(newHitbox)
-- overlapparams can be used but it can also be done with a simple if statement

so now parts is an array containing ALL baseparts that are inside of the hitbox. We can then use this to identify humanoids by simple if statements checking for a humanoid object and store them;

local targets = {}
for i, v in ipairs(parts) do
   if v.Parent:FindFirstChild("Humanoid") and not v:IsDescendantOf(Character) then -- we can know if what we detected is a character, as well as excluding parts that are from the local character
      if table.find(targets, v.Parent) == nil then -- the target is not in the table yet
         table.insert(targets, v.Parent) -- stores the target in the 'targets' table
      end
   end
end

Now with this, the DebounceValue you have used can also be eliminated as we already have a debounce with table.find().

Now, in your script, after parenting DebounceValue to the humanoid, it just stays there and is never destroyed. This is known as memory leaks; while the term itself may sound complicated, it really isn’t. It’s basically objects that use up memory but are never cleaned and it may not sound much, but in the long run it can load up the server. Furthermore, your ability would only be able to damage the enemy ONCE if used in this way.
Can be fixed with something as simple as;

task.delay(5, function() 
   DebounceValue:Destroy()
end)

or what I prefer more, Debris service;

DebrisService:AddItem(DebounceValue, 5) -- automatically destroys after 5 seconds

If you have any further questions, let me know and I’ll try to see if I can help in any way!

4 Likes

Hello,

Very nice information.
Do you have a .rbxl of it showing your examples you list at the top that you can share?

Thanks

Looking back at it, the scripts are VERYYY outdated lol, I’m thinking of scripting VFX and open-sourcing them on youtube :laughing:

2 Likes

What are the non-beginner method people usually use for the hitbox rather than touch event? For instance, AOE and projectile skills.

Btw, this is the tutorial that I have looked for a long time. looking forward for part 2 :grin:

1 Like

Oh god sorry for the incredibly late reply, personally I prefer using GetPartsInPart for AOE and for projectile skills it definitely has to be raycast. I’m sure most top tier games use this method too :slight_smile: but still, I haven’t been on roblox coding in a while so I don’t know if there has been any recent updates; so take what I just said with a grain of salt.

What an amazing guide! I might pursue VFX in the future and will definitely come back to this if I decide to!

1 Like

So have you made a part 2 to this tutorial yet?

are you still planning on making a part 2?
I’m quite clueless when it comes to scripting vfx :frowning:

woops, been too busy with studies irl, I hope I get more time in the future to maybe work on this im not sure :sweat_smile:

to be honest, if there’s still high demand for scripters to delve into vfx scripting I’m more than willing to cover up almost, if not all aspects of it, along with a youtube video with more live demonstration.

1 Like