- Does anyone know how to make a Cage skript?
- cage is ->
cage spawns like this
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 community!
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!
That is a lot of code to spawn in a structure. I would recommend using SkBee and instead simply saving the cage as a structure then spawning it in. https://skripthub.net/docs/?id=10552my Current skript is:
command /cage <player>:
trigger:
# floor#
set block below the player to bedrock
set block below north the player to bedrock
set block below south the player to bedrock
set block below east the player to bedrock
set block below west the player to bedrock
set block below 2 meters north the player to bedrock
set block below 2 meters east the player to bedrock
set block below 2 meters west the player to bedrock
set block below 2 meters south the player to bedrock
#roof#
set block 4 above the player to bedrock
set block 4 above north the player to bedrock
set block 4 above south the player to bedrock
set block 4 above east the player to bedrock
set block 4 above west the player to bedrock
#bedrock roof 2#
set block 4 above 3 meters north the player to bedrock
set block 4 above 3 meters east the player to bedrock
set block 4 above 3 meters west the player to bedrock
set block 4 above 3 meters south the player to bedrock
set block 4 above 2 meters north the player to bedrock
set block 4 above 2 meters east the player to bedrock
set block 4 above 2 meters west the player to bedrock
set block 4 above 2 meters south the player to bedrock
#walls
set block 3 meters north the player to iron bars
set block 3 meters east the player to iron bars
set block 3 meters south the player to iron bars
set block 3 meters west the player to iron bars
set block above 3 meters north the player to iron bars
set block above 3 meters east the player to iron bars
set block above 3 meters west the player to iron bars
set block above 3 meters south the player to iron bars
# walls 2
set block 3 above 3 meters north the player to iron bars
set block 3 above 3 meters east the player to iron bars
set block 3 above 3 meters west the player to iron bars
set block 3 above 3 meters south the player to iron bars
# walls 3
set block 2 above 3 meters north the player to iron bars
set block 2 above 3 meters east the player to iron bars
set block 2 above 3 meters west the player to iron bars
set block 2 above 3 meters south the player to iron bars
#bedrock floor#/roof#
set block below 3 meters north the player to bedrock
set block below 3 meters east the player to bedrock
set block below 3 meters west the player to bedrock
set block below 3 meters south the player to bedrock
Here:can u give me a code for it?
but i want my custom build as mentioned aboveHere:
https://skripthub.net/docs/?id=10551.
There's an example for placing structures at that link (I believe it also includes custom ones if you've made em)
You can create custom structures and place custom structures too, not just vanilla ones.but i want my custom build as mentioned above
and this skript places minecraft sturcture "set {_s} to structure with id "minecraft:village/taiga/houses/taiga_cartographer_house_1""
Hello,
- Does anyone know how to make a Cage skript?
when clicked at a player from 3 blocks it sumons a 5x5 cage in the players current location and the cage disappeares after 30s
- cage is ->
cage spawns like this
View attachment 8811
function summonCage(p: player):
set {_center} to location of {_p}
loop blocks in radius 2 around {_center}:
if loop-block is air:
set loop-block to iron bars
set {_topLocation} to {_center}
add 2 to y-coordinate of {_topLocation}
loop blocks in radius 2 around {_topLocation}:
if loop-block is air:
set loop-block to bedrock
set {_bottomLocation} to {_center}
subtract 2 from y-coordinate of {_bottomLocation}
loop blocks in radius 2 around {_bottomLocation}:
if loop-block is air:
set loop-block to bedrock
wait 30 seconds
loop blocks in radius 2 around {_center}:
if loop-block is iron bars:
set loop-block to air
loop blocks in radius 2 around {_topLocation}:
if loop-block is bedrock:
set loop-block to air
loop blocks in radius 2 around {_bottomLocation}:
if loop-block is bedrock:
set loop-block to air
command /cage <player>:
trigger:
if arg-1 is a player:
summonCage(arg-1)
else:
send "Player not found" to player
like mentioned abiove i want like thatHello,
I think thats what you want.
View attachment 8818
Here is the codes:
Code:function summonCage(p: player): set {_center} to location of {_p} loop blocks in radius 2 around {_center}: if loop-block is air: set loop-block to iron bars set {_topLocation} to {_center} add 2 to y-coordinate of {_topLocation} loop blocks in radius 2 around {_topLocation}: if loop-block is air: set loop-block to bedrock set {_bottomLocation} to {_center} subtract 2 from y-coordinate of {_bottomLocation} loop blocks in radius 2 around {_bottomLocation}: if loop-block is air: set loop-block to bedrock wait 30 seconds loop blocks in radius 2 around {_center}: if loop-block is iron bars: set loop-block to air loop blocks in radius 2 around {_topLocation}: if loop-block is bedrock: set loop-block to air loop blocks in radius 2 around {_bottomLocation}: if loop-block is bedrock: set loop-block to air command /cage <player>: trigger: if arg-1 is a player: summonCage(arg-1) else: send "Player not found" to player