RB Battles seem to be using animation for the dive and roll, roll animation plays when player lands
And instead of applying linear velocity to dive forward, apply force
You could either listen for a signal of the humanoids StateChanged event, or get the property changed signal of its FloorMaterial. (Checking for the floor material is better imo, because it fires even if you touch a wall, and you dont have to handle deleting the listener when the rolling is done)
local connection : RBXScriptConnection = humanoid.StateChanged:Connect(function(oldState: HumanoidStateType, newState : HumanoidStateType)
if newState == Enum.HumanoidStateType.Landed then --
-- Initiate rolling animation
connection:Disconnect()
end
end)
OR
humanoid:GetPropertyChangedSignal("FloorMaterial"):Once(function()
-- Initiate rolling animation
end)
I havent tested neither, but im pretty sure both of these work, so use whichever works best for you.