Keyall Help

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

    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!

Oct 29, 2023
34
2
8
So I got this Keyall skript from an friend but it has many errors in the skript can somebody fix it?

The errors:
[12:47:54 INFO]: Line 1: (RCKeyall.sk)
[12:47:54 INFO]: invalid line - all code has to be put into triggers
[12:47:54 INFO]: Line: variable {_timeRemaining} is "0m 0s"
[12:47:54 INFO]:
[12:47:54 INFO]: Line 3: (RCKeyall.sk)
[12:47:54 INFO]: Server start/stop events are actually called when Skript is started or stopped. It is thus recommended to use 'on Skript start/stop' instead.
[12:47:54 INFO]: Line: on server start:
[12:47:54 INFO]:
[12:47:54 INFO]: Line 10: (RCKeyall.sk)
[12:47:54 INFO]: Can't understand this expression: '{_keyallTime} % 60'
[12:47:54 INFO]: Line: set {_seconds} to {_keyallTime} % 60
[12:47:54 INFO]:
[12:47:54 INFO]: Line 11: (RCKeyall.sk)
[12:47:54 INFO]: Can't understand this expression: {_minutes}m
[12:47:54 INFO]: Line: set {_formattedTime} to "%{_minutes}m %{_seconds}s"
[12:47:54 INFO]:
[12:47:54 INFO]: Line 24: (RCKeyall.sk)
[12:47:54 INFO]: Can't understand this expression: '{_keyallTime} % 60'
[12:47:54 INFO]: Line: set {_seconds} to {_keyallTime} % 60
[12:47:54 INFO]:
[12:47:54 INFO]: Line 25: (RCKeyall.sk)
[12:47:54 INFO]: Can't understand this expression: {_minutes}m
[12:47:54 INFO]: Line: set {_formattedTime} to "%{_minutes}m %{_seconds}s"
[12:47:54 INFO]:
[12:47:54 INFO]: Line 30: (RCKeyall.sk)
[12:47:54 INFO]: Can't understand this event: 'on server tick'
[12:47:54 INFO]: Line: on server tick:
[12:47:54 INFO]:
[12:47:54 INFO]: Line 36: (RCKeyall.sk)
[12:47:54 INFO]: Can't understand this section: message "keyall"
[12:47:54 INFO]: Line: message "keyall":
[12:47:54 INFO]:
[12:47:54 INFO]: [Skript] Encountered 7 errors while reloading RCKeyall.sk! (34ms)


I cant attach files somehow so i send the skript here

variable {_timeRemaining} is "0m 0s"

on server start:
set {_keyallTime} to 2700 # 45 minutes in seconds

loop 2700 times:
wait 1 minute
set {_keyallTime} to {_keyallTime} - 60
set {_minutes} to {_keyallTime} / 60
set {_seconds} to {_keyallTime} % 60
set {_formattedTime} to "%{_minutes}m %{_seconds}s"
set {_timeRemaining} to {_formattedTime}

command /update_keyall_time:
permission: keyall.update
permission message: "&cYou don't have permission for this!"
trigger:
set {_keyallTime} to 2700 # 45 minutes in seconds

loop 2700 times:
wait 1 minute
set {_keyallTime} to {_keyallTime} - 60
set {_minutes} to {_keyallTime} / 60
set {_seconds} to {_keyallTime} % 60
set {_formattedTime} to "%{_minutes}m %{_seconds}s"
set {_timeRemaining} to {_formattedTime}

send "Keyall time has been updated."

on server tick:
if {_keyallTime} <= 0:
execute console command "crate key giveall keyall 2"
set {_keyallTime} to 2700 # Reset the timer for the next Keyall event

on chat:
message "keyall":
send "&6[Server] Current Keyall time: %{_timeRemaining}%"
 
I haven't tested it, but it should work.
Code:
variable {_timeRemaining} is "0m 0s"

on skript start:
    set {_keyallTime} to 2700 # 45 minutes in seconds

loop 2700 times:
    wait 1 minute
    set {_keyallTime} to {_keyallTime} - 60
    set {_seconds} to {_keyallTime} modulo 60
    set {_minutes} to {_keyallTime} / 60
    set {_formattedTime} to "%{_minutes}m %{_seconds}s"
    set {_timeRemaining} to {_formattedTime

command /update_keyall_time:
    permission: keyall.update
    permission message: "&cYou don't have permission for this!"
    trigger:
        set {_keyallTime} to 2700 # 45 minutes in seconds

        loop 2700 times:
            wait 1 minute
            set {_keyallTime} to {_keyallTime} - 60
            set {_seconds} to {_keyallTime} modulo 60
            set {_minutes} to {_keyallTime} / 60
            set {_formattedTime} to "%{_minutes}m %{_seconds}s"
            set {_timeRemaining} to {_formattedTime}

        send "Keyall time has been updated."

loop 2700 times:
    wait 1 minute
    if {_keyallTime} <= 0:
        execute console command "crate key giveall keyall 2"
        set {_keyallTime} to 2700 # Reset the timer for the next Keyall event

on chat with "keyall":
    send "&6[Server] Current Keyall time: %{_timeRemaining}%"
 
I haven't tested it, but it should work.
Code:
variable {_timeRemaining} is "0m 0s"

on skript start:
    set {_keyallTime} to 2700 # 45 minutes in seconds

loop 2700 times:
    wait 1 minute
    set {_keyallTime} to {_keyallTime} - 60
    set {_seconds} to {_keyallTime} modulo 60
    set {_minutes} to {_keyallTime} / 60
    set {_formattedTime} to "%{_minutes}m %{_seconds}s"
    set {_timeRemaining} to {_formattedTime

command /update_keyall_time:
    permission: keyall.update
    permission message: "&cYou don't have permission for this!"
    trigger:
        set {_keyallTime} to 2700 # 45 minutes in seconds

        loop 2700 times:
            wait 1 minute
            set {_keyallTime} to {_keyallTime} - 60
            set {_seconds} to {_keyallTime} modulo 60
            set {_minutes} to {_keyallTime} / 60
            set {_formattedTime} to "%{_minutes}m %{_seconds}s"
            set {_timeRemaining} to {_formattedTime}

        send "Keyall time has been updated."

loop 2700 times:
    wait 1 minute
    if {_keyallTime} <= 0:
        execute console command "crate key giveall keyall 2"
        set {_keyallTime} to 2700 # Reset the timer for the next Keyall event

on chat with "keyall":
    send "&6[Server] Current Keyall time: %{_timeRemaining}%"
Thank you so much for the reply but the Skript doesnt work. Im a beginner and here are the Errors.

[16:09:21 INFO]: [Skript] Reloading RCKeyall.sk...
[16:09:21 INFO]: Line 1: (RCKeyall.sk)
[16:09:21 INFO]: invalid line - all code has to be put into triggers
[16:09:21 INFO]: Line: variable {_timeRemaining} is "0m 0s"
[16:09:21 INFO]:
[16:09:21 INFO]: Line 6: (RCKeyall.sk)
[16:09:21 INFO]: Can't understand this event: 'loop 2700 times'
[16:09:21 INFO]: Line: loop 2700 times:
[16:09:21 INFO]:
[16:09:21 INFO]: Line 23: (RCKeyall.sk)
[16:09:21 INFO]: Can't understand this expression: '{_keyallTime} modulo 60'
[16:09:21 INFO]: Line: set {_seconds} to {_keyallTime} modulo 60
[16:09:21 INFO]:
[16:09:21 INFO]: Line 25: (RCKeyall.sk)
[16:09:21 INFO]: Can't understand this expression: {_minutes}m
[16:09:21 INFO]: Line: set {_formattedTime} to "%{_minutes}m %{_seconds}s"
[16:09:21 INFO]:
[16:09:21 INFO]: Line 30: (RCKeyall.sk)
[16:09:21 INFO]: Can't understand this event: 'loop 2700 times'
[16:09:21 INFO]: Line: loop 2700 times:
[16:09:21 INFO]:
[16:09:21 INFO]: Line 36: (RCKeyall.sk)
[16:09:21 INFO]: Can't understand this event: 'on chat with "keyall"'
[16:09:21 INFO]: Line: on chat with "keyall":
[16:09:21 INFO]:
[16:09:21 INFO]: [Skript] Encountered 6 errors while reloading RCKeyall.sk! (31ms)
 
I haven't tested it, but it should work.
Code:
variable {_timeRemaining} is "0m 0s"

on skript start:
    set {_keyallTime} to 2700 # 45 minutes in seconds

loop 2700 times:
    wait 1 minute
    set {_keyallTime} to {_keyallTime} - 60
    set {_seconds} to {_keyallTime} modulo 60
    set {_minutes} to {_keyallTime} / 60
    set {_formattedTime} to "%{_minutes}m %{_seconds}s"
    set {_timeRemaining} to {_formattedTime

command /update_keyall_time:
    permission: keyall.update
    permission message: "&cYou don't have permission for this!"
    trigger:
        set {_keyallTime} to 2700 # 45 minutes in seconds

        loop 2700 times:
            wait 1 minute
            set {_keyallTime} to {_keyallTime} - 60
            set {_seconds} to {_keyallTime} modulo 60
            set {_minutes} to {_keyallTime} / 60
            set {_formattedTime} to "%{_minutes}m %{_seconds}s"
            set {_timeRemaining} to {_formattedTime}

        send "Keyall time has been updated."

loop 2700 times:
    wait 1 minute
    if {_keyallTime} <= 0:
        execute console command "crate key giveall keyall 2"
        set {_keyallTime} to 2700 # Reset the timer for the next Keyall event

on chat with "keyall":
    send "&6[Server] Current Keyall time: %{_timeRemaining}%"
what kinda skript version is that? 1.7.2?