I'm trying to make a plugin where "OnUserInput" would spawn an entity at a players feet. Ideally, I'd like it to be one or the other. Is it possible to have two (or more) separate strings that can do this? Or am I missing a simple line?
At the moment my line shows;
Code:string treeEnt = "assets/bundled/prefabs/autospawn/resource/v2_temp_beachforest_small/douglas_fir_d.prefab"; string treeEnt2 = "assets/bundled/prefabs/autospawn/resource/v2_arctic_forest/douglas_fir_a_snow.prefab";This just returns errors.Code:BaseEntity baseEntity = GameManager.server.CreateEntity(treeEnt, player.transform.position + (player.modelState.ducked ? Vector3.up * -0.0f : Vector3.up * -0.0f) + player.eyes.HeadForward());
I'm still quite new to C# so slowly getting there, and any advice would be greatly appreciated!
Two Separate "entity" strings
Discussion in 'Rust Development' started by ThatGuy 8, Mar 7, 2018.
-
Wulf Community Admin
What are the errors exactly? If you want it to be random, you'd need to add a bit of code to randomly pick which string to use.
-
Code:
Operator `||' cannot be applied to operands of type `string' and `string'
-
Wulf Community Admin
-
-
Wulf Community Admin
-