-
What do you want to achieve? Keep it simple and clear!
How would I add a debounce to my script? I need to add it somehow so that it doesn’t stack my animation when the key E is pressed multiple times. I am also using decals on a part for the animation. -
What is the issue? Include screenshots / videos if possible!
Normal:
Stacked:
local Guy= game.Workspace.Animation
local StandingRight = Guy.Torso.D1
local SideRight = Guy.Torso.D2
local WalkingRight = Guy.Torso.D3
local WalkingRightV2 = Guy.Torso.D4
local StandingLeft = Guy.Torso.D01
local SideLeft = Guy.Torso.D02
local WalkingLeft = Guy.Torso.D03
local WalkingLeftV2 = Guy.Torso.D04
UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input)
while UIS:IsKeyDown(Enum.KeyCode.E) do
StandingLeft.Transparency = 1
SideLeft.Transparency = 1
WalkingLeft.Transparency = 1
WalkingLeftV2.Transparency = 1
StandingRight.Transparency = 1
SideRight.Transparency = 0
WalkingRight.Transparency = 1
WalkingRightV2.Transparency = 1
task.wait(1)
SideRight.Transparency = 1
WalkingRight.Transparency = 0
WalkingRightV2.Transparency = 1
task.wait(1)
SideRight.Transparency = 0
WalkingRight.Transparency = 1
WalkingRightV2.Transparency = 1
task.wait(1)
SideRight.Transparency = 1
WalkingRight.Transparency = 1
WalkingRightV2.Transparency = 0
task.wait(1)
end
end)