hello can somebody assisst me, if it possible, to make a different between all NPCPlayerApex.
i want to track all different npc below:
assets/prefabs/npc/scientist/scientist.prefab
assets/prefabs/npc/scientist/scientist_gunner.prefab
assets/prefabs/npc/scientist/scientistjunkpile.prefab
assets/prefabs/npc/scientist/scientistpeacekeeper.prefab
if i use :
it works and i can track murdererCode:if (entity is NPCMurderer) { ......... }
if i use :
it works too and i can track all scienist, but how i can track they differentCode:if (entity is NPCPlayerApex) { .......... }
like this:
but it will dont workCode:if (entity is NPCScientistpeacekeeper) if (entity is NPCScientistjunkpile) if (entity is NPCScientist_gunner)
Solved Make a differents between all NPCPlayerApex
Discussion in 'Rust Development' started by dIMjIM, Aug 23, 2018.
-
Can't you just make compare on prefab?
Code:if(entity.PrefabName.Equals("assets/prefabs/npc/scientist/scientist_gunner.prefab"))
-
yes thanks this work how i use it
edit:
i use now this and it works for me
Code:if(entity.PrefabName.Equals("assets/prefabs/npc/murderer/murderer.prefab")) { Your Code } else if(entity.PrefabName.Equals("assets/prefabs/npc/scientist/scientist.prefab")) { Your Code } else if(entity.PrefabName.Equals("assets/prefabs/npc/scientist/scientist_gunner.prefab")) { Your Code } else if(entity.PrefabName.Equals("assets/prefabs/npc/scientist/scientistjunkpile.prefab")) { Your Code } else if(entity.PrefabName.Equals("assets/prefabs/npc/scientist/scientistpeacekeeper.prefab")) { Your Code } else if(entity.PrefabName.Equals("assets/prefabs/npc/bandit/guard/bandit_guard.prefab")) { Your Code }
Last edited by a moderator: Aug 24, 2018 -
-
Wulf Community Admin
-
-
-
Wulf Community Admin
-
Ex:
Code:var a = "Oxide";switch(a) { case "Rust": // if 'a' is "Rust" <Magic> break;}
-
thx again to all i have now this and it works too
Code:var i = entity.ShortPrefabName; switch(i) { case "murderer": Puts( "Zombie" ); break; case "scientist": Puts( "Scientist" ); break; case "scientiststationary": Puts( "Scientiststationary" ); break; case "scientist_gunner": Puts( "Scientist - Gunner" ); break; case "scientistjunkpile": Puts( "Scientistjunkpile" ); break; case "scientistpeacekeeper": Puts( "Scientistpeacekeeper" ); break; case "bandit_guard": Puts( "Bandit - Guard" ); break; }
-
-