ParaScript.TargetCall

Declaration

public void TargetCall(string method, ParaPlayer target,Action onFinish, params object[] args)

Description

Makes a remote call to the specified function in the specified player’s script.

Parameter

method

Name of the function defined in the Lua file of the ParaScript

target

Target player that receives the call

onFinish

Callback notification when a remote call is completed

args

Variable parameter

function RemoteMethodName(info,num)
  print("Recv call ",info,num);
  return "remote method retruned";
end

function OnNetSpawned()
    local objTarget = ParaPlayerService.GetPlayerById(1003);
    self:TargetCall("RemoteMethodName",objTarget,function(result)
       print(result);
    end,"hello",123);
end