Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
2 keys script
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#9
RE: 2 keys script

(12-07-2011, 03:23 PM)Dobbydoo Wrote:
(12-06-2011, 05:24 PM)Your Computer Wrote: It'd be more efficient if you had one function deal with all swing doors:

PHP Code: (Select All)
void OnStart()
{
    
AddUseItemCallback("""bedroomkey_1""mansion_1""UsedKeyOnDoor"true);
    
AddUseItemCallback("""bedroomkey_2""mansion_2""UsedKeyOnDoor"true);
}

void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
    
SetSwingDoorLocked(asEntityfalsetrue);
    
PlaySoundAtEntity("""unlock_door"asEntity0false);
    
RemoveItem(asItem);

But wouldn't that just make both doors unlock when using one key? :S
The asEntity makes it so whichever entity it's linked in the void OnStart block will be the one being unlocked.

12-07-2011, 03:25 PM
Find


Messages In This Thread
2 keys script - by Kainzor - 12-06-2011, 03:56 PM
RE: 2 keys script - by flamez3 - 12-06-2011, 04:04 PM
RE: 2 keys script - by Kainzor - 12-06-2011, 04:33 PM
RE: 2 keys script - by flamez3 - 12-06-2011, 04:39 PM
RE: 2 keys script - by Kainzor - 12-06-2011, 05:04 PM
RE: 2 keys script - by Your Computer - 12-06-2011, 05:24 PM
RE: 2 keys script - by flamez3 - 12-06-2011, 05:32 PM
RE: 2 keys script - by Dobbydoo - 12-07-2011, 03:23 PM
RE: 2 keys script - by flamez3 - 12-07-2011, 03:25 PM
RE: 2 keys script - by Dobbydoo - 12-07-2011, 03:32 PM



Users browsing this thread: 1 Guest(s)