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:

01local tool = script.Parent
02local actionService = game:GetService("ContextActionService")
03local dropEvent = game.ReplicatedStorage.DropEvent
04 
05local function DropTool(actionName, inputState, inputObject)
06    if actionName == "Drop" and inputState == Enum.UserInputState.Begin then
07       dropEvent:FireServer()
08    end
09end
10 
11actionService: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