Colors not showing for no reason?

game:GetService("ReplicatedStorage").KillerQueenEvents.BitesTheDust.OnServerEvent:Connect(function(player)

	local function formsphere(color)
		local chr = player.Character
		local b = Instance.new("Part")
		b.Size = Vector3.new(0.001,0.001,0.001)
		b.Transparency = 0
		b.Anchored = true
		b.CanCollide = false
		b.BrickColor = BrickColor.new(color)
		b.Locked = true
		b.CFrame = chr.HumanoidRootPart.CFrame * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) * CFrame.new(0, -3, 0)
		b.Parent = game.Workspace.FX
		b.Material = "ForceField"
		game.Debris:AddItem(b, 3)
		local c = Instance.new("SpecialMesh",b)
		c.MeshId = "http://www.roblox.com/asset/?id=3732570516"
		c.MeshType = "FileMesh"
		c.Scale = Vector3.new(0.1, 0.1, 0.1)
		c.TextureId = "rbxassetid://5850567969"

		coroutine.resume(coroutine.create(function()
			for _ = 1, 20 do
				wait()
				b.Transparency = b.Transparency + 0.05
				c.Scale = c.Scale + Vector3.new(0.1, 0.1, 0.1)
			end
		end))
		local epitaph = 0
	end
	
	formsphere("Lime green")
	wait(0.3)
	
	end)

when i form the sphere, it doesnt show an error in the output log, it just does not show a color for the sphere, which was set to green

What are you passing as color when calling your function?

I have attempted to pass 3 colors,

formsphere(“Lime green”)
formsphere(“Persimmon”)
and a random shade of blue

One thing that I can say is that I think you can’t get a color inside a function while you’re making a function script. I would recommend you to get color after you end the function.

i found the issue, if i were to grab the color of the local “b” i would be affecting the part, not the mesh it has, therefore the meshes color is white. I had to scrap the whole concept because i cant implement an RGB argument

True, There are various types of meshes that contain their own color.

1 Like