Skript of Spleef - I can not find my mistake :c

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

Proting

Member
Feb 11, 2017
10
0
0
21
Hello, I would like to know if anyone can find the error in this script, I looked for it but I did not find it and I turn to you to see if you can find the error that I did not find

code_language.skript:
command /maxplayers <text>:
    permission: admin.spleef
    trigger:
        if arg 1 is set:
            set {maxplayers} to arg 1
            send "maxplayers: %arg 1%"
                
command /setspawn:
    permission: admin.spleef
    trigger:
        set {spawn} to location of player
        send "spawn set"
                
on join:
    player has permission "user.spleef":
        clear player's inventory
        {gamestart} is true:
            make console execute command "/gamemode 3 %player%"
            stop
        teleport player to {spawn}
        make console execute command "/gamemode 0 %player%"
        add 1 to {playersingame}
        add player to {winner}
        set {inwaited.%player%} to true
        broadcast "&a%player% &7has joined (&a%{playersingame}%&7/&a%{maxplayers}%&7)!"
        wait tick
        if {playersingame} = {maxplayers}:
            set {gamestart} to true
            loop all players:
                wait tick
                send "&7The game starts in &a5 &7seconds!" to loop-player
                send "&7The game starts in &a4 &7seconds!" to loop-player
                send "&7The game starts in &a3 &7seconds!" to loop-player
                send "&7The game starts in &a2 &7seconds!" to loop-player
                send "&7The game starts in &a1 &7second!" to loop-player
                set slot 0 of player to diamond shovel of efficiency 5
                set {ingame.%loop-player%} to true
        
on death of player:
    victim has permission "user.spleef":
        {ingame.%victim%} is set:
            subtract 1 from {playersingame}
            subtract victim from {winner}
            delete {ingame.%victim%}
            broadcast "&a%victim% &7fell into thew void (&a%{playersingame}%&7/&a%{maxplayers}%&7)!"
            wait tick
            {playersingame} is 1:
                broadcast "&a%{winner}% &7won the game!"
                make console execute command "/worldreload"
                wait 5 seconds
                loop all players:
                    wait tick
                    kick loop-player due to "&7Re join for the game."
                delete {gamestart}
    
on quit:
    player has permission "user.spleef":
        {ingame.%player%} is set:
            subtract 1 from {playersingame}
            subtract player from {winner}
            delete {ingame.%player%}
            broadcast "&a%player% &7has quit (&a%{playersingame}%&7/&a%{maxplayers}%&7)!"
            wait tick
            {playersingame} is 1:
                broadcast "&a%{winner}% &7won the game!"
                make console execute command "/worldreload"
                wait 5 seconds
                loop all players:
                    wait tick
                    kick loop-player due to "&7Re join for the game."
                delete {gamestart}
        {inwaited.%player%} is set:
            subtract 1 from {playersingame}
            subtract player from {winner}
            delete {ingame.%player%}
            broadcast "&a%player% &7has quit (&a%{playersingame}%&7/&a%{maxplayers}%&7)!"
            wait tick
                
on respawn:
    player has permission "user.spleef":
        make console execute command "/gamemode 3 %player%"
        teleport player to {spawn}
        
on damage:
    attacker has permission "user.spleef"
    cancel event

on break:
    player has permission "user.spleef":
        {inwaited.%player%} is set:
            cancel event
            stop
        cancel event
        set block to air
        {ignore::%location of event-block%} is not set:
            add location of block to {game.broken.blocks::*}
            add type of block to {game.broken.type::*}
            set {ignore::%location of event-block%} to true

command /worldreload:
    permission: admin.spleef
    trigger:
        loop {game.broken.blocks::*}:
            set {_loc} to loop-value
            set block at {_loc} to {game.broken.type::%loop-index%}
        delete {game.broken.blocks::*}
        delete {game.broken.type::*}
        
on hunger level change:
    player has permission "user.spleef"
    cancel event
    
on player pick up:
    player has permission "user.spleef"
    cancel event
    
on drop:
    player has permission "user.spleef"
    cancel event
    
on eat:
    player has permission "user.spleef"
    cancel event
    
on death:
    clear drops
        
on xp spawn:
    cancel event
    
at 18:00:
    set time to 7:00
    
on weather change to rain or thunder:
    cancel event
 
Last edited:
  1. command /maxplayers <text>:
  2. permission: admin.spleef
  3. trigger:
  4. if arg 1 is set:
  5. set {maxplayers} to arg 1
  6. send "maxplayers: %arg 1%"
  7. command /setspawn:
  8. permission: admin.spleef
  9. trigger:
  10. set {spawn} to location of player
  11. send "spawn set"
  12. on join:
  13. player has permission "user.spleef":
  14. clear player's inventory
  15. {gamestart} is true:
  16. make console execute command "/gamemode 3 %player%"
  17. stop
  18. teleport player to {spawn}
  19. make console execute command "/gamemode 0 %player%"
  20. add 1 to {playersingame}
  21. add player to {winner}
  22. set {inwaited.%player%} to true
  23. broadcast "&a%player% &7has joined (&a%{playersingame}%&7/&a%{maxplayers}%&7)!"
  24. wait tick
  25. if {playersingame} = {maxplayers}:
  26. set {gamestart} to true
  27. loop all players:
  28. wait tick
  29. send "&7The game starts in &a5 &7seconds!" to loop-player
  30. send "&7The game starts in &a4 &7seconds!" to loop-player
  31. send "&7The game starts in &a3 &7seconds!" to loop-player
  32. send "&7The game starts in &a2 &7seconds!" to loop-player
  33. send "&7The game starts in &a1 &7second!" to loop-player
  34. set slot 0 of player to diamond shovel of efficiency 5
  35. set {ingame.%loop-player%} to true
  36. on death of player:
  37. victim has permission "user.spleef":
  38. {ingame.%victim%} is set:
  39. subtract 1 from {playersingame}
  40. subtract victim from {winner}
  41. delete {ingame.%victim%}
  42. broadcast "&a%victim% &7fell into thew void (&a%{playersingame}%&7/&a%{maxplayers}%&7)!"
  43. wait tick
  44. {playersingame} is 1:
  45. broadcast "&a%{winner}% &7won the game!"
  46. make console execute command "/worldreload"
  47. wait 5 seconds
  48. loop all players:
  49. wait tick
  50. kick loop-player due to "&7Re join for the game."
  51. delete {gamestart}
  52. on quit:
  53. player has permission "user.spleef":
  54. {ingame.%player%} is set:
  55. subtract 1 from {playersingame}
  56. subtract player from {winner}
  57. delete {ingame.%player%}
  58. broadcast "&a%player% &7has quit (&a%{playersingame}%&7/&a%{maxplayers}%&7)!"
  59. wait tick
  60. {playersingame} is 1:
  61. broadcast "&a%{winner}% &7won the game!"
  62. make console execute command "/worldreload"
  63. wait 5 seconds
  64. loop all players:
  65. wait tick
  66. kick loop-player due to "&7Re join for the game."
  67. delete {gamestart}
  68. {inwaited.%player%} is set:
  69. subtract 1 from {playersingame}
  70. subtract player from {winner}
  71. delete {ingame.%player%}
  72. broadcast "&a%player% &7has quit (&a%{playersingame}%&7/&a%{maxplayers}%&7)!"
  73. wait tick
  74. on respawn:
  75. player has permission "user.spleef":
  76. make console execute command "/gamemode 3 %player%"
  77. teleport player to {spawn}
  78. on damage:
  79. attacker has permission "user.spleef"
  80. cancel event

  81. on break:
  82. player has permission "user.spleef":
  83. {inwaited.%player%} is set:
  84. cancel event
  85. stop
  86. cancel event
  87. set block to air
  88. {ignore::%location of event-block%} is not set:
  89. add location of block to {game.broken.blocks::*}
  90. add type of block to {game.broken.type::*}
  91. set {ignore::%location of event-block%} to true

  92. command /worldreload:
  93. permission: admin.spleef
  94. trigger:
  95. loop {game.broken.blocks::*}:
  96. set {_loc} to loop-value
  97. set block at {_loc} to {game.broken.type::%loop-index%}
  98. delete {game.broken.blocks::*}
  99. delete {game.broken.type::*}
  100. on hunger level change:
  101. player has permission "user.spleef"
  102. cancel event
  103. on player pick up:
  104. player has permission "user.spleef"
  105. cancel event
  106. on drop:
  107. player has permission "user.spleef"
  108. cancel event
  109. on eat:
  110. player has permission "user.spleef"
  111. cancel event
  112. on death:
  113. clear drops
  114. on xp spawn:
  115. cancel event
  116. at 18:00:
  117. set time to 7:00
  118. on weather change to rain or thunder:
  119. cancel event
holy textblock, batman, put that in code format.
use the plus icon here
72c7c4d5af.png

and choose code. Then paste it in.
Will make it much easier to understand
[doublepost=1514956799,1514956400][/doublepost]Also, as mentioned on the duplicate thread, you will need to provide more information on what's not working as well as versions and related infos per the help request format^-^ just makes it easier to help when we can get a grasp at what's going on
 
holy textblock, batman, put that in code format.
use the plus icon here
72c7c4d5af.png

and choose code. Then paste it in.
Will make it much easier to understand
[doublepost=1514956799,1514956400][/doublepost]Also, as mentioned on the duplicate thread, you will need to provide more information on what's not working as well as versions and related infos per the help request format^-^ just makes it easier to help when we can get a grasp at what's going on
how to delete the post? sorry :c
 
Cuz youre using {maxplayers} as text.

Change <text> into <integer> or just
code_language.skript:
set {maxplayers} to arg 1 parsed as integer
 
Status
Not open for further replies.