void OnStart()
{
AddUseItemCallback("", "nyckel", "mansion_1", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", true, false);
PlaySoundAtEntity("","unlock_door.snt", "mansion_1" ,0 ,false);
RemoveItem("nyckel");
GiveSanityBoostSmall();
}
void OnEnter(){
{
}
void OnLeave()
{
}
void OnGameStart(){ }
{
}
Whats wrong with the code , i could need some help i have tried this now for over 3 hours
(04-17-2013, 08:58 PM)MacKetchup Wrote: [ -> ]void OnStart()
{
AddUseItemCallback("", "nyckel", "mansion_1", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", true, false);
PlaySoundAtEntity("","unlock_door.snt", "mansion_1" ,0 ,false);
RemoveItem("nyckel");
GiveSanityBoostSmall();
}
void OnEnter(){
{
}
void OnLeave()
{
}
void OnGameStart(){ }
{
}
Whats wrong with the code , i could need some help i have tried this now for over 3 hours
VERY basic scripting error
void OnEnter()
{
{
}
void OnLeave()
{
}
void OnGameStart()
{ }
{
}
The highlighted text does not belong here. delete it from script. Your new script should look like this.
void OnStart()
{
AddUseItemCallback("", "nyckel", "mansion_1", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", true, false);
PlaySoundAtEntity("","unlock_door.snt", "mansion_1" ,0 ,false);
RemoveItem("nyckel");
GiveSanityBoostSmall();
}
void OnEnter()
{
}
void OnLeave()
{
}
void OnGameStart()
{
}
void OnEnter() doesn't need that extra { after it, and void OnGameStart() is unnecessary, you can remove that whole section.
Ninja'd!
The Problem still exists , i have copied the code from the Nice Celt, but the problem still remains and it keep saying i cant use the key on the door which makes me wanna smash something.
Reguards MacKetchup
(04-18-2013, 04:05 PM)MacKetchup Wrote: [ -> ]The Problem still exists , i have copied the code from the Nice Celt, but the problem still remains and it keep saying i cant use the key on the door which makes me wanna smash something.
Reguards MacKetchup
I Was stupid enough to change the hps to a diffrent name then the actual map , that was the problem, but thanks for the help
Reguards MacKetchup
(04-18-2013, 04:05 PM)MacKetchup Wrote: [ -> ]The Problem still exists , i have copied the code from the Nice Celt, but the problem still remains and it keep saying i cant use the key on the door which makes me wanna smash something.
Reguards MacKetchup
(04-18-2013, 04:05 PM)MacKetchup Wrote: [ -> ]The Problem still exists , i have copied the code from the Nice Celt, but the problem still remains and it keep saying i cant use the key on the door which makes me wanna smash something.
Reguards MacKetchup
I Was stupid enough to change the hps to a diffrent name then the actual map , that was the problem, but thanks for the help
Reguards MacKetchup
Haha, its okay i'm sure i've done something along those lines before as well
Regards*