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.

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

Discussion in 'Skript' started by Proting, Jan 3, 2018.

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

    Proting Member

    Joined:
    Feb 11, 2017
    Messages:
    10
    Likes Received:
    0
    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 (Skript):
    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.                
    8. command /setspawn:
    9.     permission: admin.spleef
    10.     trigger:
    11.         set {spawn} to location of player
    12.         send "spawn set"
    13.                
    14. on join:
    15.     player has permission "user.spleef":
    16.         clear player's inventory
    17.         {gamestart} is true:
    18.             make console execute command "/gamemode 3 %player%"
    19.             stop
    20.         teleport player to {spawn}
    21.         make console execute command "/gamemode 0 %player%"
    22.         add 1 to {playersingame}
    23.         add player to {winner}
    24.         set {inwaited.%player%} to true
    25.         broadcast "&a%player% &7has joined (&a%{playersingame}%&7/&a%{maxplayers}%&7)!"
    26.         wait tick
    27.         if {playersingame} = {maxplayers}:
    28.             set {gamestart} to true
    29.             loop all players:
    30.                 wait tick
    31.                 send "&7The game starts in &a5 &7seconds!" to loop-player
    32.                 send "&7The game starts in &a4 &7seconds!" to loop-player
    33.                 send "&7The game starts in &a3 &7seconds!" to loop-player
    34.                 send "&7The game starts in &a2 &7seconds!" to loop-player
    35.                 send "&7The game starts in &a1 &7second!" to loop-player
    36.                 set slot 0 of player to diamond shovel of efficiency 5
    37.                 set {ingame.%loop-player%} to true
    38.        
    39. on death of player:
    40.     victim has permission "user.spleef":
    41.         {ingame.%victim%} is set:
    42.             subtract 1 from {playersingame}
    43.             subtract victim from {winner}
    44.             delete {ingame.%victim%}
    45.             broadcast "&a%victim% &7fell into thew void (&a%{playersingame}%&7/&a%{maxplayers}%&7)!"
    46.             wait tick
    47.             {playersingame} is 1:
    48.                 broadcast "&a%{winner}% &7won the game!"
    49.                 make console execute command "/worldreload"
    50.                 wait 5 seconds
    51.                 loop all players:
    52.                     wait tick
    53.                     kick loop-player due to "&7Re join for the game."
    54.                 delete {gamestart}
    55.    
    56. on quit:
    57.     player has permission "user.spleef":
    58.         {ingame.%player%} is set:
    59.             subtract 1 from {playersingame}
    60.             subtract player from {winner}
    61.             delete {ingame.%player%}
    62.             broadcast "&a%player% &7has quit (&a%{playersingame}%&7/&a%{maxplayers}%&7)!"
    63.             wait tick
    64.             {playersingame} is 1:
    65.                 broadcast "&a%{winner}% &7won the game!"
    66.                 make console execute command "/worldreload"
    67.                 wait 5 seconds
    68.                 loop all players:
    69.                     wait tick
    70.                     kick loop-player due to "&7Re join for the game."
    71.                 delete {gamestart}
    72.         {inwaited.%player%} is set:
    73.             subtract 1 from {playersingame}
    74.             subtract player from {winner}
    75.             delete {ingame.%player%}
    76.             broadcast "&a%player% &7has quit (&a%{playersingame}%&7/&a%{maxplayers}%&7)!"
    77.             wait tick
    78.                
    79. on respawn:
    80.     player has permission "user.spleef":
    81.         make console execute command "/gamemode 3 %player%"
    82.         teleport player to {spawn}
    83.        
    84. on damage:
    85.     attacker has permission "user.spleef"
    86.     cancel event
    87.  
    88. on break:
    89.     player has permission "user.spleef":
    90.         {inwaited.%player%} is set:
    91.             cancel event
    92.             stop
    93.         cancel event
    94.         set block to air
    95.         {ignore::%location of event-block%} is not set:
    96.             add location of block to {game.broken.blocks::*}
    97.             add type of block to {game.broken.type::*}
    98.             set {ignore::%location of event-block%} to true
    99.  
    100. command /worldreload:
    101.     permission: admin.spleef
    102.     trigger:
    103.         loop {game.broken.blocks::*}:
    104.             set {_loc} to loop-value
    105.             set block at {_loc} to {game.broken.type::%loop-index%}
    106.         delete {game.broken.blocks::*}
    107.         delete {game.broken.type::*}
    108.        
    109. on hunger level change:
    110.     player has permission "user.spleef"
    111.     cancel event
    112.    
    113. on player pick up:
    114.     player has permission "user.spleef"
    115.     cancel event
    116.    
    117. on drop:
    118.     player has permission "user.spleef"
    119.     cancel event
    120.    
    121. on eat:
    122.     player has permission "user.spleef"
    123.     cancel event
    124.    
    125. on death:
    126.     clear drops
    127.        
    128. on xp spawn:
    129.     cancel event
    130.    
    131. at 18:00:
    132.     set time to 7:00
    133.    
    134. on weather change to rain or thunder:
    135.     cancel event
    136.    
    137.    
    138.    
     
    #1 Proting, Jan 3, 2018
    Last edited: Jan 3, 2018
  2. Wynnevir

    Wynnevir Well-Known Member

    Joined:
    Jul 9, 2017
    Messages:
    1,015
    Likes Received:
    62
    holy textblock, batman, put that in code format.
    use the plus icon here
    [​IMG]
    and choose code. Then paste it in.
    Will make it much easier to understand
    --- Double Post Merged, Jan 3, 2018, Original Post Date: Jan 3, 2018 ---
    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
     
  3. Proting

    Proting Member

    Joined:
    Feb 11, 2017
    Messages:
    10
    Likes Received:
    0
    how to delete the post? sorry :c
     
  4. ChisleLP

    ChisleLP Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    789
    Likes Received:
    60
    Btw do you can tell us the errors? OR what doesn't work correctly?
     
  5. Proting

    Proting Member

    Joined:
    Feb 11, 2017
    Messages:
    10
    Likes Received:
    0
    sure, "if {playersingame} = {maxplayers}:" it does not work: c
     
  6. ChisleLP

    ChisleLP Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    789
    Likes Received:
    60
    Cuz youre using {maxplayers} as text.

    Change <text> into <integer> or just
    Code (Skript):
    1. set {maxplayers} to arg 1 parsed as integer
     
  7. Proting

    Proting Member

    Joined:
    Feb 11, 2017
    Messages:
    10
    Likes Received:
    0
    Thank you, I'll test it :emoji_grinning:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...