Categories > Coding > Lua >

help with ContextActionService

Posts: 5

Threads: 3

Joined: Jul, 2023

Reputation: 0

Posted

So basically, everything works normally until you unequip the item.

Currently, I have made lots of items, then randomly, it broke as they started using all the abilities when you unequip it, also even before that, it would use one ability when you unequip it, how may I fix this?

Honestly, it's probably me being dumb, but here's some of my code I usually use:

local remote = script.Parent:WaitForChild("TestRemote")
local CAS = game:GetService("ContextActionService")

local function testAbility
       remote:FireServer()
end

CAS:BindAction("Test",testAbility,true,Enum.KeyCode.Q)

Also, I will say that the CAS binding and unbinidngs are in tool.Equipped and tool.UnEquipped

  • 0

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )