// waittill someuses uses this user = undefined; while( 1 ) { self waittill( "trigger", user );
if( user in_revive_trigger() ) { wait( 0.1 ); continue; }
// make sure the user is a player, and that they can afford it if( is_player_valid( user ) && user.score >= cost ) { user maps\_zombiemode_score::minus_to_player_score( cost ); break; } else if ( user.score < cost ) { user thread maps\_zombiemode_perks::play_no_money_perk_dialog(); continue; }
wait 0.05; }
// trigger_use->script_brushmodel lid->script_origin in radiant lid = getent( self.target, "targetname" ); weapon_spawn_org = getent( lid.target, "targetname" );
//open the lid lid thread treasure_chest_lid_open();
// SRS 9/3/2008: added to help other functions know if we timed out on grabbing the item self.timedOut = false;
// mario kart style weapon spawning weapon_spawn_org thread treasure_chest_weapon_spawn( self, user );
// the glowfx weapon_spawn_org thread treasure_chest_glowfx();
// take away usability until model is done randomizing self disable_trigger();
if (flag("moving_chest_now")) { user thread treasure_chest_move_vo(); self treasure_chest_move(lid);
} else { // Let the player grab the weapon and re-enable the box // self.grab_weapon_hint = true; self.chest_user = user; self sethintstring( &"ZOMBIE_TRADE_WEAPONS" ); self setCursorHint( "HINT_NOICON" ); self setvisibletoplayer( user ); self thread GiveMeASecond();
// Limit its visibility to the player who bought the box self enable_trigger(); self thread treasure_chest_timeout();
// make sure the guy that spent the money gets the item // SRS 9/3/2008: ...or item goes back into the box if we time out while( 1 ) { self waittill( "trigger", grabber );
NICE! Been waiting for this tutorial forever. One question, does this make it so the players can automatically take other players weapons or does it wait about 5-6 seconds before giving other players the option. If its the first way then can you show me how to make it so the player who spins the box can take it before it will let other players take it. That way no one can steal other peoples box weapons.
NICE! Been waiting for this tutorial forever. One question, does this make it so the players can automatically take other players weapons or does it wait about 5-6 seconds before giving other players the option. If its the first way then can you show me how to make it so the player who spins the box can take it before it will let other players take it. That way no one can steal other peoples box weapons.
You could change:
Code Snippet
Plaintext
//self setvisibletoplayer( user ); self SetVisibleToAll();
to
Code Snippet
Plaintext
self setvisibletoplayer( user ); self thread GiveMeASecond();
and add this after the treasure_chest_think() function
Code Snippet
Plaintext
GiveMeASecond(){ wait(3); //gives the buyer 3 seconds to chose to take it self SetVisibleToAll(); }
Edit: I updated the tut to include this. Good idea.
Last Edit: June 21, 2014, 03:19:13 am by MakeCents