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

Why the material of part doesnt change?

Im making a game with core (again) and im making an effect to the core. The core is supposed to change its material at specific temperatures but nothing happens. Here is the code.

while true do
temp = game.Workspace.Temp.Value
if temp > 3000 then
script.Parent.Material = Neon
elseif temp > 2700 then
script.Parent.Material = Neon
elseif temp > 2200 then
script.Parent.Material = Neon
elseif temp > 200 then
script.Parent.Material = Concrete
elseif temp > -100 then
script.Parent.Material = Sand
elseif temp > -300 then
script.Parent.Material = Granite
else
script.Parent.Material = Granite
end
wait()
end

PS: I dont like the new text editor ;-;

3 answers

✓ Accepted answer

Instead of writting...
Neon
Concrete
Sand
Granite

Write:
Enum.Material.Neon
Enum.Material.Concrete
Enum.Material.Sand
Enum.Material.Granite

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