local ContextActionService = game:GetService("ContextActionService")
local Part = game.Workspace.Part
local function onbuttonPress()
Part.BrickColor = BrickColor.new("New Yeller")
end
ContextActionService:BindAction("turnBrickYellow", onbuttonPress, true, "t")
ContextActionService:SetPosition("turBrickYellow", UDim2.new(0.70, -25, 0.7, -25))
Adding onto what @Nogalo said, youβre missing three arguments. They represent name, input state, and input object. The only one you really need is input state, but you still have to put all three arguments in the parenthesis for it to work. For example:
local cas = game:GetService('ContextActionService')
local name = 'name'
local function example(n,i,o) --the arguments!
if i == Enum.UserInputState.Begin then
print('i like turtles')
end
end
cas:BindAction(name,example,false,Enum.KeyCode.F)