RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"player roll system when players presses Q and plays animation and rolls forward"
-- local script local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local userInputService = game:GetService("UserInputService") local animation = Instance.new("Animation") animation.AnimationId = "rbxassetid://your_animation_id_here" local function onInputBegan(input, gameProcessedEvent) if input.KeyCode == Enum.KeyCode.Q and not gameProcessedEvent then local rollAnimation = humanoid:LoadAnimation(animation) rollAnimation:Play() character.HumanoidRootPart.CFrame = character.HumanoidRootPart.CFrame * CFrame.new(0, 0, -10) end end userInputService.InputBegan:Connect(onInputBegan)