I am trying to make an animation for a mesh whose bodyparts are not connected but when I play the game the animation does not work, I have successfully checked and its not the restriction part of the script
local Punch = "Punch"
local ContextActionService = game:GetService("ContextActionService")
local function onAction(actionName, inputState, inputObject)
if actionName == Punch and inputState == Enum.UserInputState.Begin then
script.Parent.RightPunch.Transparency = 0
script.Parent.RightHand.Transparency = 1
local Punchanim = script.Punch
Punchanim:Play()
wait(1.02)
script.Parent.RightPunch.Transparency = 1
script.Parent.RightHand.Transparency = 0
end
end
if game.Players.LocalPlayer.Character == workspace.BigMorph.Big then
ContextActionService:BindAction(Punch, onAction, true, Enum.KeyCode.E)
end