Making particles transparency 1 through clicking a part

(Sorry for being a noob on the og post)
Rewrite :
I’m try to make it so once clicking a part the particles go to transparency 1, if I did disable you see the particles fade out…

I got told to use this

function click()
script.Parents.Father.Mother.Sister.SistersPart.PartParticles.Particles.ParticleTransparency = 1
start
stop
end

I just don’t know how to connect the part with the part with particle (called A) with button (b)

1 Like

Roblox models don’t have a “gender” property.

I’d suggest using the wiki to find out more about models and what you can do using them - Documentation - Roblox Creator Hub

5 Likes

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

1 Like

You may be confusing Gender with something else. Do you mean Parent? Primary Part? Position?

Those are the only properties a model has, there is no “Gender” property on any object in roblox that I know of

1 Like

There is no “gender” property on models and well every instance there is, you may be thinking of the parent. Right now it seems the parent is workspace.

Regardless if this was a joke or not, the amount of joke replies took this a bit too far. 10 people didn’t have to post a joke about OPs mistake. This is the devforum, be civilised.

8 Likes

I realised my mistake now, kinda sad to see how many people didn’t help… Greatful for the ones who did…
Try and read my rewrite… it was what I was trying to get across

Make a Part.
Put a ClickDetector inside the part.
Put the particle emitter you want inside that part.
Put a script and put this inside the script:

script.Parent.ClickDetector.MouseClick:Connect(function()
script.Parent.ParticleEmitter.Transparency=NumberSequence.new(1)
end)

Must use a NumberSequence or it won’t work

2 Likes

Hey, can you provide some more context on to what you are doing? It seems like you are trying to make a button be pressed to change your particles. It seems you’re new and can use some help, I would highly recommend using @Egzekiel 's solution.

Just for some clarification: You should find the path by using the “explorer” tab and look within the Workspace folder, then find the direct path to the part you need for your particles.

1 Like

Unless you have this, your code is definitely not going to work
image

5 Likes

script.Parent would get the parent of the part. script.Parent.Parent would be used instead of script.Parents.Father.Mother. To get a direct child of an object, you’d do Object.ChildName; for example, script.Parent.Parent.Parent.Model1.ParticlePart.ParticleEmitter

1 Like

But I need part A once clicked change the particles transparency to 1 in part B

From what I see this happens in the Part with the particle, in my case B

Do you mind posting a screenshot of your hierarchy so we can further understand what’s parented to what?

1 Like

Rip, I don’t plan to be districted to this code though. If it’s not going to work or not correct I’m open to a different script or corrections, I think I need a different script lol

It would be best if you try to understand what you wanna do, I suggest you go to this page and start learning so you don’t have to ask to do that kind of stuff for you.

If you have another question related to developing, feel free to make a new thread ^^

2 Likes

I seem to have found your issue, you are not connecting the “clicked()” function to a .MouseClick event and there seems to be no ClickDetector, if no one has replied a working fix yet then you can use this. :slight_smile:

local Part = script.Parents.Father.Mother.Sister.SistersPart
local Particle = Part.PartParticles.Particles
local ClickDetector = Instance.new("ClickDetector")

function clicked()
	Particle.Transparency = NumberSequence.new(1)
end

ClickDetector.Parent = Part
ClickDetector.MouseClick:Connect(clicked)

image Directory should look like this if i’m correct.
Here is a GIF (Graphics Interchange Format) of what will happen when you click the part.
https://i.gyazo.com/1458fd70c2af1d00c457d3204262648d.mp4

3 Likes

Yay, thank you so much. Since the script I used originally included that odd directory, couldn’t I change it to script.parents.(partname)

If you want to make it simpler you could move the script in ServerScriptService and have the part just be in workspace with particles inside the part.
Here is what the code would look like and how the directory would look, this has the same effect as my above GIF shows.

local Part = workspace.ThePart
local Particle = Part.PartParticles.Particles
local ClickDetector = Instance.new("ClickDetector")

function clicked()
	Particle.Transparency = NumberSequence.new(1)
end

ClickDetector.Parent = Part
ClickDetector.MouseClick:Connect(clicked)

image This is what the directory would look like this time, this is much cleaner.

2 Likes

Okay I’ll try it when’s I get to my computer, thank you so much. You’ve been the most helpful so far :slight_smile: