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

Why isn't this changing the brick color?

Problem : The color isn't changing when "meat" touches the brick but the sound plays and name changes! I'm very confused on why this isn't working help would be appreciated!

Script

--- VAIRBLES ---
local Player = game.Players.LocalPlayer
local Part = script.Parent
local Sound = Part:WaitForChild('Sound')

--- CODE ---
script.Parent.Touched:Connect(function(hit)
	if(hit.Parent.Name == "RawMeat")then
		for _, child in pairs(hit.Parent:GetChildren()) do
			Sound.Playing = true
			Sound.Volume = 0.5
			wait (.1)
			Sound.Playing = false
			hit.Parent.Name = "Meat";
			
			if(child.Name == "Meat")then
			hit.BrickColor = script.Parent.Color1.Value			
			print ("IT WORKED!")
			end
		end
	end 
end)

3 comments

0

Didnt really look at it too much, but are you setting your brickcolor to a color3 object value? If so, use hit.Color3

0

Color3 is not a valid member of UnionOperation, it's a union!

0

Try "hit.Color = script.Parent.Color1.Value"

1 answer

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