VeNoMzTeamHysterical
Member
Posts: 240
Threads: 36
Joined: Dec 2012
Reputation:
3
|
Leveldoor 'Locked' Key not working!
So i just made key to open a door. its a level door the key is gone when i use it but it is not opening.
AddUseItemCallback("", "cryptkey", "cryptdoor", "UsedKeyOnDoor", true);
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cryptdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "cryptdoor", 0, false);
RemoveItem("cryptkey");
}
keyname=cryptkey
doorname=cryptdoor
|
|
02-15-2013, 02:53 PM |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
RE: Leveldoor 'Locked' Key not working!
You can't use SetSwingDoorLocked script for level doors.
Use SetLevelDoorLocked(string& asName, bool abLocked);
|
|
02-15-2013, 03:01 PM |
|
VeNoMzTeamHysterical
Member
Posts: 240
Threads: 36
Joined: Dec 2012
Reputation:
3
|
RE: Leveldoor 'Locked' Key not working!
(02-15-2013, 03:01 PM)No Author Wrote: You can't use SetSwingDoorLocked script for level doors.
Use SetLevelDoorLocked(string& asName, bool abLocked);
Thanks alot i didnt know
|
|
02-15-2013, 03:37 PM |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
RE: Leveldoor 'Locked' Key not working!
Your welcome
|
|
02-15-2013, 03:45 PM |
|
VeNoMzTeamHysterical
Member
Posts: 240
Threads: 36
Joined: Dec 2012
Reputation:
3
|
RE: Leveldoor 'Locked' Key not working!
(02-15-2013, 03:45 PM)No Author Wrote: Your welcome
So its gonna be
void UsedKeyOnDoor(string& asName, bool abLocked);
{
SetLevelDoorLocked("cryptdoor", false, true);
SetLevelDoorLockedSound("cryptdoor", "unlock_door");
RemoveItem("cryptkey");
}
if im right?
|
|
02-15-2013, 03:47 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Leveldoor 'Locked' Key not working!
no.
SetLevelDoorLocked("cryptdoor", false);
There is no effect, because it's no swingdoor.
also:
SetLevelDoorLockedSound("cryptdoor", "unlock_door");
I guess what you want is just to play the sound?
Just use:
PlaySoundAtEntity("", "unlock_door", "cryptdoor", 0, false);
Trying is the first step to success.
|
|
02-15-2013, 03:49 PM |
|
VeNoMzTeamHysterical
Member
Posts: 240
Threads: 36
Joined: Dec 2012
Reputation:
3
|
RE: Leveldoor 'Locked' Key not working!
(02-15-2013, 03:49 PM)BeeKayK Wrote: no.
SetLevelDoorLocked("cryptdoor", false);
There is no effect, because it's no swingdoor.
also:
SetLevelDoorLockedSound("cryptdoor", "unlock_door");
I guess what you want is just to play the sound?
Just use:
PlaySoundAtEntity("", "unlock_door", "cryptdoor", 0, false);
You are a beast sir
Why don't you make tutorials you will be a popular amnesia tutorial channel ;p
(02-15-2013, 03:49 PM)BeeKayK Wrote: no.
SetLevelDoorLocked("cryptdoor", false);
There is no effect, because it's no swingdoor.
also:
SetLevelDoorLockedSound("cryptdoor", "unlock_door");
I guess what you want is just to play the sound?
Just use:
PlaySoundAtEntity("", "unlock_door", "cryptdoor", 0, false);
Lol it does not work... i cant use the key on the level door...
It is maybe because you get a key in the map before?
Or does that not matter?
|
|
02-15-2013, 03:51 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Leveldoor 'Locked' Key not working!
Nope. Doesn't matter.
This is how the script should look (Remember you cannot have 2 void OnStart):
void OnStart()
{
AddUseItemCallback("", "cryptkey", "cryptdoor", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
PlaySoundAtEntity("", "unlock_door", "cryptdoor", 0, false);
SetLevelDoorLocked("cryptdoor", false);
RemoveItem(asItem);
}
Remember to check that all names are correct with capitals!
It's important!
If it doesn't work, show us the error, and your full script.
Trying is the first step to success.
|
|
02-15-2013, 04:05 PM |
|
VeNoMzTeamHysterical
Member
Posts: 240
Threads: 36
Joined: Dec 2012
Reputation:
3
|
RE: Leveldoor 'Locked' Key not working!
(02-15-2013, 04:05 PM)BeeKayK Wrote: Nope. Doesn't matter.
This is how the script should look (Remember you cannot have 2 void OnStart):
void OnStart()
{
AddUseItemCallback("", "cryptkey", "cryptdoor", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
PlaySoundAtEntity("", "unlock_door", "cryptdoor", 0, false);
SetLevelDoorLocked("cryptdoor", false);
RemoveItem(asItem);
}
Remember to check that all names are correct with capitals!
It's important!
If it doesn't work, show us the error, and your full script.
OMG it works now you got + rep'd sir
|
|
02-15-2013, 04:10 PM |
|
|