Location System Help

Backstory

Hi, I am Jack. Currently, my friends and I are making a Chicago based game and I am trying to make a navigation system. This is an easy just at the top left states the street you are on. We have a list of streets and all that ready but I don’t know how I would do this. I am a starter scripter so my first thought would be at every intersection have 4 blocks, one on each side, and when you touch it it changes the text in the UI. Well, this would be either a very long script or about 50 shorter scripts so I decided that’s probably not the best option. I found a model that I changed up but it wasn’t very accurate and a lot of times would not work properly. If you could drop a sample code for just one street it would help. An example is Firestone V3 they have a system similar but I wasn’t able to figure out how they made it.

What I Need
Well since this is one of my first scripts other than really simple ones for ELS I just need a sample code or someone to tell me a general way to start. If you were to give me a sample I will make it easy on you

Text Changed is in a frame in a screen UI
Name part just part1 and part 2
Make it so it changes the text between “Part 1” and “Part 2” however you think would be the best way to approach this.

How I Tried

I tried with a touch so when you touch a part named Western it puts your location as Western Ave. Here is a gif of that so you know what I am talking about but this way seemed very inconvenient.

https://gyazo.com/44cec25ab94270dc1350c5d64138f27c

Like I said just a way you think would be best to approach or a sample would be great. I am hoping to get better at scripting so also if you know any good tutorials or anything those would help to. Thank you for all your help.

1 Like

This can be used to create zones. It has player enter and exit events. I’d say place the parts that indicate the streets down manually. If you wanna get advanced, you could program a system that detects “blocks” and intersections then proceeds to create street parts for it.

How I would approach this would be by having a separate folder in workspace/ReplicatedStorage that contains the street parts.
1)
Iterate over all the players then iterate over all the parts. This is ran on a 0.1-0.2 second loop. If the player is within a position which you can find out using math. If the player is found inside of a street break the loop that is iterating over the street parts and change the text to the part’s name.
2)
You could take an event based approach and use Zone+ which is what I recommend. Iterate over the parts when the server first starts. This could be done on the server or client. Create a zone class for each part’s region which again you can figure out using the part’s position and size. Create functions that bind onto the enter and leave events when the player enters, change the text to the street and if the player leaves, change the text to gps error or whatever.