Solved skript-mirror Bedwars Plugin

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

AKRODOGY

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

Now the problem
code_language.skript:
on "com.andrei1058.bedwars.api.GeneratorUpgradeEvent":
    send "&e»» &fThe generator give you some money!" to player
   
on "com.andrei1058.bedwars.api.GameStateChangeEvent":
    send "&e»» &fCoins to you!" to player

And when i restart it
code_language.skript:
[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')
[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
 
I use skript-mirror and Bedwars1058 And Skript dev36
code_language.skript:
on "org.bukkit.event.entity.PlayerDeathEvent":
    send "&e»» &fYou are now a killer" to event.getEntity()
But i don't give the message on kill

Now the problem
code_language.skript:
on "com.andrei1058.bedwars.api.GeneratorUpgradeEvent":
    send "&e»» &fThe generator give you some money!" to player
  
on "com.andrei1058.bedwars.api.GameStateChangeEvent":
    send "&e»» &fCoins to you!" to player

And when i restart it
code_language.skript:
[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')
[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
Try using event.getPlayer() instead of player. (idk I've seen it multiple times on here)
 
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.
 
https://github.com/andrei1058/BedWa...ei1058/bedwars/api/GeneratorUpgradeEvent.java
https://github.com/andrei1058/BedWa...rei1058/bedwars/api/GameStateChangeEvent.java

There are no (event-)players in these events

you will have to set a {_player} variable manually and then
code_language.skript:
send "Coins to you" to {_player}

or
code_language.skript:
send "Coins to you" to all players

and for the first one:
code_language.skript:
on "org.bukkit.event.entity.PlayerDeathEvent":
    send "&e»» &fYou are now a killer" to event.getEntity()
use skript's event:
code_language.skript:
on death of player:
    attacker = player
    send "You're now a killer" to attacker
 
Status
Not open for further replies.