The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Give Sanity Boost help D:
31tashi Offline
Junior Member

Posts: 7
Threads: 2
Joined: Dec 2012
Reputation: 0
#1
Give Sanity Boost help D:

Sooo... I've been scripting for a while now but i can't seem to figure out one of my problems. I used the sanity boost script on a door you open with a crowbar... And i also have a give sanity boost on when you pull a lever of mine, but the boost Never appears. It seems like the boost only can appear once... can i change that? :c
Script:
void OnStart()
{
AddUseItemCallback("", "crowbar_1", "prison_1", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_3", "CollideAreaBreakDoor", true, 1);
SetEntityConnectionStateChangeCallback("lever", "func_shelf");geCallback("lever", "func_shelf");
}

void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer("", 0.2, "TimerSwitchShovel");
RemoveItem("crowbar_1");
}

void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("prison_1", false, true);
AddPropImpulse("prison_1", 0, 0, -50, "World");
SetSwingDoorDisableAutoClose("prison_1", true);
SetSwingDoorClosed("prison_1", false, false);
SetMoveObjectState("prison_1", 1);
PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
AddBodyForce("prison_1", 0, 0, 900, "world");
SetEntityActive("crowbarlives", true);
}

void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
AddTimer("", 10, "func_shelf2");
GiveSanityBoost();
SetMoveObjectState("shelf",1.0f);
SetMessage("Messages", "Popup2", 0);
SetLeverStuckState("lever", 1, true);
return;
}
}

So I am really not sure how to make it appear a second time... The func_shelf sanity thing worked before i added in the new crowbar door, but now it doesn't.
(This post was last modified: 01-01-2013, 08:27 PM by 31tashi.)
01-01-2013, 08:04 AM
Find


Messages In This Thread
Give Sanity Boost help D: - by 31tashi - 01-01-2013, 08:04 AM
RE: Give Sanity Boost help D: - by 31tashi - 01-01-2013, 08:26 PM



Users browsing this thread: 1 Guest(s)