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

Terrain wont trigger comparison check?

Asked by
Nickoakz 231 Moderation Voter
8 years ago

With this code

cmtype=math.random(0,7)
ter=workspace.Terrain
function setcel(z)
local cm=ter:GetCell(z.X,z.Y,z.Z)
if cm~=tty then
print("heycells")
print(cm,tty)
ter:SetCell(z.X,z.Y,z.Z,tty,0,0)
end
end

No matter what, even if the set cell at the z position IS that terrain type, it passes the if statement and sets the cell.

The output is heycells Enum.CellMaterial.Gravel 11

Is there a way to turn the CellMaterial Enum to a raw Value Number?

1 answer

Log in to vote
0
Answered by
Nickoakz 231 Moderation Voter
8 years ago

Using

if cm.Value~=tty then

returned the exact value of the enum..

Ad

Answer this question