So, i want my part to change it's brickcolor and material when clicked, but it isn't doing that.
My code: (it's in a normal script)
local ClickDetector = script.Parent.ClickDetector
local ogien1 = script.Parent.Parent.ogienjeden.Fire
local ogien2 = script.Parent.Parent.ogiendwa.Fire
local ogien3 = script.Parent.Parent.ogientrzy.Fire
local ogien4 = script.Parent.Parent.ogiencztery.Fire
local ogien5 = script.Parent.Parent.ogienpiec.Fire
local sound = script.Parent.Parent.seinfeld
local part = script.Parent.Parent.Glowna
ClickDetector.MouseClick:connect(function(plr)
ogien1.Enabled = true
ogien2.Enabled = true
ogien3.Enabled = true
ogien4.Enabled = true
ogien5.Enabled = true
part.BrickColor = tostring("Burnt Sienna") -- this is the line that im getting the error from
part.Material = tostring("CorrodedMetal") -- this would be the line that i will get an error from, but it isn't executing because of the first line getting an error
local ramka = plr.PlayerGui.ScreenGui.Frame
local tekst = ramka.TextLabel
sound.Playing = true
sound.Volume = 5
ramka.Visible = true
tekst.Text = "Kto? podpali? automat biletowy przy zajezdni ?odygowa. *klap klask*"
wait(5)
ramka.Visible = false
tekst.Text = ""
end)
