Particles won't disable

So i’ve been trying to make these particles disabled from code but for some reason they don’t.

for i, v in pairs(Boombox:GetChildren()) do
			if v:isA('ParticleEmitter') then
				
				if TextureID == Textures.Winter then
					if v.Name == 'Winter_Effects' then
						v.Enabled = true
					else
						v.Enabled = false
					end
				end
				
				if TextureID == Textures.Valentines then
					if v.Name == 'Valentines_Effects' then
						v.Enabled = true
					else
						v.Enabled = false
					end
				end
				
				if TextureID == Textures.Hallowen then
					if v.Name == 'Hallowen_Effects' then
						v.Enabled = true
					else
						v.Enabled = false
					end
				end
				
				if TextureID == Textures.Normal then
					v.Enabled = false
				end
				
			end
		end

Where do you set TextureID? Also what is in the Textures table?

ChangeSkin.OnServerEvent:Connect(function(plr, TextureID, GamepassID)
local Textures = {
	Winter = 'rbxassetid://8834125977',
	Hallowen = 'rbxassetid://8834031387',
	Valentines = 'rbxassetid://618739089',
	Normal = 'rbxassetid://212303049'
}

Would you be able to send over the client side part that sets the variable of TextureID?

for i, v in pairs(Template_Holder:GetChildren()) do
	if v:isA('Frame') then	
		
		if v.Name ~= 'NormalBoombox' then
			for i, v in pairs(v:GetChildren()) do
				if v:isA('TextButton') then			
					v.MouseButton1Click:Connect(function()
						ChageSkin:FireServer(v.Parent.BoomboxTexture.Value, v.Parent.GamepassID.Value)
					end)			
				end
			end	
		end	
	end
end
1 Like

Does v.Parent.BoomboxTexture.Value include rbxassetid:// or just the number? If it’s just the number it could mean the iif statement never fires which would cause it not to stop.

Yes it does include rbxassetid://

Have you tried printing out the TextureID against Textures.Normal?

Hmm… strange it won’t print at all

You could try putting the if statement for normal at the top, or changing all the ifs to be an elseif from the first if. So it continues down the chain, rathe than going to another if statment than another.

Everything else seems to be working, it prints the textures of the other boomboxes, but if i try and do the normal one it won’t do nothing.

Nvm am dumb i just did something, i used 2 remotes