I've been learning about ContextActionService and I need to pass to the function (In this case the binded function) some arguements
Here's the code
--LocalScript
local player = game.Players.LocalPlayer
local tool = script.Parent
local cas = game:GetService("ContextActionService")
local actionName = "openDoor"
function openDoor(slot) --This needs the slot variable
slot.Value:WaitForChild("Open"):FireServer()
tool:WaitForChild("Slot"):Destroy()
slot.Value = nil
cas:UnbindAction(actionName)
end
while true do
local slot = tool:FindFirstChild("Slot")
if slot and slot.Value ~= nil then
cas:BindAction(actionName, openDoor(slot), false, "f") --IMPORTANT
end
wait(0.5)
end
also it gives me an error,
Arguement 2 missing or nil: line 21
If you still don't understand, feel free to ask and I'll elaborate.

2 comments
I never searched on how ContextActionService works, buI believe that function openDoor(slot) should return some value, it should be why on line 21 argument 2 is nil.
Nope doesn't work