Solved Functions errors :( Help Urgent !

  • 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 comminuty!

    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.

TdogTAG

Member
Jan 26, 2017
2
0
0
24
**** My English is not good ****

Greetings to all of you
I am getting an error . Sorry, there are errors in all of the functions . Give you a few examples .

Example 1

Skript Version : 2.1.2
Plugin List

Plugins Version

PlugMan v2.1.1
ProtocolLib v4.2.0
QuarSk v1.2
RediSK v2.0
SharpSK v1.6.1.3
SharpSKUpdater v1.1
skDragon v0.13.1
Skellett v1.5.8
SkQuery v4.0
skRayFall v1.9.7
Skript v2.1.2
SkStuff v1.6.2
skUtilities v0.8.9
SQLibrary v7.1
TuSKe v1.7.1
TwitterSK v1.0.1
Umbaska v2.0 Beta 4
Vault v1.5.6-b49
Vixio v1.1.0
WildSkript v1.8




sdw.png


code_language.skript:
function leathSet(p: player):
    set helmet of {_p} to leather helmet
    set chestplate of {_p} to leather chestplate
    set leggings of {_p} to leather leggings
    set boots of {_p} to leather boots
  
command /leatherset:
   trigger:
       leathSet(player)
Error

gv.png


Example 2

This time I will show you a ready skript.

** Code **
code_language.skript:
# #!                                   ________________________
# #!                              ___________________________________
#                                               Shelves
#                                         © Made by HiiqhFive™
#                                               v1.0.010
# #!                              ___________________________________
# #!                                   ________________________

options:
    version: 1.0.010
    
    UI_Name: &cShelf
    
    # messages
    shelf_created: &8[&cShelves&8] &cShelf successfully created.
    shelf_created_exists: &8[&cShelves&8] &cShelf already exists. Using saved inventory
    
    shelf_destroyed: &8[&cShelves&8] &cShelf destroyed. Getting items back.
    shelf_destroyed_not_exist: &8[&cShelves&8] &cNo Shelf-inventory exists.
    
    shelf_open_not_yours: &8[&cShelves&8] &cThat's not your shelf.
    shelf_open_not_exist: &8[&cShelves&8] &cNo Shelf-inventory exists.
    
    shelf_save_saved: &8[&cShelves&8] &cShelf-inventory saved.
    shelf_save_not_yours: &8[&cShelves&8] &cThat's not your shelf - restoring previous items.
    shelf_save_not_exist: &8[&cShelves&8] &cNo Shelf-inventory exists.
    
    # using debug messages | IMPORTANT: MESSAGE "shelf_open_not_yours" IS USED INDEPENDANT FROM DEBUG MODE!
    debug_messages: true
    
    
# start functions

function openShelf_Admin(location: location, executor: player) :: text:
    {shelves::%{_location}%::*} is set:
        {_executor} has permission "*":
            open chest with 1 row named "{@UI_Name}" to {_executor}
            wait a tick
            loop {shelves::%{_location}%::*}:
                set {_index} to "%loop-index%" parsed as integer
                set {_value} to "%loop-value%" parsed as item
                set slot {_index} of {_executor}'s current inventory to {_value}
                
function destroyShelf_Admin(location: location, executor: player) :: text:
    {shelves::%{_location}%::*} is set:
        {_executor} has permission "*":
            loop {shelves::%{_location}%::*}:
                set {_item} to "%loop-value%" parsed as item
                add {_item} to {_executor}'s inventory
            delete {shelves::%{_location}%::*}
            delete {shelves::owner::%{_location}%}

function createShelf(location: location, executor: player) :: text:
    {shelves::%{_location}%::*} is not set:
        set {shelves::%{_location}%::*} to true
        loop 9 times:
            set {shelves::%{_location}%::%loop-number - 1%} to 0
        set {shelves::owner::%{_location}%} to {_executor}
        {@debug_messages} = true:
            return "{@shelf_created}"
    else:
        {shelves::owner::%{_location}%} is not {_executor}:
            delete {shelves::%{_location}%::*}
            createShelf({_location}, {_executor})
        {@debug_messages} = true:
            return "{@shelf_created_exists}"
        
    
function destroyShelf(location: location, executor: player) :: text:
    {shelves::%{_location}%::*} is set:
        {shelves::owner::%{_location}%} is {_executor}:
            loop {shelves::%{_location}%::*}:
                set {_item} to "%loop-value%" parsed as item
                add {_item} to {_executor}'s inventory
            delete {shelves::%{_location}%::*}
            delete {shelves::owner::%{_location}%}
            {@debug_messages} = true:
                return "{@shelf_destroyed}"
        else:
            {_executor} has permission "*":
                destroyShelf_Admin({_location}, {_executor})
                stop
            return "0"
    else:
        {@debug_messages} = true:
            return "{@shelf_destroyed_not_exist}"
            
function openShelf(location: location, executor: player) :: text:
    {shelves::%{_location}%::*} is set:
        {shelves::owner::%{_location}%} is {_executor}:
            open chest with 1 row named "{@UI_Name}" to {_executor}
            wait a tick
            loop {shelves::%{_location}%::*}:
                set {_index} to "%loop-index%" parsed as integer
                set {_value} to "%loop-value%" parsed as item
                set slot {_index} of {_executor}'s current inventory to {_value}
                send "%{_index}% -- %{_value}% " to {_executor}
        else:
            return "{@shelf_open_not_yours}"
    else:
        {@debug_messages} = true:
            return "{@shelf_open_not_exist}"
            
function saveShelf(location: location, executor: player) :: text:
    {shelves::%{_location}%::*} is set:
        {shelves::owner::%{_location}%} is {_executor}:
            delete {shelves::%{_location}%::*}
            loop 9 times:
                set {_values.inventory::%loop-number - 1%} to slot loop-number - 1 of {_executor}'s current inventory
                set {shelves::%{_location}%::%loop-number - 1%} to {_values.inventory::%loop-number - 1%}
            delete {shelves::%{_executor}%}
            {@debug_messages} = true:
                return "{@shelf_save_saved}"
        else:
            {@debug_messages} = true:
                return "{@shelf_save_not_yours}"
    else:
        {@debug_messages} = true:
            return "{@shelf_save_not_exist}"   
# end functions

on place of bookshelf:
    set {_result} to createShelf(location of event-block, player)
    {_result} is not "<none>":
        send {_result}
        
on right click on bookshelf:
    set {shelves::%player%} to location of event-block
    set {_result} to openShelf(location of event-block, player)
    {_result} is not "<none>":
        send {_result}
        
on inventory close:
    inventory name of player's current inventory contains "Shelf":
        {shelves::%player%} is set:
            set {_result} to saveShelf({shelves::%player%}, player)
            {_result} is not "<none>":
                send {_result}
                
on break of bookshelf:
    set {_result} to destroyShelf(location of event-block, player)
    {_result} is "0":
        cancel the event
        send "{@shelf_open_not_yours}"
        stop
    {_result} is not "<none>":
        send {_result}
Error

gtb.png


Here are just to show.

I always get errors from the functions . I hope the subject is explanatory .​

**** My English is not good ****

 
ea1y5c

First IMG ERROR


First Error: you have 6 spaces but you need 7 at "leathSet(player)"
Second Error: the same command is existing in the skript "deneme.sk"
 
  • Like
Reactions: TdogTAG
Status
Not open for further replies.