My Tv with chest script that open and close (Single Chest) not work

Author Topic: My Tv with chest script that open and close (Single Chest) not work  (Read 1473 times)

My friend request me to make a Tv with screen that on (white) , off (black) (not color on screen but only Tv body)
I Just made a tv
Also here a code
Code: [Select]
registerOutputEvent("fxDTSBrick","setChestState","bool 0",0);
//shows a checkbox

function fxDTSBrick::setChestState(%this,%bool)
{
%data=%this.getDataBlock();
    
%name=%data.getName();
    
if(%name!$="brickTvOpenData" && %name!$="brickTvData")
return;
    
if(%bool && %data!$="brickTvOpenData")
      
%this.setDataBlock("brickTvOpenData");
    
else

if(!%bool && %data!$="brickTvData")

%this.setDataBlock("brickTvData");
}

//Datablocks

datablock fxDTSBrickData(brickTvData)
{
brickFile = "./Tv.blb";
category = "Special";
subCategory = "MKDD Brick";
uiName = "Tv";
iconName = "";
};

datablock fxDTSBrickData(brickTvOpenData)
{
brickFile = "./TvOpen.blb";
category = "";
subCategory = "";
uiName = "Tv Open";
iconName = "";
};

//Events

package Tv
{

function brickTvData::OnPlant(%blah,%brick)
{
Parent::OnPlant(%blah,%brick);

%enabled     = 1;
%delay       = 0;
%inputEvent  = "OnActivate";
%target      = "Self";
%outputEvent = "ToggleEventEnabled";
%var1        = "1 2";
%brick.addEvent(%enabled, %delay, %inputEvent, %target, %outputEvent, %var1);

%enabled     = 1;
%delay       = 0;
%inputEvent  = "OnActivate";
%target      = "Self";
%outputEvent = "setChestState";
%var1        = "1";
%brick.addEvent(%enabled, %delay, %inputEvent, %target, %outputEvent, %var1);

%enabled     = 0;
%delay       = 0;
%inputEvent  = "OnActivate";
%target      = "Self";
%outputEvent = "setChestState";
%var1        = "0";
%brick.addEvent(%enabled, %delay, %inputEvent, %target, %outputEvent, %var1);
}

};

ActivatePackage(Tv);

How fix it?
« Last Edit: February 26, 2014, 09:11:36 AM by master king deaddude »


Well you'd start by telling us what's wrong.
Well when I start my server and look in special category in my brick subcategory MKDD Brick it not there I already enabled it in add-ons list

So you didn't check for errors while loading it?

Omg I forgot to look in console!
Thank you for let me know it

okay i looked in console it said no error That odd it not work in game
« Last Edit: February 26, 2014, 03:16:02 PM by master king deaddude »


description.txt?

Code: [Select]
Title: Tv
Author: Master King Deaddude
Tv with interactive

okay i looked in console it said no error That odd it not work in game
...what exactly did it say

...what exactly did it say

it said no error

I think he means there was no error.


Could it be a problem with the .blb file?
« Last Edit: February 26, 2014, 05:39:22 PM by boodals 2 »

I think he means there was no error.


Could it be a problem with the .blb file?

It work fine but the brick wont show up in special idk why

Replace the .blb files with some default ones and see if that works.


default?
Like goninto you addons file search "brick_deafault" anf then get somin like 2x2.blb

If the blb has errors it would say 'invalid brick file' or similar