Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //From my Amnesia Rebirth Tutorial Series
- //Episode 25 Keys! Unlocking Doors!
- //https://www.youtube.com/playlist?list=PL4KkjlmOwLwwMVqedCNpi6caUxhgyf8Qr
- //-----------------------------------------------------------
- ////////////////////////////
- //Single Door
- ////////////////////////////
- bool CanUse_StorageKey(const tString &in asItemType, const tString &in asItemID, const tString &in asPickedEntity){
- return asPickedEntity == "door_1";
- }
- bool OnUse_StorageKey(const tString &in asItemType, const tString &in asItemID, const tString &in asTargetEntity, const tString &in asItemEntity, float afTimeElapsed, float afTimeStep){
- SwingDoor_SetLocked("door_1", false, true);
- Sound_CreateAtEntity("","level_entity_shared/doors/relic_door/relic_door_unlock","door_1",0,true);
- Item_RemoveFromInventory(ItemType_GetFirstInInventory("StorageKey"));
- return false;
- }
- ////////////////////////////
- //Multiple Doors
- ////////////////////////////
- bool CanUse_StorageKey(const tString& in asItemType, const tString& in asItemID, const tString& in asPickedEntity){
- return asPickedEntity == "door_1" || asPickedEntity == "door_2";
- }
- bool OnUse_StorageKey(const tString& in asItemType, const tString& in asItemID, const tString& in asTargetEntity, const tString& in asItemEntity, float afTimeElapsed, float afTimeStep){
- if(asTargetEntity == "door_1"){
- SwingDoor_SetLocked(asTargetEntity, false, true);
- Sound_CreateAtEntity("", "level_entity_shared/doors/relic_door/relic_door_unlock", asTargetEntity, 0, true);
- Item_RemoveFromInventory(ItemType_GetFirstInInventory(asItemType));
- }else if(asTargetEntity == "door_2"){
- SwingDoor_SetLocked(asTargetEntity, false, true);
- Sound_CreateAtEntity("", "level_entity_shared/doors/relic_door/relic_door_unlock", asTargetEntity, 0, true);
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment