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
Script Help Repeating Functions SOLVED
hunchbackproduction Offline
Junior Member

Posts: 36
Threads: 13
Joined: Jul 2013
Reputation: 0
#1
Repeating Functions SOLVED

Alright, I have code right now that unlocks the "castle_1" when I use a "key_study_1" on the area "DoorLock_1" (which is on the door handle, to simulate the key going into the lock, not just clicking on the door xD). Is there a way I can modify the code so that I can use this same function anytime I want to open a door on the level in a similar fashion ? As right now it will only unlock "castle_1" ofc.

void UnlockingDoor(string &in key_study_1, string &in DoorLock_1)
{
SetPlayerRunSpeedMul(0);
SetPlayerMoveSpeedMul(0.2);
SetPlayerLookSpeedMul(0.3);
AddTimer("", 2.0f, "Unlocked");
SetSwingDoorLocked("castle_1", false, true);
}

void Unlocked(string &in asTimer)
{
PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false);
SetPlayerRunSpeedMul(1);
SetPlayerMoveSpeedMul(1);
SetPlayerLookSpeedMul(1);
}

void OnEnter()
{
AddUseItemCallback("", "key_study_1", "DoorLock_1", "UnlockingDoor", true);
}

I imagine it is possible if I was using the key directly on the door itself, but I want to know is it possible the way I have it setup! Thanks

Scripting level is over 9000!
(This post was last modified: 04-15-2014, 10:45 AM by hunchbackproduction.)
04-14-2014, 03:02 PM
Website Find


Messages In This Thread
Repeating Functions SOLVED - by hunchbackproduction - 04-14-2014, 03:02 PM
RE: Repeating Functions - by Neelke - 04-14-2014, 03:30 PM
RE: Repeating Functions - by Mudbill - 04-14-2014, 05:14 PM
RE: Repeating Functions - by hunchbackproduction - 04-15-2014, 10:35 AM



Users browsing this thread: 1 Guest(s)