Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How could I make a leaning system?

Asked by 4 years ago

What I'm trying to do is make it to where if I press "E" Or "Q" then my character leans. I already know the UserInputService stuff, I just need to know how I could make my character's head lean.

1 answer

Log in to vote
0
Answered by 4 years ago

You can make it so when you press "E" or "Q" it plays an animation. This is on a local script, and I would put it in StarterPack

01local UIS = game:GetService("UserInputService")
02local debounce = false
03local cooldown = (add how long your cooldown would be ex: 5)
04local Character =  Player.CharacterAdded:Wait()
05local humanoid = Character:WaitForChild("Humanoid")
06local animation = workspace.Animation --put your animation in the workspace, make sure its named Animation
08local animationTrack = humanoid:LoadAnimation(animation)
09 
10 
11UIS.InputBegan:Connect(function(input,isTyping)
12    if isTyping then
13        return
14    elseif input.KeyCode == Enum.KeyCode.Q then
15        if debounce == false then      
View all 22 lines...
0
animation would be your character going into the lean. Make sure its on action, and its looped, so it wont end. BTW this is only to go into the lean. Im not sure how you would get out of it, but Im pretty sure you can just add another elseif statement, making the animation stop mcslimeman 37 — 4y
Ad

Answer this question