New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
1

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

Asked by 11 days 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 10 days 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 24 — 10d
Ad

Answer this question