I have the following problem with map marker... it spawns fine, but it doesn't destroy it's last position... so the dots just stay there. What am I doing wrong? Thanks.
Code:using UnityEngine; using System.Collections.Generic;namespace Oxide.Plugins { [Info("Test", "jackcat", 0.1)] [Description("None.")] class Test : RustPlugin { MapMarkerGenericRadius mapmarker; void OnServerInitialized() { timer.Repeat(10, 0, () => { mapmarker = GameManager.server.CreateEntity("assets/prefabs/tools/map/genericradiusmarker.prefab", new Vector3(Oxide.Core.Random.Range(-3000/2, 3000/2),0,(Oxide.Core.Random.Range(-3000/2, 3000/2)))) as MapMarkerGenericRadius; mapmarker.alpha = 1; mapmarker.color1 = Color.red; mapmarker.color2 = Color.red; mapmarker.radius = 3; mapmarker.Spawn(); mapmarker.SendUpdate(); timer.Once(10, () => { mapmarker.Kill(); mapmarker.SendUpdate(); }); }); } } }
Map marker not destroying last position
Discussion in 'Rust Development' started by jackcat, Mar 19, 2018.
-
make timer.Once (9, instead of timer.Once (10, and it will work)
-
-