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

How to make the key value not "InputObject"?

Asked by 3 years ago
Edited 3 years ago

I am trying to create a thing for a gun and you are supposed to press r to reload but when an input has been given, it sees it as "InputObject" Here is the local script:

local service = game:GetService("UserInputService")
service.InputBegan:Connect(function(key)
    if key == Enum.KeyCode.R then
        game.Players.LocalPlayer.Character:FindFirstChildOfClass("Tool").Reload:FireServer()
    end
end)
0
Check the source for the full thing the system deleted some of it for some reason!!! CandyWreckEpicness 115 — 3y

Answer this question