Author Topic: [FIXED] Event Not Working  (Read 705 times)

I don't know why but nothing inside of the Event will work.

Code: [Select]
function fxDTSBrick::CB_Teleport_Games(%client)
{

messageClient(%client,'',"<color:FFFFFF>Teleporting to <color:FFFF00>Games<color:FFFFFF>...");
%client.player.setTransform("-10.4331 -63.0114 0.404153");

}
registerOutputEvent("fxDTSBrick", "CB_Teleport_Games", "", 1);

Any idea why? Thanks!
« Last Edit: February 07, 2014, 04:28:59 PM by xXDeadwolf456Xx »

You're calling messageClient on a brick.

function KindOfObject::MethodName(%object/self)

Kind of Object is a fxDTSBrick, not a client. Try using GameConnection here.
method name is self explanatory
The first variable in a method function is always the object the method is being called on. this is actually similar to servercmds. in this case, despite naming it %client it is actually referring to a brick.

if you checked your console, you might see errors about message client not working with a brick, the brick not having a "player" field, and possibly a setTransform error.

Code: [Select]
function fxDTSBrick::CB_Teleport_Games(%brick, %client, %this, %obj)
{

messageClient(%client,'',"<color:FFFFFF>Teleporting to <color:FFFF00>Games<color:FFFFFF>...");
%client.player.setTransform("-10.4331 -63.0114 0.404153");

}
registerOutputEvent("fxDTSBrick", "CB_Teleport_Games", "", 1);

Alright, this worked.

or you could have just made it a GameConnection:: method