Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

1 comment

0

Edited for formatting. Please be more descriptive with your titles. Please provide explanation with your code.

2 answers

✓ Accepted answer

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

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.