local UIS = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
Player.CharacterAdded:Wait()
local Character = Player.Character
Character:WaitForChild("Humanoid")
local blockStart = script.Parent.BlockStart
local blockAnim = script.Parent.Block
local track = nil
local track2 = nil
local debounce = false
local running = false
local speed = 1
local function Stop_Anim()
debounce = false
if track then
track:Stop()
end
if track2 then
track2:Stop()
end
track = nil
track2 = nil
Character.Humanoid.WalkSpeed = 16
end
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.F and not debounce and not running then
debounce = true
track = Character.Humanoid:LoadAnimation(blockStart)
track.Priority = Enum.AnimationPriority.Action
track:AdjustSpeed(speed) -- 1 is equal to 100%
track:Play()
wait(.21)
if not debounce then return end
track:Stop()
Character.Humanoid.WalkSpeed = 6
track2 = Character.Humanoid:LoadAnimation(blockAnim)
track2.Priority = Enum.AnimationPriority.Action
track2.Looped = true
track2:AdjustSpeed(speed) -- 1 is equal to 100%
track2:Play()
end
end)
UIS.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.F and debounce then
Stop_Anim()
end
end)
Character.Humanoid.Running:Connect(function(speed)
if speed > 0 then
running = true
Stop_Anim()
else
running = false
end
end)
You can publish it as a model by clicking on the model in workspace, right click, click on “Save to Roblox” enable “Allow Copying”. Then you can send me the link for the model if you want.
Okay I do not know what in the world I did, but all of the animations work now, the blocking is the only thing that needs fixing
Edit: It’s not fixed, I have many tools that are supposed to have the same exact scripts, and for some reason only one tool works, none of the others do, that’s why the Katana was not working.