How would I key-bind an audio file to a certain letter?
Currently I have:
k = Workspace.Present Plr = script.Parent.Parent.Parent Mouse = Plr:GetMouse() Mouse.KeyDown:connect(function(Key) if Key:lower() == "j" then j:Play() end end)
Is there a way to make this work? If so, please help.
The audio file Workspace.Present has the audio ID and is in the correct place as I put it but it wont play.
You need to use a LocalScript to use the Player:GetMouse
method. Here's an example:
local plr = game.Players.LocalPlayer local mouse = plr:GetMouse() local sound = game.Workspace.Sound -- Change this to the path to your sound mouse.KeyDown:connect(function(key) if key:lower() == "j" then sound:Play() end end)