Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Quick Code - take about 5 Minutes

Ok, my game is an Army based one and in it there won't be a Battle System (call me what you will) it will all be done it Real-Time. Adds to the realism I think.

I need a code that does this -
When the button 'space' (or any other big buttons eg. shift, enter, etc. Up to you :D ) is pressed then screen will flash white and play sound '177-Skill21'.
At that point, there will be a 20% chance of success (the success is getting one gold coin. I know, thats lame, but it's explained at bottom of post ;) )

That action can be done at any time the player wishes, as long as player game isn't in menu, during text, whilst waiting, whilst paused... etc etc...
(pausing is from the script Landarma posted: link)

AND most importantly has a Gun weapon: (id's below)
001, 002, 003 and 004

And a magazine (I put this in armors - don't ask me why. There is a reason :S )
ID = 005


And, this is optional but I'll be 10x more greatful if you do this...
Is it possible, after 20 times shooting (20 screen flashs + 20 of the sound effects) one of the armor items 'Magazine' is erased from your equipment? THAT'D be great! Thanks... :D

So I need that done first if I want to progress with my game :)
I know this all sounds weird, eg. when you shoot there will be a 20% chance you get a gold coin :-/ :D but that's because in my game the Gold is called Kills, if you get me. :D

Yes, credit will be given in credits (if wanted)

Any questions, I'd be glad to answer them. I know, I can't explain very well. And yes I used brackets alot, and I tend to
Space


Things


Out













Alot.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top