Hey, I was just curious on how to make an if statement for a physical property. I have a door, when touched it changes material, basically, when this happens, the egg is suppose to detect it and change it's material also, but this doesn't happen. Any help, please?
if script.Parent.Parent.Portal.Material == Enum.Material.Neon then script.Parent.Material = "Neon" end
Not really familiar with your file explorer so here it goes:
local door = script.Parent --idk where your door is located local egg = script.Parent.Parent -- just put where your egg is located door.Touched:connect(function(hit) humanoid = hit.Parent:FindFirstChild("Humanoid") if humanoid then -- this checks if there's a humanoid to what hits the door egg.Material = Enum.Material.Neon -- this changes the material of egg to neon end end)