Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why the material of part doesnt change?

Asked by 5 years ago
Edited 5 years ago

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

Log in to vote
0
Answered by 5 years ago

Instead of writting...
Neon
Concrete
Sand
Granite

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

Ad
Log in to vote
0
Answered by 5 years ago

I fix it again at my own :P

Log in to vote
0
Answered by 5 years ago

Do this

temp.Material = Enum.Material.Neon

Answer this question