Hello Everyone!
I need some help with my Script.
I am wondering, how to make a fire rod...
That`s what I need:
When you tap the ground with a stick, it get`s block x,y,z
Then it creates fire on block that you have just tapped,
[AND THE HARDEST (What I CAN`T MAKE) ]:
Then this fire moves 5 blocks forward, from block that you tapped,
And when it is done fire disappears.
That`s what I need...
I WILL BE VERY RESPONSIBLE FOR HELP!
Hello Everyone!
I need some help with my Script.
I am wondering, how to make a fire rod...
That`s what I need:
When you tap the ground with a stick, it get`s block x,y,z
Then it creates fire on block that you have just tapped,
[AND THE HARDEST (What I CAN`T MAKE) ]:
Then this fire moves 5 blocks forward, from block that you tapped,
And when it is done fire disappears.
That`s what I need...
I WILL BE VERY RESPONSIBLE FOR HELP!
Have you actually done any code?
If not its basically us making the script.
Umm.. yeah you have too do your script first. I will still help you. if you have done your script i can find the errors and stuff.
Rollback Post to RevisionRollBack
Make sure you follow me on twitter! @DarkDiaMiner IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->
It works, but there are 2 problems
First, there`s no tick between fire appears. (Each fire must appear in 0.5 sec)
Second, the directory of appearing fire is different:
When you are facing north it is normal, but when south or east e.t.c, it moves left, or right, or back...
Here are the problems.
Help please.
function timer(x, y, z)
{
var timer = setTimeout(setFire(x, y, z), 5000);
}
function setFire(x, y, z)
{
setTile(x, y, z, 51);
}
Then call it like this:
function useItem(x, y, z, itemId, blockId, side)
{
if(itemId == 280)
{
seTile(x, y, z, 51);
timer(x, y, z);
timer(x, y, z);
timer(x, y, z);
timer(x, y, z);
}
}
Try this.Whoops. Actualy set the 5000 interval to 500 for 0.5 seconds.
Rollback Post to RevisionRollBack
Willing to work on Android apps or multi-platform games, see profile bio for information.
It works, but there are 2 problems
First, there`s no tick between fire appears. (Each fire must appear in 0.5 sec)
Second, the directory of appearing fire is different:
When you are facing north it is normal, but when south or east e.t.c, it moves left, or right, or back...
Here are the problems.
Help please.
1. What is getTile() for while you don't collect the returned value?
2. The x-axis is based on the world coordinates of the map, when you move x+ you are moving opposite the direction of clouds. If you want to, say, find x+/x-/z+/z- one of them nearest to the direction the player is facing, you need to do (Player.getYaw()+45)/90%4 to get values 0-3 representing each dimension. It is hard to explain in words but if you know the least about arithmetics and what yaw is you will understand.
3. Check if the block is not air but you replaced it with fire. Also to set a block at (x,y,z) on fire (technically it should be under fire lol) you change the block at (x,y+1,z) from air to fire. If it was not air it should be non-ignitable.
So if I do something you wanted to do I would have done:
function timer(x, y, z)
{
var timer = setTimeout(setFire(x, y, z), 5000);
}
function setFire(x, y, z)
{
setTile(x, y, z, 51);
}
Then call it like this:
function useItem(x, y, z, itemId, blockId, side)
{
if(itemId == 280)
{
seTile(x, y, z, 51);
timer(x, y, z);
timer(x, y, z);
timer(x, y, z);
timer(x, y, z);
}
}
Try this.
Whoops. Actualy set the 5000 interval to 500 for 0.5 seconds.
setFire() returns nothing. Are you sure you want to add the return value of setFire(), which is equal to null, to a parameter of setTimeOut(), which (seems that) it is not a defined function? Maybe you meant setFireTicks()? Also, the function timer() does nearly nothing you could have called setTimeOut() directly.Edit: Add my template at github.com/connor4898/modpe-scripts/wiki the tutorial page use the timer function to extinguish fire.
Also sorry setFireTicks is for mobs not blocks
Rollback Post to RevisionRollBack
I can be found on Freenode IRC channels #pocketmine, #ModPEScripts, #LegendOfMCPE, #pmplugins or #BeaconMine.
I am a PocketMine-MP plugin developer. I hate it when people think that I love stupid admin positions. Being an admin is nothing compared to being a plugin developer.
I am also a main developer of BlockServer, a work-in-progress MCPE server software. You are welcome to download it, but it so far onlly spawns you in the upther (above the world). You can chat, though.
I do not own this server but I just love to put this banner here:
To post a comment, please login or register a new account.
I need some help with my Script.
I am wondering, how to make a fire rod...
That`s what I need:
When you tap the ground with a stick, it get`s block x,y,z
Then it creates fire on block that you have just tapped,
[AND THE HARDEST (What I CAN`T MAKE) ]:
Then this fire moves 5 blocks forward, from block that you tapped,
And when it is done fire disappears.
That`s what I need...
I WILL BE VERY RESPONSIBLE FOR HELP!
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumIf not its basically us making the script.
Check out my game! It's an open-world, sandbox text adventure.
Follow @hexdro_
Hexdro © 2012-2015
IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->
function useItem(x,y,z,itemId,blockId,side) { if(itemId==280) { getTile(x,y,z); setTile(x,y+1,z,51); setTile(x,y+1,z+1,51); setTile(x,y+1,z+2,51); setTile(x,y+1,z+3,51); setTile(x,y+1,z+4,51); } }It works, but there are 2 problems
First, there`s no tick between fire appears. (Each fire must appear in 0.5 sec)
Second, the directory of appearing fire is different:
When you are facing north it is normal, but when south or east e.t.c, it moves left, or right, or back...
Here are the problems.
Help please.
function timer(x, y, z) { var timer = setTimeout(setFire(x, y, z), 5000); } function setFire(x, y, z) { setTile(x, y, z, 51); }Then call it like this:
function useItem(x, y, z, itemId, blockId, side) { if(itemId == 280) { seTile(x, y, z, 51); timer(x, y, z); timer(x, y, z); timer(x, y, z); timer(x, y, z); } }Try this.Whoops. Actualy set the 5000 interval to 500 for 0.5 seconds.
Willing to work on Android apps or multi-platform games, see profile bio for information.
Founder and CEO of Temena Development
Twitter: @TemenaPE
Instagram: @ItsLiterallyMath
There`s no setTimeout in ModPe... (
function useItem(x, y, z, itemId, blockId, side){
If(itemId==280)//280 = stick
setTile(x,y+1,z,51);
}
}
Its an easy code to do
I have known that over 9999 thousand times...
P.S
I knew that a long time ago... =)
I`m not a beginner
1. What is getTile() for while you don't collect the returned value?
2. The x-axis is based on the world coordinates of the map, when you move x+ you are moving opposite the direction of clouds. If you want to, say, find x+/x-/z+/z- one of them nearest to the direction the player is facing, you need to do (Player.getYaw()+45)/90%4 to get values 0-3 representing each dimension. It is hard to explain in words but if you know the least about arithmetics and what yaw is you will understand.
3. Check if the block is not air but you replaced it with fire. Also to set a block at (x,y,z) on fire (technically it should be under fire lol) you change the block at (x,y+1,z) from air to fire. If it was not air it should be non-ignitable.
So if I do something you wanted to do I would have done:
function useItem(x,y,z,i){ if(item==280){ var d=(Player.getYaw()+45)/90%4; if(d==0){ for(var j=0;j<6;j++){ if(getTile(x,y+1,z+j)==0){ setTile(x,y+1,z+j,51); } } } if(d==1){ for(var j=0;j<6;j++){ if(getTile(x+j,y+1,z)==0){ setTile(x+j,y+1,z,51); } } } if(d==2){ for(var j=0;j<6;j++){ if(getTile(x,y+1,z-j)==0){ setTile(x,y+1,z-j,51); } } } if(d==3){ for(var j=0;j<6;j++){ if(getTile(x-j,y+1,z)==0){ setTile(x-j,y+1,z,51); } } } } }Something like this.
setFire() returns nothing. Are you sure you want to add the return value of setFire(), which is equal to null, to a parameter of setTimeOut(), which (seems that) it is not a defined function? Maybe you meant setFireTicks()? Also, the function timer() does nearly nothing you could have called setTimeOut() directly.Edit: Add my template at github.com/connor4898/modpe-scripts/wiki the tutorial page use the timer function to extinguish fire.
Also sorry setFireTicks is for mobs not blocks