Hello, its me again Immebest. So well I am really new scripter and now trying to make certain meshes/objects change color and material if a certain value goes above a certain number.
Although it did not worked, I tried everything from making sure I saved the scripted, comitted them and rewrite and try to fix it lots of times but the material color or the material itself never changed, this is the script I was using and I would be thankful if someone told me what was wrong.
local Temp = workspace.Temp
if Temp.Value >= 3000 then
script.parent.brickcolor = "New Yeller"
script.parent.material = "Neon"
local Temp = game.Workspace.Temp
if Temp.Value >= 3000 then
script.Parent.BrickColor.new(255, 255, 0)
script.Parent.Material = "Neon"
your errors was “script.parent” use “script.Parent” instead and also you used “brickcolor” and “material” use “BrickColor” and “Material” instead , also here is where you can study about BrickColors! BrickColor | Roblox Creator Documentation
From what it looks like to me, you’re only trying to change the Properties once when the script starts.
You need to either periodically change it with a loop such as while wait(5) do or using RunService
or you can detect when the Value has changed, then update it with temp.Changed:Connect(function()..
a quick script:
local temp = workspace.Temp
temp.Changed:Connect(function()
if temp.Value >= 3000 then
script.Parent.BrickColor = BrickColor.new("New Yeller")
script.Parent.Material = Enum.Material.Neon
end
end)
Thats great and all, but well I still cant change the color it just stays like that and I am so sure that I commited this script and followed your instructions but it still doesnt work. I just want a script that just changes the color once.
Oh I’m sorry, I’d forgotten to mention you’re writing the BrickColor wrong.
You can either use BrickColor.Red, Blue, Green, etc.
But for a specific color like New Yeller you need to use script.Parent.BrickColor = BrickColor.new("New Yeller")
And for Material: script.Parent.Material = Enum.Material.Neon