Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Context action service one function housing every action? or one function per action?

Asked by 5 years ago

Lets say you were to bind 'e', 'f', 'v'

would it be better to have one function, and in that function it checks was 'e', 'f', or 'v' key pressed and if so do a different action

or would it be better to have a unique function for the 'e' key and bind that one the 'f' key and bind that one the 'v' key and bind that one

1 answer

Log in to vote
0
Answered by 5 years ago

It'd be better to split them since they already require a different function, otherwise you have to make a large if elseif statement to check for all possible keys.

0
Thank you for clarifying! That was what i was assuming, but i just wasn't sure :) JoshChubi 74 — 5y
Ad

Answer this question