Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does my rainbow fire ModuleScript appear black?

So I have been creating a simulation game with a LOT of modulescripts. However, one doesn't work. The joining and stuff like that works and stuff however my rainbow fire script appears to be black??!!! Here is the script:

return function(Knife)
	local rainbowfire = Instance.new("Fire", Knife.Handle)
	rainbowfire.Heat = 5
	rainbowfire.Size = 3
	rainbowfire.Color = Color3.fromRGB(Random)
end

Any advice? My thinking at first was that maybe the "Random" wasn't really specified so I added 3 colors from RGB however all it did was make it red so I tried 4 and it made it purple. Then I tried "math.random" however the same thing happened.

1 answer

So wait i am confused, i don't really understand your problem, but to change the color of a fire you need to do this:

fire.Color = Color3.fromRGB(255, 0, 0) -- Red
fire.Color = Color3.fromRGB(0, 0, 255) -- Blue

If you want the fire to generate like random color from rainbow you can use:

local randomFirstColor = (math.random(1, 100))/100 -- You can not use math.random on numbers lower than 1

fire.Color = Color3.fromHSV(randomFirstColor, 1, 1) -- The last 2 numbers should be ones if you want it to be based on rainbow colors

Maybe this is completely not what you need but i don't really fully understood your question.

This discussion is preserved as it was. New answers, comments, and votes are closed.