Hello, I try to make sure that when I go to see a npc this sends an RF signal on my receiver.
I proceeded so that the npc spawn a RFBroadcaster, I regulate the frequency and I give it power.
but it does not work and I totally block.
would you have a solution here is the code I've done so far.
I proceeded so that the npc spawn a RFBroadcaster, I regulate the frequency and I give it power.
but it does not work and I totally block.
would you have a solution here is the code I've done so far.
void OnUseNPC(BasePlayer npc, BasePlayer player, Vector3 destination)
{
ulong recruteur = 750596702ul;
if(npc.userID == recruteur && recruteur != 0){
SendReply(player, "test");
Vector3 position = player.transform.position + (player.transform.forward * 5);
if (position == null) return;
RFBroadcaster Braodcaster = (RFBroadcaster)GameManager.server.CreateEntity("assets/prefabs/deployable/playerioents/gates/rfbroadcaster/rfbroadcaster.prefab", position, new Quaternion());
if (Braodcaster == null) return;
BaseEntity Minientity = Braodcaster as BaseEntity;
(Minientity as RFBroadcaster).UpdateHasPower(1, 1);
Minientity.Spawn();
(Minientity as RFBroadcaster).frequency = 2626;
Minientity.SendNetworkUpdateImmediate();
timer.Repeat(1f, 0, () =>
{
Minientity.Kill();
});
}
}thank you in advance for your help