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

Is it an other way to make an slide animation so i can have "shift + e" instead of "e"?

Asked by
DevingDev 346 Moderation Voter
8 years ago
Edited 8 years ago
1local Player = game.Players.LocalPlayer
2Mouse = Player:GetMouse()
3 
4Mouse.KeyDown:connect(function(Key)
5    if(Key:lower() == "shift") + ("e") then
6        anim = Player.Character.Humanoid:LoadAnimation(script.animTest)
7        anim:Play()
8    end
9end)

I am making a slide script but it wont let me take "shift" + "e" just one word

0
Edited for formatting. Please be more descriptive with your titles. Please provide explanation with your code. M39a9am3R 3210 — 8y

2 answers

Log in to vote
0
Answered by
ferano 0
8 years ago

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

Ad
Log in to vote
0
Answered by
einsteinK 145
8 years ago

You would have to combine this with UserInputService:IsKeyDown()

01local UIS = game:GetService("UserInputService")
02local Player = game:GetService("Players").LocalPlayer
03Mouse = Player:GetMouse()
04 
05local function isShiftDown()
06    return UIS:IsKeyDown(Enum.KeyCode.LeftShift) or UIS:IsKeyDown(Enum.KeyCode.RightShift)
07end
08 
09Mouse.KeyDown:connect(function(Key)
10    if Key == "e" and isShiftDown() then
11        anim = Player.Character.Humanoid:LoadAnimation(script.animTest)
12        anim:Play()
13    end
14end)

Answer this question