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.

Solved skript-mirror Bedwars Plugin

Discussion in 'Skript' started by AKRODOGY, Aug 12, 2018.

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

    AKRODOGY Active Member

    Joined:
    Mar 20, 2018
    Messages:
    52
    Likes Received:
    2
    I use skript-mirror and Bedwars1058 And Skript dev36
    Code (Skript):
    1. on "org.bukkit.event.entity.PlayerDeathEvent":
    2.     send "&e»» &fYou are now a killer" to event.getEntity()
    But i don't give the message on kill

    Now the problem
    Code (Skript):
    1. on "com.andrei1058.bedwars.api.GeneratorUpgradeEvent":
    2.     send "&e»» &fThe generator give you some money!" to player
    3.    
    4. on "com.andrei1058.bedwars.api.GameStateChangeEvent":
    5.     send "&e»» &fCoins to you!" to player
    And when i restart it
    Code (Skript):
    1. [16:17:02 ERROR]: There's no player in an on bukkit event event (BedWarsAPI.sk, line 8: send "&e╗╗ &fThe generator give you some money!" to player')
    2. [16:17:02 ERROR]: There's no player in an on bukkit event event (BedWarsAPI.sk, line 11: send "&e╗╗ &fCoins to you!" to player')
    This can help you: https://github.com/andrei1058/BedWars1058/wiki/Developer

    @Donut You are the best

     
  2. Best Answer:
    Post #5 by jaylawl, Aug 12, 2018
  3. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,500
    Likes Received:
    107
    Medals:
    Try using event.getPlayer() instead of player. (idk I've seen it multiple times on here)
     
  4. AKRODOGY

    AKRODOGY Active Member

    Joined:
    Mar 20, 2018
    Messages:
    52
    Likes Received:
    2
  5. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,500
    Likes Received:
    107
    Medals:
    I think it's because they don't need to have a player bound to them at all. The upgrade event can be called by the plugin itself and I have no idea what the GameStateChangeEvent is, but as it's probably something with the state of the game I don't think it involves any player.
     
  6. jaylawl

    jaylawl Active Member

    Joined:
    Jan 29, 2017
    Messages:
    173
    Likes Received:
    31
    https://github.com/andrei1058/BedWars1058/blob/master/com/andrei1058/bedwars/api/GeneratorUpgradeEvent.java
    https://github.com/andrei1058/BedWars1058/blob/master/com/andrei1058/bedwars/api/GameStateChangeEvent.java

    There are no (event-)players in these events

    you will have to set a {_player} variable manually and then
    Code (Skript):
    1. send "Coins to you" to {_player}
    or
    Code (Skript):
    1. send "Coins to you" to all players
    and for the first one:
    Code (Skript):
    1. on "org.bukkit.event.entity.PlayerDeathEvent":
    2.     send "&e»» &fYou are now a killer" to event.getEntity()
    use skript's event:
    Code (Skript):
    1. on death of player:
    2.     attacker = player
    3.     send "You're now a killer" to attacker
     
  7. AKRODOGY

    AKRODOGY Active Member

    Joined:
    Mar 20, 2018
    Messages:
    52
    Likes Received:
    2
    Ok thanks!
     
    • Like Like x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...