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 Where is a key usually hidden? [Solved]
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
RE: Where is a key usually hidden?

I can help :3

The way I see it, you can do this one of two ways Smile You can give the item directly from the code, or you can make it drop from the shirt, preferably underneath it.

The first one, which you get directly from the shirt:
Spoiler below!

PHP Code: (Select All)
void OnStart()
{
SetEntityPlayerInteractCallback("<your_shirt_name>""your_function"true);
}

void your_function(string &in asEntity)
{
GiveItem("<the_key_name>""Puzzle""<itemname_in_lang_file>""key_study.tga"1);



That, I BELIEVE would work, but you would have to just test it to make sure you receive a key at all. Change the appropriate stuff that you need to (anything enclosed in a <> but don't delete the "" marks). The thing in the lang file is ItemName_<itemname> and ItemDesc_<itemname>. You can change the graphical image to whatever is in the redist/graphics/item/ folder.

The other method, which is make a key appear from underneath and fall to the ground is this:
Spoiler below!

PHP Code: (Select All)
void OnStart()
{
SetEntityPlayerInteractCallback("<your_shirt_name>""your_function"true);
}

void your_function(string &in asEntity)
{
SetEntityActive("<name_of_key"true);



This one, you have to place the appropriate key underneath the shirt, name it whatever the name of the key is in the Level Editor, and untick "Active" from the Level Editor.

Discord: Romulator#0001
[Image: 3f6f01a904.png]
04-17-2014, 02:03 PM
Find


Messages In This Thread
RE: Where is a key usually hidden? - by Romulator - 04-17-2014, 02:03 PM
RE: Where is a key usually hidden? - by ethics - 04-17-2014, 04:19 PM
RE: Where is a key usually hidden? - by Mudbill - 04-17-2014, 05:17 PM



Users browsing this thread: 2 Guest(s)