generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

How do you get a terrain's material using X, Y, Z?

Previous Thread :: Next Thread 
Climox is not online. Climox
Joined: 22 Jun 2012
Total Posts: 716
05 Aug 2015 07:55 AM
I'm using Enum.Material
Report Abuse
Climox is not online. Climox
Joined: 22 Jun 2012
Total Posts: 716
05 Aug 2015 08:13 AM
Nobody knows anything about terrain...
Report Abuse
Climox is not online. Climox
Joined: 22 Jun 2012
Total Posts: 716
05 Aug 2015 09:52 AM
bump
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
05 Aug 2015 10:12 AM
http://wiki.roblox.com/index.php?title=API:Class/Terrain/GetCell
Report Abuse
ReggieGotRekt is not online. ReggieGotRekt
Joined: 09 Apr 2011
Total Posts: 3
05 Aug 2015 10:14 AM
Look on the wiki.
Report Abuse
Climox is not online. Climox
Joined: 22 Jun 2012
Total Posts: 716
05 Aug 2015 10:17 AM
I am using material not CellMaterial
and I couldn't find it on wiki.
Report Abuse
Climox is not online. Climox
Joined: 22 Jun 2012
Total Posts: 716
05 Aug 2015 01:17 PM
bump
Report Abuse
Climox is not online. Climox
Joined: 22 Jun 2012
Total Posts: 716
05 Aug 2015 01:53 PM
bump
Report Abuse
Climox is not online. Climox
Joined: 22 Jun 2012
Total Posts: 716
05 Aug 2015 04:14 PM
bump... srs guys
Report Abuse
Climox is not online. Climox
Joined: 22 Jun 2012
Total Posts: 716
05 Aug 2015 04:38 PM
literally nobody knows?
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
05 Aug 2015 04:54 PM
Sorry I took so long to get back to you.

You should consider using this function:

http://wiki.roblox.com/index.php?title=API:Class/Terrain/ReadVoxels



(Also I apologize for misreading the question at first)
Report Abuse
Climox is not online. Climox
Joined: 22 Jun 2012
Total Posts: 716
05 Aug 2015 04:57 PM
--[[Thanks, I tried using it and here is my function and error (I was hoping there'd be an easier way, but roblox made it this difficult DX):
]]--

local ws = game:GetService("Workspace")
local fishLocation = ws.Fish
local terrain = ws.Terrain

function animateFish(fish)
while fish do
local rot = math.random()
for _ = 1, 31 do
fish.CFrame = fish.CFrame * CFrame.fromEulerAnglesXYZ(0, 0, rot*0.1)
wait()
end
for _ = 1, math.random(30) do
local cf = fish.CFrame*CFrame.new(Vector3.new(0, 0.10, 0))
local v = Vector3.new(cf.X, fish.Position.Y, cf.Z)
local material, occupancy = terrain:ReadVoxels(
Region3.new(v, v):ExpandToGrid(4), 4
)
if material == Enum.Material.Water then
fish.CFrame = CFrame.new(v)
end
wait()
end
--wait(math.random(50))
end
end

--[[
it doesn't work and i don't know why, can you help pls?
]]--
Report Abuse
Climox is not online. Climox
Joined: 22 Jun 2012
Total Posts: 716
05 Aug 2015 05:01 PM
for _, fish in pairs(fishLocation:GetChildren()) do
spawn(function()
animateFish(fish)
end)
end

oh sorry this is the rest of it
Report Abuse
Climox is not online. Climox
Joined: 22 Jun 2012
Total Posts: 716
05 Aug 2015 05:14 PM
bump
Report Abuse
Climox is not online. Climox
Joined: 22 Jun 2012
Total Posts: 716
05 Aug 2015 08:35 PM
bump
Report Abuse
Climox is not online. Climox
Joined: 22 Jun 2012
Total Posts: 716
05 Aug 2015 09:51 PM
bump
Report Abuse
Climox is not online. Climox
Joined: 22 Jun 2012
Total Posts: 716
05 Aug 2015 11:35 PM
bump
Report Abuse
DogeKip is not online. DogeKip
Joined: 06 Mar 2011
Total Posts: 6860
05 Aug 2015 11:41 PM
local cell = game.Terrain:WorldToCell(position)
local mat,block,orientation = game.Terrain:GetCell(cell)
if mat == Whatever material
code

On and on south of heaven | Previously: awesom914
Report Abuse
Climox is not online. Climox
Joined: 22 Jun 2012
Total Posts: 716
06 Aug 2015 06:20 AM
I'm using Enum.Material not Enum.CellMaterial so I can't use :GetCell()
Report Abuse
Climox is not online. Climox
Joined: 22 Jun 2012
Total Posts: 716
06 Aug 2015 08:05 AM
bump
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
06 Aug 2015 08:43 AM
I suggest using ReadVoxels and trying to use what it returns to find the specific x/y/z

I really don't have any other suggestions for you, sorry.
Report Abuse
Climox is not online. Climox
Joined: 22 Jun 2012
Total Posts: 716
06 Aug 2015 09:10 AM
war i gave you my script and it doesnt work can you help me fix it
Report Abuse
Climox is not online. Climox
Joined: 22 Jun 2012
Total Posts: 716
06 Aug 2015 09:21 AM
nevermind, i found out the problem.

the problem is that roblox made it so that its

material[1][1][1] for some reason...

made the material buried in tables
Report Abuse
nQqzRYVpIKA5jLP is not online. nQqzRYVpIKA5jLP
Joined: 05 Mar 2015
Total Posts: 4135
06 Aug 2015 09:23 AM
As is explained on the Wiki had you bothered to read it instead of spamming this forum.
Report Abuse
Climox is not online. Climox
Joined: 22 Jun 2012
Total Posts: 716
06 Aug 2015 02:09 PM
stop posting on my forums you jerk
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image