function

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

  1. SoloHandCoder

    Event Supply Drop Not Working!

    I was working on an event and i tried making a supply drop. i wanted it to set a random slot in the chest to something i want but the chest is always empty and it doesnt say anything like that there isnt a chest that loaded or that it finished thanks heres my function : function...
  2. wrymain

    blinking boss bar

    How do i make it NOT blinking? i tried to only set it(no delete) but it wont work. it was originally send action bar but i want to change it since it can't have 2 lines. and if i try to wait 1 second instead of 10 ticks, it'll skip 2 seconds instead of 1. function exptime(p: player): if...
  3. M

    function itemtype doesn't return an item

    Hello so here's a code that worked a few years ago (2022 I think? so for quite old skript version) but which does not work anymore since I updated Skript and a few addons and I cannot find the uptodate syntax/way to do it. These were functions that were supposed to return an item named and with...
  4. L

    Struggle in compare 2 variable as item type

    Can anyone help me? I do this code below which i think these are same result, but when i test it, the function way return wrong value at variable amout of {_block} while the direct way also use the {_block} variable but i return the right value. Only amount of {_block} is wrong, another custom...
  5. erenkara

    Addon SkCheese 1.8-beta

    SkCheese is a Skript addon which adds Skript related syntaxes that will likely not make it to official Skript. | Source Code | Syntax Wiki | Documentation | Support | This addon was made and tested in Skript 2.14. It may work on other versions but it is not guranteed. No support...
  6. I

    killed entity reward, have code, need to convert to a function

    have this code that I made by myself but I don't want to repeat so many lines for each type of entity, tried to transform the code into a function but... I suffer from serious skill issue. Can someone give me sample code from this? I need to have as "variables" the random amount of money ex...
  7. M

    Looping and making Gui slot with a function

    Hello there so i am trying to create a loop that create gui slots with different functions. But it cannot put the right information into the function part. format slot {_i} of player with skull of {_name} named "&r" with lore "%{_name}%&7&m-" to close then run [kauctiontest(player...
  8. V

    Functions are not working...

    Error: "test(P: player) is not a text" code: function depositAll(P: player): set {bank::%{_P}%} to {bank::%{_P}%} + {_P}'s balance set {_P}'s balance to 0 function depositHalf(P: player): set {_b} to {_P}'s balance / 2 set {bank::%{_P}%} to {bank::%{_P}%} + {_b} set {_P}'s...
  9. I

    Solved how to use Function(%player%)

    I want to make a confirmation skript an i want it to be in a function so it needs to have the player on inventory click: if event-inventory = (metadata tag "Rank" of player): if index of event-slot is 0: set {rank.%player%} to "default" confirm(%player%) if event-inventory =...
  10. sluhtie

    Most performant way to save data

    Hey, so I'm trying out for a while now what would be the most performant and efficient way to save player data. I came up with 4 different ways to do so. But now I wanted to ask what you guys think is the best way to do that. I sorted them from most performant to most unperformant. Method 1 -...
  11. M

    Script Outline GUI 1.1.0

    This script is a simple function. All you need to do in order to use this function is create a GUI, then format it as you like, and use this function to format the edges. Here is a simple example of how you could use this. command /outlinegui: permission: op trigger: set {_gui}...
  12. K

    Functions and communicating with the console

    Script Version: 2.6-beta3 Script Author: KiwiFruit555 (Me) Minecraft Version: 1.17.1 (Paper) The issue is that I need to send a message to the console if the one sending it was the console. There are no errors in the code, it just doesn't work. It stopped working when I tried to implement...
  13. B

    Solved Enchanted Book Stored Enchants

    set {_pord} to 70 set {_item} to player's tool set {_meta} to {_item}.getItemMeta() set {_ench} to {_meta}.getStoredEnchants() if {_ench} = `{Enchantment[minecraft:efficiency, DIG_SPEED]=1}`: (this is a snippet of my full script) Is there an...
  14. G

    Skript value going into minus

    Hey! Im really bad at explaining but its supposed to when i mine it just adds 1 experience and when i mine it just works and updates the xp but when i go after 127 it goes into minus (-127) and then counting like -126 -125 -124 and this keeps happening. Can someone help? Heres my full code...
  15. ClaasCode

    Solved UnparsedLiterals must be converted before us

    Hello, i get the Error from the title my Code: on break: if event-block is a gold block: addCoins(player, "Test", 5) function addCoins(name: player, message: text, amount: number = 1): set {_uuid} to uuid of {_name} send "%{_uuid}%" to console
  16. J

    Function to Mob Spawn depending on Room teleport

    So I wanna make it so custom mobs spawn in set locations depending on the room the players enter. For example if player Steve gets teleported to room 1, mobs spawn at locations A & B of the room 1. then Steve moves to room 2, mobs spawn at locations A & B of room 2. The thing is room teleport...
  17. J

    Solved Kitpvp gui help

    Hello! I'm a returning skript veteran, and I need a little help getting my head around function guis. Could someone give me an example or extract of a kitpvp gui, with functions. E.g format slot 10 of player with stone sword to run function (warrior, p:player) function(warrior): give 1 of...
  18. L

    Function on clicked slot

    How do i make that function remember the clicked item/slot? command /shop-halloween-299 <text>: trigger: if arg 1 is "enchanter": open virtual chest inventory with size 5 named "&aHey" to player on inventory click: if name of player's current inventory is "&aHey"...
  19. jeelzzz

    Solved Functions in GUIs using TuSKE

    I'm trying to make a shop gui, but it does not load the item in the gui because it does not return a value. My gui code: command /h: trigger: open virtual chest inventory with 6 rows named "&bShop" to player format gui slot 22 of player with steak named "&6Steak" with lore...
  20. T

    formated number function request

    Category: Function Suggested name: format.sk Spigot/Skript Version: 1.12.2 What I want: What I need is a function to format number (1k, 1m, 1b...) Ideas for commands: none Ideas for permissions: none When I'd like it by: A couple days