uis.InputBegan:Connect(function(key, gameProcessed) if key.KeyCode == **Enum.KeyCode.C** then if isCrawling then isCrawling = false if loadedCrawlAnim then loadedCrawlAnim:Stop() end loadedIdleAnim:Stop() game.ReplicatedStorage.OnCrouchBegun:FireServer(humanoid, 16, 50) elseif not isCrawling then isCrawling = true loadedIdleAnim = humanoid:LoadAnimation(crawlIdle) loadedIdleAnim:Play() game.ReplicatedStorage.OnCrouchBegun:FireServer(humanoid, 0.5, 20) end end end)
I need to make the key combination activate the animation, "the script is already complete and functional", and if it is possible since there is a plane that is saved with Shift + G, can someone help me? thanks
I assume that you are trying to activate your animation when a specific combination is pressed. Instead of,
if key.KeyCode == **Enum.KeyCode.C** then
You can try using this:
local uis = game:GetService("UserInputService") if (key.KeyCode == Enum.KeyCode.LeftShift and uis:IsKeyDown(Enum.KeyCode.C)) or (key.KeyCode == Enum.KeyCode.C and uis:IsKeyDown(Enum.KeyCode.LeftShift)) then -- [[ Just don't use IsKeyDown on both sides as it may trigger even when the user isn't inputing the combination and another InputBegan function fires ]]
Lemme know if it helps!