So I want to make this program but when there are two of them running at the same time, none of them works. Also, if you don't mind, can you explain me how this code works?
function onKeyPress(actionName, userInputState, inputObject) if userInputState == Enum.UserInputState.Begin then script.Parent.YAAA:FireServer() end end game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode.R) function onKeyPress(actionName, userInputState, inputObject) if userInputState == Enum.UserInputState.Begin then script.Parent.Fire:FireServer() end end game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode.E)
Try this
game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode.R,Enum.KeyCode.E)
Or this
function onKeyPress(actionName, userInputState, inputObject) if userInputState == Enum.UserInputState.Begin then script.Parent.YAAA:FireServer() end end game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode.R) function onKeyPressT(actionName, userInputState, inputObject) if userInputState == Enum.UserInputState.Begin then script.Parent.Fire:FireServer() end end game.ContextActionService:BindAction("keyPress2", onKeyPressT, false, Enum.KeyCode.E)