Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Local sound key detection script?

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()

Mouse.KeyDown:connect(function(Key)
	if(Key:lower() == "m") then
		script.Parent.Command1:Play()

I am attempting you make this so that in the battlefield you don't have to type certain things, such as you can just hit "m" and your guy will shout "I need ammo over here". Only problem I am having if the script wants me to throw a end in at the bottom of the script, Plus i wonder if it can work with a local script which i have it in now..

Thanks

2 answers

First of all, great idea. Second, from the code you posted, you are missing ends. You need to put in an end and end) respectively.

EDIT: For LocalScripts to work, they must be directly in or a descendant of StarterPack or StarterGui.

Still doesn't work :/

2 comments

0

I edited my answer. Please see if it works

0

I believe that the ends are cutting off the audio from being played.

This discussion is preserved as it was. New answers, comments, and votes are closed.