I want to create a script that makes a model visible after pressing an button for an client only

if v.Parent.Name ~= 'Country' and v:IsA('path') then

why are you checking for it to be a path? Unless of course it’s classname is ‘Path’ but I assume that you’re using parts to make the border

1 Like

Since the parts inside the model is called “path”

1 Like

It did make the borders invisible, but everything else became visible instead, and the modern borders didn’t become visible after i pressed it again

1 Like

Oh I understand. when I do

if v:IsA('BasePart') then

I’m checking for what kind of item it is. For instance, every physical item in a game (that you can touch) is a BasePart or a Part. I’m checking what kind of item ‘v’ is rather than what its name is.

1 Like

My apologies, I didn’t test the script beforehand

1 Like

I’m sorry but I’m not following along. This is what shows up for me. Was this your intended effect or was it something else? If you could provide any videos / images, that would go a long way to help me.

1 Like


The thing was inspired by another game

1 Like

So is the issue the fact that you want that yellow country’s borders to be the only one showing up?

1 Like

you see the black borders appearing? i want that to happen

1 Like

So the semi transparent lines (shown below) should not be shown at all ?
image

1 Like

those are the “state” borders, i don’t want those, those will be for another button

1 Like

so the way I would tackle this is by making a folder for states and country lines (which you have done, i think)

and check in the script if the parent of the item ‘v’ is not ‘state lines’

change this line

if v.Parent.Name ~= 'Wall2' and v:IsA('BasePart') then

to this

if v.Parent.Name ~= 'Wall2' and v:IsA('BasePart') and v.Parent.Name ~= 'State' then -- The v.Parent.Name ~= 'State' checks to see if it's not a state line

Hold on nevermind I dont think it works

1 Like

image

1 Like

The point of your script is to get your items and see if they’re country / state lines and then show off depending on the button pressed, correct?

1 Like

And just to clarify, this is a showcase of your game, correct?

1 Like

the idea is that if you press a “2024” button, the modern day borders show up, if you press again, it goes invisible.
and then that for every era option + rivers + state borders
(no other borders appear unless you click on the specific button with the year on it)

1 Like

Have you created a folder for the border lines separating and representing the state name or rivers?

1 Like

image

1 Like

You have to retrieve the descendants of the particular model. The button will grab everything that is named ‘path’ if I am correct, it will just loop through the ‘Eras’ folder and return everything that is labelled ‘path’ in the same category from all of your models. You may need to add more variables to thoroughly check if the button is retrieving the right ‘path’ from the model you want to interact with.

If I am wrong and it just doesn’t work entirely. Check for any logical errors by using print statements.

1 Like