Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.
If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!
Now, what are you waiting for? Join the community now!
You can always check out skUnity Downloads for downloads and any other information about Skript!
function blocksInCube(p: player, r: number) :: blocks:
set {_loc1} to location of {_p}
set {_loc2} to location of {_p}
remove {_r} from x coord of {_loc1}
remove {_r} from y coord of {_loc1}
remove {_r} from z coord of {_loc1}
add {_r} to x coord of {_loc2}
add {_r} to y coord of {_loc2}
add {_r} to z coord of {_loc2}
return blocks within {_loc1} to {_loc2}
command /cube <number>:
trigger:
loop blocksInCube(player, arg-1):
set loop-block to air
blocks within pos1 to pos2
The code is now fixed, check my edit.nothing. I must replace something in this code? because I am only copy and past now.
Note that my example usage code sets nearby blocks to air. That means nothing changes when you don't have any blocks around you. Try changing for example `air` to `stone` and try again. (You will get stuck inside the cube.)not give error, but its not work.
soory? dont understand...Try values > 0. The equation for this is `2 * r + 1` (diameter + block which player stands on), so if you put there 0 the result would be 1 = single block on player location.
Try running command like so: `/cube 5` this will create cube around you with side length of 2*5+1 = 11 blockssoory? dont understand...
function blocksInCube(p: player) :: blocks:
set {_loc1} to location of {_p}
set {_loc2} to location of {_p}
remove 3 from x coord of {_loc1}
remove 3 from y coord of {_loc1}
remove 3 from z coord of {_loc1}
add 3 to x coord of {_loc2}
add 3 to y coord of {_loc2}
add 3 to z coord of {_loc2}
return blocks within {_loc1} to {_loc2}
function blocksInCube(b: block, r: number) :: blocks:
set {_loc1} to location of {_b}
set {_loc2} to location of {_b}
remove {_r} from x coord of {_loc1}
remove {_r} from y coord of {_loc1}
remove {_r} from z coord of {_loc1}
add {_r} to x coord of {_loc2}
add {_r} to y coord of {_loc2}
add {_r} to z coord of {_loc2}
return blocks within {_loc1} to {_loc2}