Don't know how to make hitbox for attack and not sure how to make slide

You can write your topic however you want, but you need to answer these questions:

  1. I have animations for Demon Flip, and I am trying to replicate the Rogue Lineage demon flip as much as possible.
  2. I dont have much experience on hitboxes, and I don’t know how to deactivate and activate. I also don’t know how to make them slide, instead of them just moving around in the animation.
  3. I went on the developer forum to fix my animations, but that is all.
wait(2)
local Player = game.Players.LocalPlayer
local RunService = game:GetService("RunService")
local character =Player.Character or Player.CharacterAdded:wait()
local Cooldown = Instance.new("BoolValue", game.Players.LocalPlayer)
Cooldown.Value = false
local Humanoid = character:WaitForChild("Humanoid")
local Mouse = Player:GetMouse()
local m1 = Instance.new("Animation")
local Debounce = false
local DebounceTimer = 6
m1.AnimationId = "rbxassetid://5945839988"
local m2 = Instance.new("Animation")
m2.AnimationId = "rbxassetid://5946655147"
local tool = script.Parent.Parent.DemonFlip
local mouse = Player:GetMouse()
mouse.Button1Down:Connect(function()
	if character:FindFirstChild("DemonFlip") and Cooldown.Value == false then
		Cooldown.Value = true
		local sound = Instance.new("Sound", game.Players.LocalPlayer)
		sound.SoundId = "rbxassetid://5355789788"
		sound:Play()
		local track = Humanoid:LoadAnimation(m1)
		track:Play()
		track.Stopped:wait()
		sound:Destroy()
	end
end)
	

	
mouse.Button2Down:Connect(function()
		if character:FindFirstChild("DemonFlip") and Cooldown.Value == false then
		Cooldown.Value = true
		local sound = Instance.new("Sound", game.Players.LocalPlayer)
		sound.SoundId = "rbxassetid://5355789788"
		local runtrack = Humanoid:LoadAnimation(m2)
		sound:Play()
		runtrack:Play()
		runtrack.Stopped:wait()
		sound:Destroy()
		end
end)
Cooldown.Changed:Connect(function()
	if Cooldown.Value == true then
		wait(5)
		Cooldown.Value = false
	end
end)
2 Likes

To make it slide, you should add a bodymover or velocity to the player’s humanoid root part, make the velocity face the front of the humanoid root part, it should create a slide motion, you could add some changes to make it smoother.

Since you said how to make a hitbox for it, you can simply add a transparent block that has it’s collision turned off, weld it to the player’s humanoid root part then detect if something touched it using a touched function, if it does, make a if statement if it’s a player, if it is a player then add some stun to the player and some animation (optional) to recreate the one in Rogue Lineage.

Now you can damage the target’s humanoid then after a bit of seconds, the hitbox would be destroyed to prevent some bugs.

If you have further questions you could say them.

1 Like

Could I get some examples within my localscript, (or a new serverscript)

uhh i’m busy right now but you can figure it out

btw you should use remote events if you use local scripts that also reside with the server

1 Like

Would I put a BodyPosition, or bodyvelocity?

Body position keeps the parent in place depending on it’s changes, you should use body velocity or just simply velocity.

1 Like

The velocity works. But it doesn’t slide as much, Any fix?

wait(2)
local Player = game.Players.LocalPlayer
local RunService = game:GetService("RunService")
local character =Player.Character or Player.CharacterAdded:wait()
local Velocity = Instance.new("BodyVelocity", character.HumanoidRootPart)
local Cooldown = Instance.new("BoolValue", game.Players.LocalPlayer)
Cooldown.Value = false
local Humanoid = character:WaitForChild("Humanoid")
local Mouse = Player:GetMouse()
local m1 = Instance.new("Animation")
local Debounce = false
local DebounceTimer = 6
m1.AnimationId = "rbxassetid://5945839988"
local m2 = Instance.new("Animation")
m2.AnimationId = "rbxassetid://5946655147"
local tool = script.Parent.Parent.DemonFlip
local mouse = Player:GetMouse()
mouse.Button1Down:Connect(function()
	if character:FindFirstChild("DemonFlip") and Cooldown.Value == false then
		Cooldown.Value = true
		local sound = Instance.new("Sound", game.Players.LocalPlayer)
		sound.SoundId = "rbxassetid://5355789788"
		sound:Play()
		local track = Humanoid:LoadAnimation(m1)
		track:Play()
		Humanoid.WalkSpeed = 0
		Velocity.Velocity = Vector3.new(1000,1000,-1000)
		track.Stopped:wait()
		Velocity.Velocity = Vector3.new(0,0,0)
		Humanoid.WalkSpeed = 7
		sound:Destroy()
	end
end)
	

	
mouse.Button2Down:Connect(function()
		if character:FindFirstChild("DemonFlip") and Cooldown.Value == false then
		Cooldown.Value = true
		local sound = Instance.new("Sound", game.Players.LocalPlayer)
		sound.SoundId = "rbxassetid://5355789788"
		local runtrack = Humanoid:LoadAnimation(m2)
		sound:Play()
		runtrack:Play()
		Humanoid.WalkSpeed = 0
		Velocity.Velocity = Vector3.new(1000,1000,-1000)
		runtrack.Stopped:wait()
		Velocity.Velocity = Vector3.new(0,0,0)
		Humanoid.WalkSpeed = 7
		sound:Destroy()
		end
end)
Cooldown.Changed:Connect(function()
	if Cooldown.Value == true then
		wait(5)
		Cooldown.Value = false
	end
end)

Sorry if I didn’t give enough information, I want them to go infront of the way they are facing. But it isn’t happening

I have edited the script to make it compatible with animator:LoadAnimation(), but I still have not found a solution to make me go to the direction i’m facing…

wait(2)
local Player = game.Players.LocalPlayer
local RunService = game:GetService("RunService")
local character =Player.Character or Player.CharacterAdded:wait()
local Velocity = Instance.new("BodyVelocity", character.HumanoidRootPart)
local Cooldown = Instance.new("BoolValue", game.Players.LocalPlayer)
Cooldown.Value = false
local Humanoid = character:WaitForChild("Humanoid")
local animator = Humanoid:FindFirstChildOfClass("Animator")
local Mouse = Player:GetMouse()
local m1 = Instance.new("Animation")
local Debounce = false
local DebounceTimer = 6
m1.AnimationId = "rbxassetid://5945839988"
local m2 = Instance.new("Animation")
	m2.AnimationId = "rbxassetid://5946655147"
	local animationTrack = animator:LoadAnimation(m2)
	local lolanimation = animator:LoadAnimation(m1)


local tool = script.Parent.Parent.DemonFlip
local mouse = Player:GetMouse()
mouse.Button1Down:Connect(function()
	if character:FindFirstChild("DemonFlip") and Cooldown.Value == false then
		Cooldown.Value = true
		local sound = Instance.new("Sound", game.Players.LocalPlayer)
		sound.SoundId = "rbxassetid://5355789788"
		sound:Play()
				lolanimation:Play()
				Humanoid.WalkSpeed = 0
		Velocity.Velocity = Vector3.new(1000,1000,-1000)
		lolanimation.Stopped:wait()
		Velocity.Velocity = Vector3.new(0,0,0)
		Humanoid.WalkSpeed = 7
		sound:Destroy()
	end
end)
	

	
mouse.Button2Down:Connect(function()
		if character:FindFirstChild("DemonFlip") and Cooldown.Value == false then
		Cooldown.Value = true
		local sound = Instance.new("Sound", game.Players.LocalPlayer)
		sound.SoundId = "rbxassetid://5355789788"
		local runtrack = Humanoid:LoadAnimation(m2)
		sound:Play()
		animationTrack:Play()
animationTrack:AdjustSpeed(1.5)
		Humanoid.WalkSpeed = 0
		Velocity.Velocity = Vector3.new(1000,1000,-1000)
		animationTrack.Stopped:wait()
		animationTrack:AdjustSpeed(1)
		Velocity.Velocity = Vector3.new(0,0,0)
		Humanoid.WalkSpeed = 7
		sound:Destroy()
		end
end)
Cooldown.Changed:Connect(function()
	if Cooldown.Value == true then
		wait(5)
		Cooldown.Value = false
	end
		end)

For me, velocity doesn’t really go any higher and doesn’t go to the direction I need it to

Actually, why are you talking to yourself?

By the way, 1000 is too much of a velocity, you should use Velocity.Velocity = character.HumanoidRootPart.CFrame.lookVector * speed.

The speed is the end is the amount of int64 you could add (numbers with decimals or just a float), you can ask me if you still have questions.

Edit: Instead of creating the velocity when the character spawns, you should make an instance of it when the player left clicks, then make it disappear using debris or just wait() like you used in the code, make sure to add the other properties to the body velocity like “P, MaxForce”.

Whenever I spawn in, I just go in the middle of the map floating

local Player = game.Players.LocalPlayer
local RunService = game:GetService("RunService")
local character =Player.Character or Player.CharacterAdded:wait()
local Cooldown = Instance.new("BoolValue", game.Players.LocalPlayer)
Cooldown.Value = false
local Humanoid = character:WaitForChild("Humanoid")
local bodyPosition = Instance.new("BodyPosition", character.HumanoidRootPart)
local bodyForce = Instance.new("BodyForce", character.HumanoidRootPart)
local animator = Humanoid:FindFirstChildOfClass("Animator")
local Mouse = Player:GetMouse()
local m1 = Instance.new("Animation")
local Debounce = false
local DebounceTimer = 6
m1.AnimationId = "rbxassetid://5945839988"
local m2 = Instance.new("Animation")
m2.AnimationId = "rbxassetid://5949219966"
	local animationTrack = animator:LoadAnimation(m2)
	local lolanimation = animator:LoadAnimation(m1)


local tool = script.Parent.Parent.DemonFlip
local mouse = Player:GetMouse()
mouse.Button1Down:Connect(function()
	if character:FindFirstChild("DemonFlip") and Cooldown.Value == false then
		Cooldown.Value = true
		local Velocity = Instance.new("BodyVelocity", character.HumanoidRootPart)
		local sound = Instance.new("Sound", game.Players.LocalPlayer)
		sound.SoundId = "rbxassetid://5355789788"
		sound:Play()
		lolanimation:Play()
		Humanoid.WalkSpeed = 0
		Velocity.Velocity = character.HumanoidRootPart.CFrame.lookVector * 3
		Velocity.P = Vector3.new(-50,0,0)
		Velocity.MaxForce = Vector3.new(-50,0,0)
		lolanimation.Stopped:wait()
		Velocity:Destroy()
		Humanoid.WalkSpeed = 16
		sound:Destroy()
	end
end)
	

	
mouse.Button2Down:Connect(function()
		if character:FindFirstChild("DemonFlip") and Cooldown.Value == false then
		Cooldown.Value = true
		local Velocity2 = Instance.new("BodyVelocity", character.HumanoidRootPart)
		local sound = Instance.new("Sound", game.Players.LocalPlayer)
		sound.SoundId = "rbxassetid://5355789788"
		local runtrack = Humanoid:LoadAnimation(m2)
		sound:Play()
		animationTrack:AdjustSpeed(1.5)
		animationTrack:Play()
		animationTrack:AdjustSpeed(1.5)
		Humanoid.WalkSpeed = 0
		Velocity2.Velocity = character.HumanoidRootPart.CFrame.lookVector * 3
		Velocity2.P = Vector3.new(-50,0,0)
		Velocity2.MaxForce = Vector3.new(-50,0,0)
		animationTrack.Stopped:wait()
		animationTrack:AdjustSpeed(1)
		Humanoid.WalkSpeed = 16
		sound:Destroy()
		Velocity2:Destroy()
		end
end)
Cooldown.Changed:Connect(function()
	if Cooldown.Value == true then
		wait(5)
		Cooldown.Value = false
	end
		end)

image

Set the P to 12500, set the max force to Vector3.new(math.huge, math.huge, math.huge), this should work.

Edit: By the way, i’ll tell you what P does and what max force does, P is the power of the velocity meaning it’s more powered ( not faster ), for the max force, it limits the force based on the numbers you gave it through so if you put 0, 50, 0 instead, the player can still move in the X Z axis but not in the Y axis where they try to jump.

Edit 2: Actually, since you didn’t make the body velocity remain in the humanoid root part for more than 3 seconds, it doesn’t do anything.

1 Like

So should I make the velocity back to load when the character loads in? Also image
Still floating

local Player = game.Players.LocalPlayer
local RunService = game:GetService("RunService")
local character =Player.Character or Player.CharacterAdded:wait()
local Cooldown = Instance.new("BoolValue", game.Players.LocalPlayer)
Cooldown.Value = false
local Humanoid = character:WaitForChild("Humanoid")
local bodyPosition = Instance.new("BodyPosition", character.HumanoidRootPart)
local bodyForce = Instance.new("BodyForce", character.HumanoidRootPart)
local animator = Humanoid:FindFirstChildOfClass("Animator")
local Mouse = Player:GetMouse()
local m1 = Instance.new("Animation")
local Debounce = false
local DebounceTimer = 6
m1.AnimationId = "rbxassetid://5945839988"
local m2 = Instance.new("Animation")
m2.AnimationId = "rbxassetid://5949219966"
	local animationTrack = animator:LoadAnimation(m2)
	local lolanimation = animator:LoadAnimation(m1)


local tool = script.Parent.Parent.DemonFlip
local mouse = Player:GetMouse()
mouse.Button1Down:Connect(function()
	if character:FindFirstChild("DemonFlip") and Cooldown.Value == false then
		Cooldown.Value = true
		local Velocity = Instance.new("BodyVelocity", character.HumanoidRootPart)
		local sound = Instance.new("Sound", game.Players.LocalPlayer)
		sound.SoundId = "rbxassetid://5355789788"
		sound:Play()
		lolanimation:Play()
		Humanoid.WalkSpeed = 0
		Velocity.Velocity = character.HumanoidRootPart.CFrame.lookVector * 3
		Velocity.P = 12500
		Velocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
		lolanimation.Stopped:wait()
		Velocity:Destroy()
		Humanoid.WalkSpeed = 16
		sound:Destroy()
	end
end)
	

	
mouse.Button2Down:Connect(function()
		if character:FindFirstChild("DemonFlip") and Cooldown.Value == false then
		Cooldown.Value = true
		local Velocity2 = Instance.new("BodyVelocity", character.HumanoidRootPart)
		local sound = Instance.new("Sound", game.Players.LocalPlayer)
		sound.SoundId = "rbxassetid://5355789788"
		local runtrack = Humanoid:LoadAnimation(m2)
		sound:Play()
		animationTrack:AdjustSpeed(1.5)
		animationTrack:Play()
		animationTrack:AdjustSpeed(1.5)
		Humanoid.WalkSpeed = 0
		Velocity2.Velocity = character.HumanoidRootPart.CFrame.lookVector * 3
		Velocity2.P = 12500
		Velocity2.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
		animationTrack.Stopped:wait()
		animationTrack:AdjustSpeed(1)
		Humanoid.WalkSpeed = 16
		sound:Destroy()
		Velocity2:Destroy()
		end
end)
Cooldown.Changed:Connect(function()
	if Cooldown.Value == true then
		wait(5)
		Cooldown.Value = false
	end
		end)

Nevermind I don’t float anymore
also, I don’t think I can turn around with it and making it change direction and the m1 doesn’t use Velocity

EDIT 2: This is how I want it to look like Oni/Akuma Showcase | Rogue Lineage - YouTube

Okay, just realized… don’t put any max force, make these just 0, here’s an example:

Velocity2.MaxForce = Vector3.new(0, 0, 0)

I don’t see what the problem is here to be honest. @reygenne1 explained how to move your character already, so the only thing left to do is to deal damage to enemies, and he told you how to do it too.

The problem is that he can’t turn to the right or left when demon flipping, i also explained to him how to create the hitbox and the damage.

It doesn’t let me move anymore after setting it to 0

local Player = game.Players.LocalPlayer
local RunService = game:GetService("RunService")
local character =Player.Character or Player.CharacterAdded:wait()
local Cooldown = Instance.new("BoolValue", game.Players.LocalPlayer)
Cooldown.Value = false
local Humanoid = character:WaitForChild("Humanoid")
local Velocity = Instance.new("BodyVelocity", character.HumanoidRootPart)
local animator = Humanoid:FindFirstChildOfClass("Animator")
local Mouse = Player:GetMouse()
local m1 = Instance.new("Animation")
local Debounce = false
local DebounceTimer = 6
m1.AnimationId = "rbxassetid://5945839988"
local m2 = Instance.new("Animation")
m2.AnimationId = "rbxassetid://5949219966"
	local animationTrack = animator:LoadAnimation(m2)
	local lolanimation = animator:LoadAnimation(m1)


local tool = script.Parent.Parent.DemonFlip
local mouse = Player:GetMouse()
mouse.Button1Down:Connect(function()
	if character:FindFirstChild("DemonFlip") and Cooldown.Value == false then
		Cooldown.Value = true
		local sound = Instance.new("Sound", game.Players.LocalPlayer)
		sound.SoundId = "rbxassetid://5355789788"
		sound:Play()
		lolanimation:Play()
		Humanoid.WalkSpeed = 0
		Velocity.Velocity = character.HumanoidRootPart.CFrame.lookVector * 70
		Velocity.MaxForce = Vector3.new(0, 0, 0)
		lolanimation.Stopped:wait()
		Velocity.Velocity = Vector3.new(0,0,0)
		Velocity.MaxForce = Vector3.new(0,0,0)
		Velocity.P = 0
		Humanoid.WalkSpeed = 16
		sound:Destroy()
	end
end)
	

	
mouse.Button2Down:Connect(function()
		if character:FindFirstChild("DemonFlip") and Cooldown.Value == false then
		Cooldown.Value = true
		local sound = Instance.new("Sound", game.Players.LocalPlayer)
		sound.SoundId = "rbxassetid://5355789788"
		local runtrack = Humanoid:LoadAnimation(m2)
		sound:Play()
		animationTrack:AdjustSpeed(1.5)
		animationTrack:Play()
		animationTrack:AdjustSpeed(1.5)
		Humanoid.WalkSpeed = 0
		Velocity.Velocity = character.HumanoidRootPart.CFrame.lookVector * 10
		Velocity.P = 12500
		Velocity.MaxForce = Vector3.new(0, 0, 0)
		animationTrack.Stopped:wait()
		Velocity.Velocity = Vector3.new(0,0,0)
		Velocity.MaxForce = Vector3.new(0,0,0)
		Velocity.P = 0
		animationTrack:AdjustSpeed(1)
		Humanoid.WalkSpeed = 16
		sound:Destroy()
		end
end)
Cooldown.Changed:Connect(function()
	if Cooldown.Value == true then
		wait(5)
		Cooldown.Value = false
	end
		end)

Why do you create the velocity at the beginning? You should create it when the player is attacking, if you keep it on the player and set everything to 0, the BodyVelocity will, of course, not let the player move as it is forcing the player to stay in its position cause of its force.

Same problem

local Player = game.Players.LocalPlayer
local RunService = game:GetService("RunService")
local character =Player.Character or Player.CharacterAdded:wait()
local Cooldown = Instance.new("BoolValue", game.Players.LocalPlayer)
Cooldown.Value = false
local Humanoid = character:WaitForChild("Humanoid")
local animator = Humanoid:FindFirstChildOfClass("Animator")
local Mouse = Player:GetMouse()
local m1 = Instance.new("Animation")
local Debounce = false
local DebounceTimer = 6
m1.AnimationId = "rbxassetid://5945839988"
local m2 = Instance.new("Animation")
m2.AnimationId = "rbxassetid://5949219966"
	local animationTrack = animator:LoadAnimation(m2)
	local lolanimation = animator:LoadAnimation(m1)


local tool = script.Parent.Parent.DemonFlip
local mouse = Player:GetMouse()
mouse.Button1Down:Connect(function()
	if character:FindFirstChild("DemonFlip") and Cooldown.Value == false then
		Cooldown.Value = true
		local sound = Instance.new("Sound", game.Players.LocalPlayer)
		sound.SoundId = "rbxassetid://5355789788"
		local BodyVelo = Instance.new("BodyVelocity", character.HumanoidRootPart)
		sound:Play()
		lolanimation:Play()
		Humanoid.WalkSpeed = 0
		BodyVelo.Velocity = character.HumanoidRootPart.CFrame.lookVector * 10
		BodyVelo.P = 12500
		BodyVelo.MaxForce = Vector3.new(0, 0, 0)
		lolanimation.Stopped:wait()
		BodyVelo:Destroy()
		Humanoid.WalkSpeed = 16
		sound:Destroy()
	end
end)
	

	
mouse.Button2Down:Connect(function()
		if character:FindFirstChild("DemonFlip") and Cooldown.Value == false then
		Cooldown.Value = true
		local sound = Instance.new("Sound", game.Players.LocalPlayer)
		sound.SoundId = "rbxassetid://5355789788"
		local runtrack = Humanoid:LoadAnimation(m2)
		local Body = Instance.new("BodyVelocity", character.HumanoidRootPart)
		sound:Play()
		animationTrack:AdjustSpeed(1.5)
		animationTrack:Play()
		animationTrack:AdjustSpeed(1.5)
		Humanoid.WalkSpeed = 0
		Body.Velocity = character.HumanoidRootPart.CFrame.lookVector * 10
		Body.P = 12500
		Body.MaxForce = Vector3.new(0, 0, 0)
		animationTrack.Stopped:wait()
		Body:Destroy()
		animationTrack:AdjustSpeed(1)
		Humanoid.WalkSpeed = 16
		sound:Destroy()
		end
end)
Cooldown.Changed:Connect(function()
	if Cooldown.Value == true then
		wait(5)
		Cooldown.Value = false
	end
		end)