1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Help with warp skrip

Discussion in 'Skript' started by AgentStrawberryYT, Sep 11, 2021.

Thread Status:
Not open for further replies.
  1. AgentStrawberryYT

    AgentStrawberryYT New Member

    Joined:
    Jul 29, 2021
    Messages:
    5
    Likes Received:
    0
    I have a warp skript, and I'm trying to make a way to set an item for a warp, using '/setWarp warpName warpItem'. All of that works, but when I open the GUI no matter what I named the warp, if I named it "OOF" it shows the name as "oof", please help, why is this happening, code:
    Code (Text):
    1. command setwarp <text> [<item>]:
    2.     permission: core.warps.set
    3.     permission message: &cNo perms!
    4.     usage: /setwarp <warpName> [item]
    5.     trigger:
    6.         if arg-2 is set:
    7.             set {warpitems::%colored arg-1%} to arg-2
    8.             send "&bYou set &a%colored arg-1% &bto &a%location of player% &bwith &a%arg-2%"
    9.         else:
    10.             send "&bYou set &a%colored arg-1% &bto &a%location of player%"
    11.         set {warps::%colored arg-1%} to location of block at player
    12.      
    13. command warps:
    14.     permission: core.warps.view
    15.     permission message: &cNo perms!
    16.     trigger:
    17.         openWarps(player)
    18.  
    19. function openWarps(p: player):
    20.     if {warps::*} exists:
    21.         set {_l} to a chest inventory with 5 rows named "&5Server Warps"
    22.     else:
    23.         set {_l} to a chest inventory with 5 rows named "&cServer Warps &8––– &cNone"
    24.     set {_x} to 0
    25.     loop {warps::*}:
    26.         if {warpitems::%colored loop-index%} is set:
    27.             set slot {_x} of {_l} to {warpitems::%colored loop-index%} named "%colored loop-index%"
    28.         else:
    29.             set slot {_x} of {_l} to a oak sign named "%colored loop-index%"
    30.         add 1 to {_x}
    31.     open {_l} to {_p}
    32.  
    33. command clearwarps:
    34.     permission: core.warps.clear
    35.     permission message: &cNo perms!
    36.     trigger:
    37.         delete {warps::*}
    38.         delete {warpitems::*}
    39.         send "&bWarps are deleted"

    Thanks in advance!
    ~ AgentStrawberry
    --- Double Post Merged, Sep 11, 2021, Original Post Date: Sep 11, 2021 ---
    Please help
     
  2. Best Answer:
    Post #2 by Tenfont, Sep 11, 2021
  3. Tenfont

    Tenfont Member

    Joined:
    Mar 28, 2021
    Messages:
    10
    Likes Received:
    2
    The capitalization isn't being preserved in the variable index, try this instead

    Code (Text):
    1. command setwarp <text> [<text>] [<item>]:
    2.     permission: core.warps.set
    3.     permission message: &cNo perms!
    4.     usage: /setwarp <warp> [name] [item]
    5.     trigger:
    6.         set {warp::%arg-1%::location} to location of block at player
    7.         set {warp::%arg-1%::name} to arg-2 ? arg-1
    8.         set {warp::%arg-1%::item} to arg-3 ? oak sign
    9.         send "&bYou set &a%{warp::%arg-1%::name}% &bto &a%{warp::%arg-1%::location}% &bwith &a%{warp::%arg-1%::item}%"
    10.    
    11. command warps:
    12.     permission: core.warps.view
    13.     permission message: &cNo perms!
    14.     trigger:
    15.         openWarps(player)
    16.  
    17. function openWarps(p: player):
    18.     set {_l} to a chest inventory with 5 rows named ("&5Server Warps" if {warp::*} exists, otherwise "&cServer Warps &8––– &cNone")
    19.     set {_x} to 0
    20.     loop indices of {warp::*}:
    21.         set slot {_x} of {_l} to {warp::%loop-value%::item} named {warp::%loop-value%::name}
    22.         add 1 to {_x}
    23.     open {_l} to {_p}
    24.  
    25. command clearwarps:
    26.     permission: core.warps.clear
    27.     permission message: &cNo perms!
    28.     trigger:
    29.         delete {warp::*}
    30.         send "&bWarps are deleted"
     
  4. barrybtw

    barrybtw Active Member

    Joined:
    Jun 8, 2021
    Messages:
    82
    Likes Received:
    6
    Use the string in
    Code (Text):
    1. strict proper case
    Look it up on docs.
     
  5. Tenfont

    Tenfont Member

    Joined:
    Mar 28, 2021
    Messages:
    10
    Likes Received:
    2
    But that's not what he's trying to do?
     
  6. AgentStrawberryYT

    AgentStrawberryYT New Member

    Joined:
    Jul 29, 2021
    Messages:
    5
    Likes Received:
    0
    Im not very good, what does "?" mean?
     
  7. Tenfont

    Tenfont Member

    Joined:
    Mar 28, 2021
    Messages:
    10
    Likes Received:
    2
    object ? object
    if first object is not set, second object is used, otherwise the first one is used
    Same is for: '(object) if (condition), otherwise (object)' which means use the value of first object in case the condition is true, otherwise use second object
     
  8. AgentStrawberryYT

    AgentStrawberryYT New Member

    Joined:
    Jul 29, 2021
    Messages:
    5
    Likes Received:
    0
    thanks, I got it fixed, ill mark this as solved
     
Thread Status:
Not open for further replies.

Share This Page

Loading...