Author Topic: Script Codes  (Read 1807 times)

So.. This?
Code: [Select]
function ThirdPerson::onTrigger(%this,%obj,%trigger,%val)
{
      if(%trigger == 4);
                  {
                  %obj.changedatablock(FirstPerson);
                  }
}


Wait, ThridPerson::OnTrigger? What is that doing?

I'm trying to create a player type with two different datablocks. And with that piece of code, I was hoping it would switch between the datablocks..


Wait, ThridPerson::OnTrigger? What is that doing?
When you are the datablock, ThirdPerson, and calling a trigger, do this.

Could I do this?
Code: [Select]
function ServerCMDSwitch(%this,%val,%client)
{
      %client.setdatablock(FirstPerson);
}

I'm not sure if you grasp the format of servercmds. How are %val and %client being passed into the function, and what kind of values are they expected to have?