Cant change smoke proportions

Greetings.
I need help with Instance.new("Smoke") for some reason I cant change it`s color, size and etc with code. My code:

local partParticle = Instance.new("Smoke")
partParticle = "part particle"
partParticle.Color = Color3.new(0.0196078, 1, 0.133333)
partParticle.Opacity = 1
partParticle.RiseVelocity = 1
partParticle.Size = 1
partParticle.TimeScale = 1
partParticle.Parent = game.workspace

I write this in ReplicatedStorage with module and error that i get is:

ReplicatedStorage.ParticleTest:45: attempt to index string with ‘Color’

When I remove line that changes color it writes similarly error but now with ‘Opacity’ and if I will remove line with ‘Opacity’ it will write an error with ‘RiseVelocity’. Will be thankfull for helping because I cant find the answer to solve my problem.

Youre chaning the partParticle variable to the “part particle” string,
you forgot to put .Name after the variable on that line.
fixed script:

local partParticle = Instance.new("Smoke")
partParticle.Name = "part particle"
partParticle.Color = Color3.new(0.0196078, 1, 0.133333)
partParticle.Opacity = 1
partParticle.RiseVelocity = 1
partParticle.Size = 1
partParticle.TimeScale = 1
partParticle.Parent = game.Workspace
1 Like

It looks like you are trying to set properties of the Smoke object, but you are actually overwriting the object with a string on the second line of your code. Instead of partParticle = "part particle" , try removing that line or replacing it with partParticle.Name = "part particle" to set the name of the object.

Then, you should be able to set the properties of the Smoke object as you intended. Your code should look like this:

local partParticle = Instance.new("Smoke")
partParticle.Name = "part particle"
partParticle.Color = Color3.new(0.0196078, 1, 0.133333)
partParticle.Opacity = 1
partParticle.RiseVelocity = 1
partParticle.Size = 1
partParticle.TimeScale = 1
partParticle.Parent = game.Workspace
1 Like

Nvm, I did not see this response. :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.