Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Floating Blocks by negamartin
- --Modified to "Jump Around" by Lion4ever
- --You can use it for whatever you want, copy, modify, distribute it or use it as a base for your own structures
- --Get what the main program is telling us to do
- local args={...};
- --If it wants to know how much probability we have to be chosen when selecting the next structure
- if args[1]=="weight" then
- return 1; --We have a normal structure's probability to be chosen
- --If it wants us to build the structure,
- elseif args[1]=="build" then
- --Get the angle the last structure had
- local lastAngle=args[2];
- --Get a random height difference for the block we are going to place in relation to the last block, from -2 to 1
- local r=math.random();
- if r<0.22222 then hdif=-1;
- elseif r<0.33333 then hdif=-2;
- else hdif=0;
- end
- --Get the distance between the last block and the one we are gonna place, depending on the height difference (if the block is lower you can jump farther)
- local dist = 3.6
- --Get the new angle, which is (+-)0.3PI from the previous angle (lastAngle)
- local ang=lastAngle-math.pi*0.3+math.random()*math.pi*0.6;
- --Get the radius of our areaCheck sphere depending on the height difference
- local sphere;
- if hdif==-2 then sphere=7;
- elseif hdif==-1 then sphere=6;
- else sphere=5; end
- --Create our setblock parameters and place them in a table
- local b={
- math.floor(0.5+math.cos(ang)*dist),
- hdif,
- math.floor(0.5+math.sin(ang)*dist),
- "minecraft:stone",
- };
- local b2={
- math.floor(0.5+math.cos(ang)*(dist-1.5)),
- 2,
- math.floor(0.5+math.sin(ang)*(dist-1.5)),
- b[4]
- }
- --Return the StructureTable, with everything it needs to have
- return {
- blocks={b,b2}, --The blocks table contains 1 element: the floating block
- areaCheck={{b[1],b[2],b[3],sphere}}, --The areaCheck table also only contains 1 element, our floating block area check.
- exit={b[1],b[2],b[3]}, --The exit of this structure is this same block
- next=ang, --Tell the next structure our angle was this
- length=15, --This structure is 15% a total checkpoint-to-checkpoint parkour section in normal difficulty
- };
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement