You can write your topic however you want, but you need to answer these questions:
I have animations for Demon Flip, and I am trying to replicate the Rogue Lineage demon flip as much as possible.
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.
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)
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.
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)
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”.
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.
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.
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.