| --[[ Example script that can run untrusted. The following variables are available to lua scripts. All of these variables are exact copies of their Java classes from Spigot: - player - The player that broke the luckyblock. Documentation: https://hub.spigotmc.org/javadoc ... /entity/Player.html - loc - The location of the broken luckyblock. Documentation: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Location.html - world - The world the luckyblock was broken in. Documentation: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/World.html - scheduler - The bukkit scheduler which can be used to, for example, delay tasks: https://hub.spigotmc.org/javadoc ... BukkitRunnable.html - All material enum values are available as global variables, prefixed with MATERIAL_. (For example, you can use MATERIAL_IRON_BOOTS to use the IRON_BOOTS Material). Materials: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html - All effect enum values are available as global variables, prefixed with EFFECT_. Usage is the same as the material values. Effects: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Effect.html - All sound enum values are available as global variables, prefixed with SOUND_. Usage is the same as the material values. Sounds: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html - All enchantment values are available as global variables, prefixed with ENCHANTMENT_. Usage is the same as the material values. Enchantments: https://hub.spigotmc.org/javadoc ... ts/Enchantment.html SuperLuckyBlock also provides a utils class, which allows you to do the following things: - utils:createItemStack(material, amount) - Allows you to create a new ItemStack. Docs: https://hub.spigotmc.org/javadoc ... tory/ItemStack.html - utils:colorText(text) - Converts values like &3 to their respective colors. - utils:createEnchantment(name) - Creates an Enchantment object with the specified enchantment. Enchantments: https://hub.spigotmc.org/javadoc ... ts/Enchantment.html Methods on these variables can be called in 2 ways: - player:setFireTicks(100) - player.setFireTicks(player, 100) As you can see, calling a method with a dot requires you to pass the variable(in this case player) alongside the other arguments. You don't have to do that when using the semicolon. If you are missing access to any classes/methods, feel free to contact me and I will look into adding support for it. ]] local name = player:getName() if string.find(name, "i") ~= nil then local itemStack = utils:createItemStack(MATERIAL_DIAMOND_SWORD, 1) local itemMeta = itemStack:getItemMeta() itemMeta:setDisplayName(utils:colorText("&2&lSome &3&lRandom &4&lSword")) itemMeta:addEnchant(utils:createEnchantment("KNOCKBACK"), math.random(1, 10), true) itemStack:setItemMeta(itemMeta) world:dropItemNaturally(loc, itemStack) else local fireTicks = math.random(100, 500) player:setFireTicks(fireTicks) player:chat("I'm on fire for " .. fireTicks .. " ticks!") end |