{_loc} in function help

  • Welcome to skUnity!

    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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

FnnF

Member
Jun 5, 2021
1
0
1
upload_2021-6-5_12-48-3.png

This is error from this function.
Code:
function loadIsland(p: player, i: text):
    if {creatingisland} is not true:
        close {_p}'s inventory
        set {creatingisland} to true
        execute console command "effect give %{_p}% minecraft:blindness 1000 10"
        teleport {_p} to spawn of world "newislands"
        if {_p}'s world = "newislands":
            set {island::%{_p}%} to true
            set {move::%{_p}%} to false
            add 300 to {islands}
            play sound "entity.enderman.teleport" to {_p}
            send "{@p} Generating..." to {_p}
            wait 1 second
            set {move::%{_p}%} to true
            wait 1 tick
            set {_loc} to location at ({islands}, (y-coordinate of {_p}), {islands}) in world "newislands"
            set block below {_loc} to bedrock
            set world of {_loc} to {_p}'s world
            teleport {_p} to {_loc}
            paste structure {_i} at {_loc}
            set block under {_p} to air
            wait 1 tick
            if {_i} is "Plains":
                teleport {_p} to {_p} ~ (vector 12, 20, 9)
            else if {_i} is "Desert":
                teleport {_p} to {_p} ~ (vector 10, 21, 5)
            else if {_i} is "Snow":
                teleport {_p} to {_p} ~ (vector 9, 20, 11)
            else if {_i} is "Mesa":
                teleport {_p} to {_p} ~ (vector 10, 21, 12)
            else if {_i} is "Mushroom":
                teleport {_p} to {_p} ~ (vector 17, 25, 15)
            set {move::%{_p}%} to false
            set block under block under {_p} to bedrock
            send "{@p} Generating..." to {_p}
            wait 1 second
            set {_boundloc1} to {_p} ~ (vector 150, 86, 150)
            set {_boundloc2} to {_p} ~ (vector -150, -62, -150)
            create a new bound with id "%{_p}%" between {_boundloc1} and {_boundloc2}
            dkit({_p})
            execute console command "effect clear %{_p}%"
            play sound "entity.firework_rocket.twinkle" with volume 10 and pitch 1 at {_p}'s location for {_p}
            send "{@p} Welcome to your island!" to {_p}
            set {move::%{_p}%} to true
            set {island::%{_p}%} to true
            set {islandloc::%{_p}%} to {_p}'s location
            set {xc::%{_p}%} to x coordinate of {_p}
            set {yc::%{_p}%} to y coordinate of {_p}
            set {zc::%{_p}%} to z coordinate of {_p}   
            set {creatingisland} to false
        else:
            teleport {_p} to spawn of world "newislands"
            loadIsland({_p}, {_i})

I dont understand why the error is there
 
Try the following, because idk how you set the variable {islands}
Code:
set {_x} to x-coordinate of {islands}
set {_y} to y-coordinate of {_p}
set {_z} to x-coordinate of {islands}
set {_world} to world of {_p}
set {_loc} to location({_x}, {_y], {_z}, {_world})
 
Status
Not open for further replies.