- Home /
One scipt to cover all guns
I have been looking at the dastardlybanana fps package and cnt get my head around how his variables change in the gun script when he changes the type of gun he uses. can any one tell me how he does it? i know he uses an enum but how does that change variables accoringly??
Could you give us a bit more information? For example, scripts, screenshots, videos. Thanks :)
Answer by Jason_DB · May 09, 2011 at 12:00 AM
The gun script uses a custom editor (which changes what the editor displays), and within that we change which variables display based on the value of the enum. (You can see the editor script under the 'editor' folder, it's called gunscripteditor)
wow you replied yourself lol thanks man :) so if im not to do this then will i need to make individual scripts for each gun?
The problem with using multiple scripts is that you'll have three different scripts to modify (which is only a problem if you want to be consistently changing). You could just leave all the variables visible - the ones for different weapons shouldn't make a difference.
Your answer
Follow this Question
Related Questions
Switch Gun with dastardlybanana fps kit 1 Answer
Prevent a script from compiling ? 2 Answers
FPS Tutorial, 1st step help please! 1 Answer
DastardlyBanana(moving while jumping. 2 Answers
pause for dastardly bannana 1 Answer