1 | local Player = game.Players.LocalPlayer |
2 | Mouse = Player:GetMouse() |
3 |
4 | Mouse.KeyDown:connect( function (Key) |
5 | if (Key:lower() = = "shift" ) + ( "e" ) then |
6 | anim = Player.Character.Humanoid:LoadAnimation(script.animTest) |
7 | anim:Play() |
8 | end |
9 | end ) |
I am making a slide script but it wont let me take "shift" + "e" just one word
Change:
1 | "shift" ) + ( "e" ) |
to:
1 | "shift" ) and ( "e" ) |
Might need to alter formatting there with the brackets, but something like that would be better, and as well for animation use an event and fire the animation on event
You would have to combine this with UserInputService:IsKeyDown()
01 | local UIS = game:GetService( "UserInputService" ) |
02 | local Player = game:GetService( "Players" ).LocalPlayer |
03 | Mouse = Player:GetMouse() |
04 |
05 | local function isShiftDown() |
06 | return UIS:IsKeyDown(Enum.KeyCode.LeftShift) or UIS:IsKeyDown(Enum.KeyCode.RightShift) |
07 | end |
08 |
09 | Mouse.KeyDown:connect( function (Key) |
10 | if Key = = "e" and isShiftDown() then |
11 | anim = Player.Character.Humanoid:LoadAnimation(script.animTest) |
12 | anim:Play() |
13 | end |
14 | end ) |