Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Q to drop tools works only on specific tools?

Asked by 4 years ago

Alright I made a script that enables you to press Q to drop tools, the only problem is that it only works on certain tools, and there is no output when it fails to drop it. Since there is no output and i'm using a LocalScript with ContextActionService I think the problem is on the client side. Here is the script:

local tool = script.Parent
local actionService = game:GetService("ContextActionService")
local dropEvent = game.ReplicatedStorage.DropEvent

local function DropTool(actionName, inputState, inputObject)
    if actionName == "Drop" and inputState == Enum.UserInputState.Begin then
       dropEvent:FireServer()
    end
end

actionService:BindAction("Drop", DropTool, false, Enum.KeyCode.Q)

As I said before there is no output, and I don't know why it happens only on certain tools.

Answer this question