08-30-2015, 12:01 AM
Hi, its my first plugin in LUA.
I don't know how to check the ID of block in random XYZ position.
Sometimes its move me into blocks. I want to teleport olny on grass, sand, dirt.
Please help
  
I don't know how to check the ID of block in random XYZ position.
Sometimes its move me into blocks. I want to teleport olny on grass, sand, dirt.
Please help
  PHP Code:
function Randomtp(Split, Player)
    if (#Split ~= 1) then
        Player:SendMessage("Usage: /rtp")
        return true
    else
        X = math.random(-2000, 2000)
        Y = math.random(40,70)
        Z =  math.random(-2000, 2000)
        Player:TeleportToCoords(X, Y, Z)
        Player:SendMessage(cChatColor.Yellow .. "Cords")
        Player:SendMessage("X: " .. X)
        Player:SendMessage("Y: " .. Y)
        Player:SendMessage("Z: " .. Z)
    end
    return true
end 
![[Image: err.png]](http://vcraft.pl/hosting/err.png)
![[Image: errr.png]](http://vcraft.pl/hosting/errr.png)