I managed to make something that displays a gui for three seconds when the player clicks the "P" button on the keyboard.
function onKeyPress(viewMoney, userInputState, inputObject)
if userInputState == Enum.UserInputState.Begin then
local money = script.Parent.Data.MoneyVal.Value
script.Parent.Money.Text = "$"..money
script.Parent.Visible = true
wait(3)
script.Parent.Visible = false
end
end
game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode.P)
I am wondering how I could make it so that the gui will stay displayed the entire time the P button is being held down plus three additional seconds when they let go. Thanks.
