#Island creation

1 messages · Page 1 of 1 (latest)

calm lantern
#

what do you wa nt it to do?

vestal walrus
#

if a player type "/createisland" i want to create a new island 100 blocks away from the island created before like skyblock

calm lantern
#
    trigger:
        if {Last-Island-Position} is set:
            set {New-Island-Position1} to location({Last-Island-Position::x} + 100, {Last-Island-Position::y}, {Last-Island-Position::z} + 100, world "world")
            set {New-Island-Position2} to location({Last-Island-Position::x} + 101, {Last-Island-Position::y}, {Last-Island-Position::z} + 101, world "world")
        else:
            set {New-Island-Position1} to location(21, 116, 27, world "world")
            set {New-Island-Position2} to location(20, 116, 28, world "world")
        fill structure {Island} between {New-Island-Position1} and {New-Island-Position2}
        set {Island} to structure named "Island"
        set {Location} to location(25, 116, 27, world "world")
        place structure {Island} at location({New-Island-Position1} + 5, 0, 0)
        set {Last-Island-Position} to {New-Island-Position1}
        send "Created new island at position {New-Island-Position1}!"
#

Try that

vestal walrus
#

the island spawned here

calm lantern
#

now do another one

vestal walrus
#

there is no new island coming

calm lantern
#

does it send to you in chat Created new island?

vestal walrus
calm lantern
#

hm

#

give me a sec

#
    trigger:
        if not exists {Island-Position1}:
            # Create the first island at the default location
            set {Island-Position1} to location(21,116,27, world "world")
            set {Island-Position2} to location(20,116,28, world "world")
            fill structure {Island} between {Island-Position1} and {Island-Position2}
            set {Island} to structure named "Island"
            set {Location} to location(25,116,27, world "world")
            place structure {Island} at location({Island-Position1} + 5,0,0)
            set {Last-Island-Pos} to {Island-Position1}
            send "&aCreated the first island!"

        else:
            # Calculate the position of the new island
            set {New-Island-Pos} to {Last-Island-Pos} + location(100,0,0)
            set {Island-Position1} to {New-Island-Pos} + location(-1,0,-1)
            set {Island-Position2} to {New-Island-Pos} + location(1,0,1)

            # Create the new island at the calculated position
            fill structure {Island} between {Island-Position1} and {Island-Position2}
            set {Island} to structure named "Island"
            set {Location} to {New-Island-Pos}
            place structure {Island} at location({Island-Position1} + 5,0,0)
            set {Last-Island-Pos} to {New-Island-Pos}
            send "&aCreated a new island at {New-Island-Pos}!"
#

If this is the first time the command is used, it creates the first island at the default position (21,116,27) and sets the {Last-Island-Pos} variable to {Island-Position1} so that the next island will be created 100 blocks away from this island.
If this is not the first time the command is used, it calculates the position of the new island by adding 100 to the x-coordinate of the {Last-Island-Pos} variable. It then sets {Island-Position1} and {Island-Position2} based on the calculated position.
It then creates the new island at the calculated position, sets {Last-Island-Pos} to the new island's position, and sends a message to the player confirming the creation of the island.

vestal walrus
vestal walrus
#

Can you fix it? Sadge

normal frigate
#

why are you trying to parse a location as a number, that's like parsing Tokyo, Japan as 23.

vestal walrus
#

how i change this?