how would i go about this? got a idea of a plugin where you /leaveevent and it teleports you back to where you originaly was
Saving a players location?
Discussion in 'Hurtworld Development' started by Ezki, Jan 25, 2016.
-
Code:
Dictionary<PlayerSession,Vector3> locations = new Dictionary<PlayerSession,Vector3>();
Code:locations.Add(session, session.WorldPlayerEntity.transform.position);
Teleport return:
Code:if (locations.Keys.Contains(session)) { foreach (var v in locations) { if (v.Key == session) { session.WorldPlayerEntity.transform.position = new Vector3(v.Value.x,v.Value.y,v.Value.z); } } locations.Remove(session); }
-
Code:if(locations.ContainsKey(session)) session.WorldPlayerEntity.transform.position = locations[session];
-
thanks i will try it and get back, im still learning