dizietemblesssma Posted November 28, 2023 Share Posted November 28, 2023 Inside the event: Event OnKeyUp(Int code,Float HoldTime) I have this: ElseIf code == inventory_key && !Utility.IsInMenuMode() && HoldTime < 1 ;default key is 51, this is the ',' key dz_inventory_hotkey() Return ElseIf code == inventory_key && !Utility.IsInMenuMode() ;secondary use for this key, hold for longer than one second dz_inventory_open_hotkey() Return ................. This works, but if I alter it to this: ElseIf code == inventory_key && !Utility.IsInMenuMode() && HoldTime < 1 ;default key is 51, this is the ',' key dz_inventory_hotkey() Return ElseIf code == inventory_key && !Utility.IsInMenuMode() && HoldTime >= 1 && Holdtime < 5 ;secondary use for this key, hold for longer than one second dz_inventory_open_hotkey() Return ElseIf code == inventory_key && !Utility.IsInMenuMode() && HoldTime >= 5 dz_open_container() Return ........................................ Then no matter how long I hold the key the third elseif doesn't fire but the second does, is the comparison: && Holdtime < 5 is the second elseif not being assessed? Should this work? diziet Link to comment Share on other sites More sharing options...
IsharaMeradin Posted November 28, 2023 Share Posted November 28, 2023 In theory what you have looks like it should work, but try reversing the order that they are in. See if that helps in any way. ElseIf HoldTime > 5 ; do stuff ElseIf HoldTime > 1 ; do stuff Else ; do stuff Link to comment Share on other sites More sharing options...
dizietemblesssma Posted November 28, 2023 Author Share Posted November 28, 2023 Works now, clearly I was doing something embarrassingly stupid that my brain won't let me recall:) Maybe I should sleep! diziet Link to comment Share on other sites More sharing options...
Recommended Posts