for (y = 1; y < 127; y++){//defines y as 1 and makes 1 go up to 127 (the ++ means that it adds 1 every time)
if(itemId==280){
setTile(getPlayerX(),y,getPlayerZ(),0);
}
}
I'm not sure if you can use 255.... as the world height is only 127 blocks (I think?) and if you use 255 the game might crash (again, I think?). But you should be fine with 127.
Hope this helped.
for (y = 1; y < 127; y++){//defines y as 1 and makes 1 go up to 127 (the ++ means that it adds 1 every time)
if(itemId==280){
setTile(getPlayerX(),y,getPlayerZ(),0);
}
}
I'm not sure if you can use 255.... as the world height is only 127 blocks (I think?) and if you use 255 the game might crash (again, I think?). But you should be fine with 127.
Hope this helped.
Thanks! I've looked into it. Some say its 255 and some say 127. I'm just gonna go to 127 Thanks again bruh!
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
function useItem(x,y,z,itemId,blockId,side) { if(itemId==280) { setTile(getPlayerX(),getPlayerY()-255,getPlayerZ(),0); } }If it helps any here is a example of loops in real JavaScript
for (var i=0; i<5; i++) { x=x + "The number is " + i + "<br>"; }-
View User Profile
-
View Posts
-
Send Message
Curse PremiumWhat exactly are you trying to do? Loops do work exactly like that in ModPE Script (at least on Android; no idea about Treebl's implementation)
for (y = 1; y < 127; y++){//defines y as 1 and makes 1 go up to 127 (the ++ means that it adds 1 every time) if(itemId==280){ setTile(getPlayerX(),y,getPlayerZ(),0); } }I'm not sure if you can use 255.... as the world height is only 127 blocks (I think?) and if you use 255 the game might crash (again, I think?). But you should be fine with 127.Hope this helped.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYeah, that's totally gonna work...