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
7 years ago
Edited 7 years ago
local Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()

Mouse.KeyDown:connect(function(Key)
    if(Key:lower() == "shift") + ("e") then
        anim = Player.Character.Humanoid:LoadAnimation(script.animTest)
        anim:Play()
    end
end)

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 — 7y

2 answers

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

Change:

"shift") + ("e")

to:

"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
7 years ago

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

local UIS = game:GetService("UserInputService")
local Player = game:GetService("Players").LocalPlayer
Mouse = Player:GetMouse()

local function isShiftDown()
    return UIS:IsKeyDown(Enum.KeyCode.LeftShift) or UIS:IsKeyDown(Enum.KeyCode.RightShift)
end

Mouse.KeyDown:connect(function(Key)
    if Key == "e" and isShiftDown() then
        anim = Player.Character.Humanoid:LoadAnimation(script.animTest)
        anim:Play()
    end
end)

Answer this question