Scripts / Trying to add plr_money to a charactor when killed

Author
Message
Sacalac
9
Years of Service
User Offline
Joined: 3rd Sep 2014
Location: Detroit, MI
Posted: 15th Apr 2015 20:27

I am trying to add script to zombies when killed that will give the player money. this to be used with Acid's Pay for open the doors script. Any help please?
Sacalac
Flatlander
GameGuru Master
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 16th Apr 2015 12:57 Edited at: 16th Apr 2015 12:58
   
When in doubt -- C4 :heh, heh, heh:

-Jamie Hyneman
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 16th Apr 2015 13:27
it's very easy
just add
Quote: "plr_money = plr_money + 1"

(or change 1 to however much to be gained per kill)
inside the exit(e) part of the script used by the zombies like so


i assume the prompts and global value is already set in the scripts you already have so that should be all you need
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
A c i d
9
Years of Service
User Offline
Joined: 16th Apr 2015
Location: Russia
Posted: 16th Apr 2015 14:44 Edited at: 17th Apr 2015 08:26
Sacalac, thanks for using my script!

Smallg, yes it is


P.S. New money interaction scripts will be added soon.
Sacalac
9
Years of Service
User Offline
Joined: 3rd Sep 2014
Location: Detroit, MI
Posted: 17th Apr 2015 17:09
Thank you both very much! Great script.
Sacalac
Sacalac
9
Years of Service
User Offline
Joined: 3rd Sep 2014
Location: Detroit, MI
Posted: 17th Apr 2015 22:10 Edited at: 17th Apr 2015 22:18
I tried this and it works great for character enemies.(zombies) I tried it with Lafayette's flying bird from the store. it gives the reward as soon as level starts rather than when you kill it. dont want to post the script as it is a store script.(Flying bird script) trying to make a hunting level where you shoot the flying birds for money to open a door.(acid script) Any help would be great. My guess is because the flying bird has no exit script.


PS Lafayette's flying bird script is great for Duck Hunt style shooting.
Sacalac
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 18th Apr 2015 09:46
So you put the code inside the main(e) instead? You must create the exit(e) if it isn't there
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Sacalac
9
Years of Service
User Offline
Joined: 3rd Sep 2014
Location: Detroit, MI
Posted: 18th Apr 2015 14:18
I added the exit at the end but the engine acts as if the bird dies as the level starts giving the player the loot for all birds added to level.
Sacalac

Login to post a reply

Server time is: 2024-05-23 22:25:08
Your offset time is: 2024-05-23 22:25:08