I'm trying to run two sounds, I want one to finish before the next one starts current code:
I tried usingCode:Effect.server.Run("assets/prefabs/building/door.hinged/effects/door-wood-open-start.prefab", player.transform.position, Vector3.zero); Effect.server.Run("assets/prefabs/building/door.hinged/effects/door-wood-open-end.prefab", player.transform.position, Vector3.zero);
but got a Unauthorized Access Exception Anyone know how to get it to wait till the first one is done or allow me to set x number of seconds?Code:System.Threading.Thread.Sleep(5000);
Solved Wait x number of seconds before continuing
Discussion in 'Rust Development' started by Manvaril, Mar 11, 2018.
-
Code:
Effect.server.Run("assets/prefabs/building/door.hinged/effects/door-wood-open-start.prefab", player.transform.position, Vector3.zero); timer.Once(2, () => Effect.server.Run("assets/prefabs/building/door.hinged/effects/door-wood-open-end.prefab", player.transform.position, Vector3.zero));
-
+1.
Just be aware that the rest of your code doesn't wait.
Code:Puts("First Line"); timer.Once(2, () => Puts("Third Line")); Puts("Second Line");
Code:timer.Once(2, () => { Puts("Fourth Line"); Puts("Fifth Line"); });
-
Wulf Community Admin