Event win skript

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

Kolombooo

Active Member
Dec 3, 2020
51
3
8
Hi,
i need to setup Event/competention skript. I need command /eventstart <Event type> <Win>, /eventend <Winner>. I need to automaticly give the Essentials eco Win to the winner. My code looks like this (variable vyhra is the win variable)
Code:
variables:
  {vyhra} = 0

command /event:
  aliases: /eventy, /eventmain, eventinfo
  permission: simocraft.event.help
  trigger:
    send "&b----------------( &a&lEventy &f&b)----------------" to player
    send "" to player
    send "   &b/eventjoin &f-Pripojit se na event" to player
    send "   &b/eventleave &f-Odpojit se z eventu" to player
    send "   &b/eventstart [Zprava]&f -Zacit a oznamit event" to player
    send "   &b/eventend [Vyherce] &f-Ukoncit event" to player
    send "" to player
    send "   &bTvurce pluginu: &fKolombooo"
    send ""
    send "&b------------------------------------------" to player
   
command /eventjoin:
  permission: simocraft.event.join
  trigger:
    send "&7[&a&lSimoCraft&7]&f Pripojuji na event..."
    wait 20 ticks  
    make player execute command "/warp event"
    send "&7[&a&lSimoCraft&7]&f Vítej na eventu"
    broadcast "&7[&a&lSimoCraft&7]&f %player% se pripojil na event"
   
command /eventleave:
  permission: simocraft.event.leave
  trigger:
    make player execute command "/spawn"
    send "&7[&a&lSimoCraft&7]&f Odpojil si se z eventu"
    broadcast "&7[&a&lSimoCraft&7]&f %player% se odpojil z eventu"
   
command /eventstart <text> <text>:
  permission: simocraft.event.start
  trigger:
    make player execute command "/setwarp event"
    broadcast "&7[&a&lSimoCraft&7] &3&lEvent! &f%colored arg-1% &a- &f/eventjoin - &9&lVyhra: &a%arg-2% &fmoney"
    set {_vyhra} to %arg-2%
   
command /eventend <text>:
  description: "&3Pouziti: &f/eventend <vitez>"
  permission: simocraft.event.end
  trigger:
    broadcast "&7[&a&lSimoCraft&7] &3Event ukoncen! &fWinner: &a%colored arg-1%"
    send "&cNezapomen hrace odmenit vyhrou jakou si uvedl :) &a/eco give %arg-1% <Vyhra>" to player
    make player execute command "/delwarp event"
    execute console command "/eco give %arg-1% {vyhra}"
 
Here's your code:
Code:
variables:
    {vyhra} = 0

command /event:
    aliases: /eventy, /eventmain, eventinfo
    permission: simocraft.event.help
    trigger:
        send "&b----------------( &a&lEventy &f&b)----------------" to player
        send "" to player
        send "   &b/eventjoin &f-Pripojit se na event" to player
        send "   &b/eventleave &f-Odpojit se z eventu" to player
        send "   &b/eventstart [Zprava]&f -Zacit a oznamit event" to player
        send "   &b/eventend [Vyherce] &f-Ukoncit event" to player
        send "" to player
        send "   &bTvurce pluginu: &fKolombooo"
        send ""
        send "&b------------------------------------------" to player

command /eventjoin:
    permission: simocraft.event.join
    trigger:
        send "&7[&a&lSimoCraft&7]&f Pripojuji na event..."
        wait 20 ticks
        make player execute command "/warp event"
        send "&7[&a&lSimoCraft&7]&f Vítej na eventu"
        broadcast "&7[&a&lSimoCraft&7]&f %player% se pripojil na event"

command /eventleave:
    permission: simocraft.event.leave
    trigger:
        make player execute command "/spawn"
        send "&7[&a&lSimoCraft&7]&f Odpojil si se z eventu"
        broadcast "&7[&a&lSimoCraft&7]&f %player% se odpojil z eventu"

command /eventstart <text> <number>:
    permission: simocraft.event.start
    trigger:
        make player execute command "/setwarp event"
        broadcast "&7[&a&lSimoCraft&7] &3&lEvent! &f%colored arg-1% &a- &f/eventjoin - &9&lVyhra: &a%arg-2% &fmoney"
        set {vyhra} to arg-2

command /eventend <player>:
    description: "&3Pouziti: &f/eventend <vitez>"
    permission: simocraft.event.end
    trigger:
        add {vyhra} to balance of arg-1
        broadcast "&7[&a&lSimoCraft&7] &3Event ukoncen! &fWinner: &a%displayname of arg-1%"
        send "&7[&a&lSimoCraft&7] &fHracovi bylo pripsano &e%{vyhra}% &fmoney" to player
        make player execute command "/delwarp event"

1. Always define type of each argument (you have defined all your parameters as text)
2. You've declared your global variable `{vyhra}`, but you assigned value to local variable `{_vyhra}`
 
Last edited:
Status
Not open for further replies.