Jump to content

[SOLVED] Ground on which you stand...


Forrest

Recommended Posts

Is there any way at all to check the material/ground of which a player is standing on? Ie; check if the player is standing on grass, or dirt?

Thanks.

Well, I think so.

Using processLineOfSight and setting it properly will return the name of the material you're standing on. It's pretty easy. Just set the returns like this:

addEventHandler ("onClientRender",getRootElement(),function() 
local x,y,z = getElementPosition (localPlayer) 
hitX, hitY, hitZ, hitElement, normalX, normalY, normalZ, material = processLineOfSight (x,y,z,x,y,z-4,true,false,false,false,false,false,false,false,nil,true) 
outputChatBox (material) 
  
end) 

This will output to chatbox the material.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...