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

sure!

LocalScript

uis.InputBegan:Connect(function(Input,GameProcessed)
	if GameProcessed then return end
	
	if Input.UserInputType == Enum.UserInputType.MouseButton1 then
		if Global then
			return
		else
			if not table.find(Cooldowns,Input.UserInputType) then
				M1time = tick()
				local passedTime = M1time - previousM1time
				
				if passedTime < 1.85*AS then
					GUIMessenger:FireServer(player,Enum.UserInputType.MouseButton1,1.85*AS,1,2)
					coroutine.resume(coroutine.create(function()
						table.insert(Cooldowns, Input.UserInputType)
						task.wait(1.85*AS)
						local Value = table.find(Cooldowns,Input.UserInputType)
						table.remove(Cooldowns, Value)				
					end))

					coroutine.resume(coroutine.create(function()
						Global = true
						task.wait(1.1)
						Global = false
					end))
					
					local combo2 = Humanoid:LoadAnimation(AnimationsFolder.m1["2"])
					combo2:Play()

					local Connection
					Connection = combo2.KeyframeReached:Connect(function(kfname)
						Attack:FireServer(Input.UserInputType,2,Mouse.UnitRay.Direction)
						Connection:Disconnect()
					end)

					previousM1time = M1time
					M1time = 0
				else
					coroutine.resume(coroutine.create(function()	
						table.insert(Cooldowns, Input.UserInputType)
						task.wait(1.65*AS)
						local Value = table.find(Cooldowns,Input.UserInputType)
						table.remove(Cooldowns, Value)				
					end))

					coroutine.resume(coroutine.create(function()						
						Global = true
						task.wait(1)
						Global = false
					end))

					GUIMessenger:FireServer(player,Enum.UserInputType.MouseButton1,1.65*AS,1,1)

					local combo1 = Humanoid:LoadAnimation(AnimationsFolder.m1["1"])
					combo1:Play()

					local Connection
					Connection = combo1.KeyframeReached:Connect(function(kfname)
						if kfname == "StartAttack" then
							for i = 1,4 do
								Attack:FireServer(Input.UserInputType,1,Mouse.UnitRay.Direction)
								task.wait(.1)								
							end
							Connection:Disconnect()
						end
					end)
				end
			end
		end
	end
end)


local function Create(Position,Position2,Param1,Param2)
	local newSpin = rs.SpinnyThing:Clone()
	debris:AddItem(newSpin,3)
	newSpin.Parent = workspace
	newSpin.Material = Enum.Material.Neon
	newSpin.Transparency = 0.1
	newSpin.Size += Vector3.new(5,5,5)
	newSpin.Mesh.Scale = newSpin.Size
	newSpin.CFrame = CFrame.new(Position,Position + Position2)*CFrame.Angles(math.rad(90+(Param1)),0,math.rad(Param2))

	return newSpin
end

FX.OnClientEvent:Connect(function(Input,Param1,Param2,Param3,Param4)
	if Input == Enum.UserInputType.MouseButton1 then
		if Param4 == 1 then
			local newSpin = Create(Param2,Param3,0,0)
			local v = fxmod.Velocity(newSpin,Param1,3)
			
			task.spawn(function()
				task.wait(0.2)
				while newSpin and runservice.RenderStepped:Wait() do
					local cf = CFrame.new(Param1) * CFrame.Angles(0,math.rad(90),0)
					v.Velocity = (Param1 + cf.lookVector)*100
					wait(0.1)
					local cf = CFrame.new(Param1) * CFrame.Angles(0,math.rad(-90),0)
					v.Velocity = (Param1 + cf.lookVector)*100
					wait(0.1)
				end
			end)
		end
	end
end)

ServerScript

local function Create(Position,Position2,Param1,Param2)
	local newSpin = rs.SpinnyThing:Clone()
	debris:AddItem(newSpin,3)
	newSpin.Parent = workspace
	newSpin.Material = Enum.Material.Neon
	newSpin.Transparency = 0.1
	newSpin.Size += Vector3.new(5,5,5)
	newSpin.Mesh.Scale = newSpin.Size
	newSpin.CFrame = CFrame.new(Position,Position + Position2)*CFrame.Angles(math.rad(90+(Param1)),0,math.rad(Param2))
	
	return newSpin
end

Attack.OnServerEvent:Connect(function(Player,Input,Optional1,UnitRay)
	local Character = Player.Character
	local HRP = Character.HumanoidRootPart
	local RightArm = Character.RightLowerArm
	local Humanoid = Character:WaitForChild("Humanoid")
	
	local raycastParams = RaycastParams.new()
	raycastParams.FilterDescendantsInstances = {Character}
	raycastParams.FilterType = Enum.RaycastFilterType.Blacklist

	if Optional1 == 1 then
		local Direction = UnitRay*100
		local Position = RightArm.CFrame.Position
		local Position2 = HRP.CFrame.LookVector
		
		local newSpin = Create(Position,Position2,0,0)
		local newHitbox = rch.new(newSpin)
		newHitbox.Visualizer = false
		newHitbox.RaycastParams = raycastParams
		newHitbox:HitStart()

		local c
		c = newHitbox.OnHit:Connect(function(hit,hum)
			if hum then
				if hum.Parent ~= Character then
					newHitbox:HitStop()
					fxmod.TakeDamage(Character,hum.Parent,10,75)
					task.wait(.075)
					newHitbox:HitStart()
				end
			end

			c:Disconnect()
		end)
		
		fxmod.Velocity(newSpin,Direction,3)
		FX:FireAllClients(Input,Direction,Position,Position2,1)
	end
end)

I’m new to this and I don’t know what to use, heres the output in my screen (it seems very laggy and the hitbox falls back, same with the spinning part. (im using raycast hitbox v4))
https://gyazo.com/f19b60bb2c09564756690947ce22606c.mp4

2 Likes

That’s really helped me, Im waiting for part 2 of the Tutorial

1 Like

Thanks it working! i’ve added some things like animations and raycasting but i have a question on one of your videos when the ball touches the ground some parts spawn with the same material of the surface that they touch so i wondered if you used .Material from the raycast result or you just take the material and color directly from the part like

local material = hit.Material
local Color = hit.Color

then put those values on the part that will be created ?

so, when are we getting that promised part 2 :eyes: i’m quite interested to finally learn proper scaling and ‘making it look good’

Slide them exquisite scripting colors :pray: :pray:

Hello, it’s really good guide but we want 2 part, we wait this

:eyes: Is there any update on when it’s coming out?

4 Likes

What if a player joins after the FireAllClients, they wouldn’t be able to see the effects right? All the clients that were fired only included the players that were in the game at that current time. If someone new were to join, they wouldn’t be able to see the effects. Is there any way around this?

3 Likes

Yep, I’ve been stuck very much with exams during the past weeks so I’m writing it now. Thinking about what to add into the new tutorial so it’s gonna take a few days, thanks for being interested though :slight_smile:

4 Likes

Cool cool! Can’t wait to see it!

1 Like

Hey, I don’t understand how to make the client replication vfx, like how is the function OnClient called ? (Also great tutorial btw)

Hi, i I’m still waiting for the update of the brow tutor) I really want to start making all sorts of skills, otherwise something is not right

Sorry for the big big delay… I’ve been very busy with school as it’s the most important year. I’ll try to make spare time to write this, hopefully! :innocent:

1 Like

Well, I’m really looking forward to your guide, because thanks to you, I understood how all this is done. Can you tell me when the continuation of the guide will be released approximately

What font is your script editor? It looks really good!

How can I use the font in my script?

Download it as a window font, go to studio, studio settings, script font

it’s been over a year oopsies
my main exams are gonna start on may 2nd, done on june 7th and my parents have been pushing me too hard TT here’s some progress on my vfx work which i could show you guys how to do (if i have enough free time :laughing:)

https://gyazo.com/3bb0ae2eb3bd79d37d621488577492a0.mp4
https://gyazo.com/a000e4b9cdcab84ad1bb5ab40cff7028

3 Likes

Not Touched bro :sob: :sob: :sob: :sob: :sob:

2 Likes

Where the frog is part two? I really need it for my new game which has a requirement of when I need it done.