I want to make Demon Flip like in Rogue Lineage, and I have the animations for it.
The animation is not loading on activating the tool, and I don’t know how to make a different one play on m2…
I tried this code, and nothing happens
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:wait()
local Humanoid = character:WaitForChild("Humanoid")
local m1 = Instance.new("Animation")
m1.AnimationId = "rbxassetid://5945839988"
local track = Humanoid:LoadAnimation(m1)
local tool = script.Parent.Parent.DemonFlip
tool.Activated:Connect(function()
track:Play()
end)
local Player = game.Players.LocalPlayer
local character =Player.Character or Player.CharacterAdded:wait()
local Humanoid = character:WaitForChild("Humanoid")
local Mouse = Player:GetMouse()
local m1 = Instance.new("Animation")
local Debounce = false
local DebounceTimer = 10
m1.AnimationId = "rbxassetid://5945839988"
local m2 = Instance.new("Animation")
m2.AnimationId = "rbxassetid://5946655147"
local runtrack = Humanoid:LoadAnimation(m2)
local track = Humanoid:LoadAnimation(m1)
local tool = script.Parent.Parent.DemonFlip
local Mouse = Player:GetMouse()
Mouse.Button1Down:Connect(function()
if script.Parent.Parent.DemonFlip.Equipped and Debounce == false and runtrack.IsPlaying == false then
Debounce = true
track:Play()
end
end)
Mouse.Button2Down:Connect(function()
if Debounce == false and script.Parent.Parent.DemonFlip.Equipped and track.IsPlaying == false and script.Parent.Parent.DemonFlip.Equipped == true then
runtrack:Play()
end
end)
wait(DebounceTimer)
Debounce = false
local mouse = player:GetMouse()
mouse.Button1Down:Connect(function()
if character:FindFirstChild("DemonFlip") then
local track = Humanoid:LoadAnimation(m1)
m1:Play()
end
end)
mouse.Button2Down:Connect(function()
--Do same thing in first function but with a different animation
end)
I don’t think tools have a function for Mouse2, so you have to make a function for it like this.