I have a large game that features the Smooth Terrain feature. However, what I would like to do is light a player on fire when they touch Cracked Lava terrain, as described in the following pseudocode:
while true do
for plr in game.Players do
if plr is touching CrackedLava terrain -- what I need help with
(set plr on fire) -- I know how to do this and do not need help
end
end
wait(0.1)
end
Basically, that is what I need to do. However, it probably will not need the loop, as that could cause lag. Here is another method I came up with that probably won't work, but I can't try it, as I don't actually know how to do some things.
let terrain = game.Terrain
for (voxel of type "CrackedLava") in terrain do -- don't know if something like this is possible
(surround terrain with part named "LavaPart") -- don't know how to do this either
end
for (part named "LavaPart") -- know how to do this
(insert script from ServerScriptService into part) -- know how to do this
end
That might work, but still would have lag on older machines, most likely even more than the initial method of covering it in bricks. It would also need to have a way to gather all the Smooth Terrain voxels. However, it does solve two initial problems, and an answer like this would be acceptable. (I really just want to not spend a really long time covering up my world with parts.)
So, can anyone please rewrite one of these examples into actual ROBLOX Lua or come up with a completely different method that works? (Please explain any code, as I am trying to learn some stuff by making ROBLOX games)

2 comments
http://wiki.roblox.com/index.php?title=API:Class/Terrain/ReadVoxels , never used it myself, but it looks like it uses Region3 and returns the material. Use that + a touched event and you should be able to do what you need to.
Can you please explain that in an Answer Pyrondon?