I wrote some the script aslo rip it off from Bot hole, Brick text and Bot Gear. I put some lines together. I not see any error or bugs, it should be work. I check out the console log didn't say error. I am going post my script lines below.
registerOutputEvent("fxDTSBrick","setBotText","string 30 100");
registerOutputEvent("fxDTSBrick","setBotTextColor","int 0 255" TAB "int 0 255" TAB "int 0 255");
function fxDtsBrick::setBotText(%brick,%name,%bot)
{
if(isObject(%brick.hBot))
%brick.hBot.SetShapeName(%name);
}
function fxDtsBrick::setBotNameColor(%bot,%r,%g,%b)
{
if(isObject(%brick.hBot))
%brick.hBot.SetShapeNameColor(%r/255 SPC %g/255 SPC %b/255);
}
function fxDTSBrick::onBotSpawn(%obj)
{
%client = %obj.getGroup().client;
$InputTarget_["Self"] = %obj;
$InputTarget_["Bot"] = %obj.hBot;
// $InputTarget_["MiniGame"] = getMiniGameFromObject(%obj);
%obj.processInputEvent("onBotSpawn", %client);
}
registerInputEvent("fxDTSBrick", "onBotSpawn", "Self fxDTSBrick" TAB "Bot Bot");// TAB "MiniGame MiniGame"
datablock StaticShapeData(BrickTextEmptyShape)
{
shapefile = "base/data/shapes/empty.dts";
};
function fxDtsBrick::BotHoleText(%this,%name,%color,%distance,%client)
{
%bot = %client.bot;
//%Color = "getColorIDTable";
%color = getColorIDTable(%color); // Better way for Colors
if(isFunction("FilterVariableString"))
{
%name = filterVariableString(%name,%this,%client,%bot);
}
if(isObject(%this.textShape))
{
%this.textShape.setShapeName(%name);
%this.textShape.setShapeNameColor(%color);
%this.textShape.setShapeNameDistance(%distance);
%this.botholetext = %name;
}
else
{
%this.botholetextShape = new StaticShape()
{
datablock = botholeTextEmptyShape;
position = vectorAdd(%this.getPosition(),"0 0" SPC %this.getDatablock().botholetextSizeZ/9 + "0.166");
scale = "0.1 0.1 0.1";
};
%this.botholetextShape.setShapeName(%name);
%this.botholetextShape.setShapeNameColor(%color);
%this.botholetextShape.setShapeNameDistance(%distance);
%this.botholetext = %name;
}
}
function botholetext(%obj,%name, %bot)
{
%playerpos = %obj.getEyeTransform();
%bot.settransform(%playerpos);
%bot.setShapeName("");
schedule(1,0,%obj);
}
Detail- The Text put above on Bot's head with text name.