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
I need help with script!
Scupp Offline
Junior Member

Posts: 14
Threads: 5
Joined: Jul 2012
Reputation: 0
#1
I need help with script!

How can I make script that does something when I have certain items on inventory and certain entities on the floor. In my case I have hammer and saw in my inventory and there's three planks on the floor. My goal is that I can make the items and planks disappear when I click broken ladders on the floor. I made script to that how I bring planks there:


void OnStart()
{
AddEntityCollideCallback("lauta", "lauta_area", "lauta", true, 1);
AddEntityCollideCallback("lauta2", "lauta_area", "lauta2", true, 1);
AddEntityCollideCallback("lauta3", "lauta_area", "lauta3", true, 1);
}
void lauta(string &in asParent, string &in asChild, int alState)
{
if(alState == 1)
{
PlayMusic("impact_wood_low2.ogg", false, 150.00, 0, 0, true);
SetEntityActive("lauta_1", true);
SetEntityActive("lauta", false);
SetEntityActive("lauta_2", true);
SetEntityActive("lauta2", false);
}
}
void lauta2(string &in asParent, string &in asChild, int alState)
{
if(alState == 1)
{
PlayMusic("impact_wood_heavy_low2.ogg", false, 150.00, 0, 0, true);
SetEntityActive("lauta_2", true);
SetEntityActive("lauta2", false);
}
}
void lauta3(string &in asParent, string &in asChild, int alState)
{
if(alState == 1)
{
PlayMusic("impact_wood_heavy_low2.ogg", false, 150.00, 0, 0, true);
SetEntityActive("lauta_3", true);
SetEntityActive("lauta3", false);
}
}

So my problem is now that how can I make any entity clickable so there would be that hand icon and how can I make it do something. I know this might be really hard to imagine without map file but could someone tell me what should I do? I have just learned basics of scripting and this might be kinda early to ask something like this but I could really learn a lot if someone helps me with this. Smile I attach a image here if that helps any...
07-16-2012, 05:51 PM
Find


Messages In This Thread
I need help with script! - by Scupp - 07-16-2012, 05:51 PM
RE: I need help with script! - by Traggey - 07-16-2012, 06:00 PM
RE: I need help with script! - by Your Computer - 07-16-2012, 08:22 PM
RE: I need help with script! - by Scupp - 07-16-2012, 08:45 PM



Users browsing this thread: 1 Guest(s)