Solved Skript - Home

  • 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.

MAKCVL

New Member
Aug 9, 2019
5
0
0
24
Hi,
I started learning with Skript, I'm interested in. If in going to create multiple home skript. If yes how ?
Thank you.
 
Ahh
Code:
command /sethome [<text>]:
    trigger:
        if player has permission "home.set":
            if arg-1 is set:
                set {home::%player%::%arg 1%} to location of player
                message "Home set!" to player
            else:
                message "Type /sethome <name of home>
        else:
            message "You dont have permission" to player
command /home [<text>]:
    trigger:
        if arg-1 is set:
            if {home::%player%::%arg 1%} is set:
                teleport player to
 
Thank You.
Can be done, so that the player could create 3 homes and VIP 6 homes ?
 
code_language.skript:
options:
  PREFIX: &c[ M.A.L.I.A ]
  ERROR-MSG: &cError while trying to execute the comand!

on join:
  if player has permissions "home.vip":
    set {HOMES::%player%::MAX} to 6
    if file "plugins/Malia/core/home/%player%.yml" doesn't exist:
      create file "plugins/Malia/core/home/%player%.yml"
      set {HOMES::%player%::CURRENT} to 0
      set yml value "homes" of "plugins/Malia/core/home/%player%.yml" to 0
    else:
      set {HOMES::%player%::CURRENT} to yml value "homes" of file "plugins/Malia/core/home/%player%.yml"
  else:
    set {HOMES::%player%::MAX} to 3

command /sethome [<text>]:
  trigger:
    if player has permission "home.set":
      if arg-1 is set:
        if {HOMES::%player%::MAX} is 3:
          if {HOMES::%player%::CURRENT} is not greater than 3:
            add 1 to {HOMES::%player%::CURRENT}
            stop
          else:
            send "%{@PREFIX}% %{@ERROR-MSG}% &7( Max home sets reached (&a%{HOMES::%player%::MAX}%&7) buy &aV.I.P &7to have up to &a6 &7home sets! )" to player
            stop
        else if {HOMES::%player%::MAX} is 6:
          if {HOMES::%player%::CURRENT} is not greater than 6:
            add 1 to {HOMES::%player%::CURRENT}
            stop
          else:
            send "%{@PREFIX}% %{@ERROR-MSG}% &7( Max home sets reached (&a%{HOMES::%player%::MAX}%&7) )" to player
            stop
        set {HOMES::%player%::%arg 1%} to location of player
        send "%{@PREFIX}% Home set! &a%{HOME::%player%::%arg 1%}% ( %arg-1% )" to player
      else:
        send "%{@PREFIX}% %{@ERROR-MSG}% &7( Usage: /sethome <text> )"
    else:
      message "%{@PREFIX}% %{@ERROR-MSG}% &7( Permission denied )" to player

command /home [<text>]:
    trigger:
        if arg-1 is set:
            if {HOMES::%player%::%arg 1%} is set:
                teleport player to {HOMES::%player%::%arg 1%}
                send "%{@PREFIX}% Teleported you to &7%{HOMES::%player%::%arg 1%}%"

This should work, it's mostly pseudo code but should be good to go!

Thank you!

But I have a problem with errors. Can you help me with them ?

code_language.skript:
[17:15:20 ERROR]: can't understand this condition: 'file "plugins/Malia/core/home/%player%.yml" doesn't exist' (Test.sk, line 123: if file "plugins/Malia/core/home/%player%.yml" doesn't exist:') 
[17:15:20 ERROR]: 'else' has to be placed just after an 'if' or 'else if' section (Test.sk, line 127: else:')
[17:15:20 ERROR]: Can't understand this expression: &c[ M.A.L.I.A ] (Test.sk, line 141: send "%{@PREFIX}% %{@ERROR-MSG}% &7( Max home sets reached (&a%{HOMES::%player%::MAX}%&7) buy &aV.I.P &7to have up to &a6 &7home sets! )" to player')
[17:15:20 ERROR]: Can't understand this expression: &c[ M.A.L.I.A ] (Test.sk, line 148: send "%{@PREFIX}% %{@ERROR-MSG}% &7( Max home sets reached (&a%{HOMES::%player%::MAX}%&7) )" to player')
[17:15:20 ERROR]: Can't understand this expression: &c[ M.A.L.I.A ] (Test.sk, line 151: send "%{@PREFIX}% Home set! &a%{HOME::%player%::%arg 1%}% ( %arg-1% )" to player')
[17:15:20 ERROR]: Can't understand this expression: &c[ M.A.L.I.A ] (Test.sk, line 153: send "%{@PREFIX}% %{@ERROR-MSG}% &7( Usage: /sethome <text> )"')
[17:15:20 ERROR]: Can't understand this expression: &c[ M.A.L.I.A ] (Test.sk, line 155: message "%{@PREFIX}% %{@ERROR-MSG}% &7( Permission denied )" to player')
[17:15:20 ERROR]: Can't understand this expression: &c[ M.A.L.I.A ] (Test.sk, line 162: send "%{@PREFIX}% Teleported you to &7%{HOMES::%player%::%arg 1%}%"')
 
Do you have skQuery installed?

I shouldn't have.
But when I installed it on the server it still displayed errors

code_language.skript:
[17:26:25 ERROR]: Can't understand this condition/effect: create file "plugins/MineTrip/core/home/%player%.yml" (Test.sk, line 124: create file "plugins/MineTrip/core/home/%player%.yml"')
[17:26:25 ERROR]: Can't understand this condition/effect: set yml value "homes" of "plugins/MineTrip/core/home/%player%.yml" to 0 (Test.sk, line 126: set yml value "homes" of "plugins/MineTrip/core/home/%player%.yml" to 0')
[17:26:25 ERROR]: Can't understand this expression: 'yml value "homes" of file "plugins/MineTrip/core/home/%player%.yml"' (Test.sk, line 128: set {HOMES::%player%::CURRENT} to yml value "homes" of file "plugins/MineTrip/core/home/%player%.yml"')
[17:26:25 ERROR]: Can't understand this expression: &c[ M.A.L.I.A ] (Test.sk, line 141: send "%{@PREFIX}% %{@ERROR-MSG}% &7( Max home sets reached (&a%{HOMES::%player%::MAX}%&7) buy &aV.I.P &7to have up to &a6 &7home sets! )" to player')
[17:26:25 ERROR]: Can't understand this expression: &c[ M.A.L.I.A ] (Test.sk, line 148: send "%{@PREFIX}% %{@ERROR-MSG}% &7( Max home sets reached (&a%{HOMES::%player%::MAX}%&7) )" to player')
[17:26:25 ERROR]: Can't understand this expression: &c[ M.A.L.I.A ] (Test.sk, line 151: send "%{@PREFIX}% Home set! &a%{HOME::%player%::%arg 1%}% ( %arg-1% )" to player')
[17:26:25 ERROR]: Can't understand this expression: &c[ M.A.L.I.A ] (Test.sk, line 153: send "%{@PREFIX}% %{@ERROR-MSG}% &7( Usage: /sethome <text> )"')
[17:26:25 ERROR]: Can't understand this expression: &c[ M.A.L.I.A ] (Test.sk, line 155: message "%{@PREFIX}% %{@ERROR-MSG}% &7( Permission denied )" to player')
[17:26:25 ERROR]: Can't understand this expression: &c[ M.A.L.I.A ] (Test.sk, line 162: send "%{@PREFIX}% Teleported you to &7%{HOMES::%player%::%arg 1%}%"')
 
Status
Not open for further replies.