Hey, just wondering why my script isn’t working. I’m just trying to learn how to use Content Action Service but the user input doesn’t seem to be triggering the functions. Here is my code
local chessBoard = script.Parent
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character.Humanoid
local CAP = game:GetService(“ContextActionService”)
local Anims = chessBoard.Animations
local function pawnPush()
print(“paawwwwnnnn PUSH”)
Humanoid:LoadAnimation(Anims.Move):Play()
end
local function bishopSnipe()
Humanoid:LoadAnimation(Anims.Move):Play()
print(“biiiisshhhooopppp SNIPE”)
end
local function mate()
Humanoid:LoadAnimation(Anims.Move):Play()
print(“MATE”)
end
chessBoard.Equipped:Connect(function()
CAP:BindAction(“PawnPush”, pawnPush, true, Enum.KeyCode.E)
CAP:BindAction(“Snipe”, bishopSnipe, true, Enum.KeyCode.R)
CAP:BindAction(“Mate”, mate, true, Enum.KeyCode.T)
end)
chessBoard.Unequipped:Connect(function()
CAP:UnbindAction(“PawnPush”)
CAP:UnbindAction(“Snipe”)
CAP:UnbindAction(“Mate”)
end)