functions

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

  1. C

    Solved Need help with functions

    How do I delete a thread? I fixed what was here by myself but I don't know how to remove it
  2. 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...
  3. F

    Pass player entity via function and open chest

    Hello.. How to pass `player` entity via function and called under `open chest`? This works fine: ``` command /testButton: trigger: foo(player) function foo(player: player): send "FOO" to {_player} bar({_player}) function bar(player: player): send "BAR" to {_player}...
  4. M

    Solved function input

    function plays(p: player): send "test" to {_p} and i use plays(player) in trigger and i have that problem [21:52:53] [Server thread/ERROR]: ºcºlLine 77:º7 (songsplayer.sk) ºc There's no player/console in a function event º6 Line: º7send "chuj w dupe tw¾rc? tego g¾wna" to the {_p} can...
  5. K

    Solved Need Help Functions

    so I am looking at some forums about functions and I think I wanna learn how to do it. the first thing I know about it is that ik that a function allows you to make quick variables that do a action when used. I think the code to the start is like this Function money(money: number) :: number...
  6. A

    Solved Functions

    function provaFunzione(p: player , s: slot , i: item): if inventory name of current inventory of {_p} is {@inv-name}: if name of {_i} is "{@slot1}": if slot {_s} of {_p} is not air: if {_p} have diamond pickaxe: cancel event...
  7. SoPastel

    Function is not a text

    Skript Version: 2.6 Server Version: 1.8 When I try to load this skript it gives me the error: 'gui(p: player) is not a text' and I am not sure why. Code: function gui(p: player): wait 1 tick open chest with 3 rows named "&d&lTest Gui" to {_p}
  8. A

    Solved Functions not working properly

    When I start the code it gives an error. It says that I gave 3 arguments for registerCompressor when it expected 4 on both functions. # registerCompressor(id, item, uncompressed, compressed) function registerCompressor(id: number, item: item, uncompressed: item, compressed: item): set...
  9. 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...
  10. S

    Solved How do you create a function that gives all players the input parameter?

    So, I'm trying to create a server that gives you a random block out of some blocks every 10 seconds. Here is my code: on join: execute console command "/mvtp %player% game" function all(obj: item): loop all players: give loop-player 1 {_obj} every 10 seconds: set {_g} to true...
  11. WrexBG

    Vanilla GUI Border+ Functions

    These are functions you may find useful when working with GUI's. It's just an easy way to add border, border with preset pattern, and fill or clear the inventory. Some things to know beforehand: - These are functions - Required addons: none - Tested on Minecraft 1.15.2 and Skript 2.4.1 - There...
  12. 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...
  13. Richard_Trol

    Solved functions dosen't work

    Hi, I started with Skript weeks ago and wanted to learn how to script with function. I watched many tutorials and when I tried it myselv, it dosent worked and said: LeatherSet(p: player) is not a text! I tried it with this code: function LeatherSet(p: player): set helmet of {_p} to leather...
  14. J

    Solved Function Help

    I have tried to use functions for the first time, by making an economy skript, but it does not work. Whenever I try to type my /money command then proceed by typing /bal, my balance is <none> and I also don't get the message that is supposed to send in the addMoney function. options...
  15. F

    Solved Why doesn't work why function?

    This is my function: function Scoreboard(): wipe player's sidebar set name of sidebar of player to " &e•&6● &3&lGungame " set score " " in sidebar of player to 11 set score "&3•&b● &f&lKills:" in sidebar of player to 10 set score "&e➜ &a&l%{stats::%player's...
  16. Vane2k16

    function with options?

    Hello, i need help with a function for a signupdate. this is the function for the signupdate: function signupdate(a: text): set line 1 of block at {knockout.sign::%{_a}%} to "- KNOCKOUT -" set line 2 of block at {knockout.sign::%{_a}%} to "[&aONLINE&r]" set line 4 of block at...
  17. couger44

    Solved Save the Local Variable of the function

    Is there a way this works? function worldexpNivelDelJugador(p: player, variable: string): if {worldexp.nivel.%{_p}%} is between 1 and 4: set {_%{_variable}%} to "&8[%{worldexp.nivel.%{_p}%}%] %coloured {_p}'s prefix%%{nombre.%{_p}%}%%coloured {_p}'s suffix%" else if...
  18. K

    Solved Not popping up in the gui!

    Problem: So this is suposed to pop up in a gui with item. But the item dont show and the gui is empty. I can't see the mistake and when i reload, there is no errors! The skript: https://hastebin.com/nozesuyiqa.rb Skript Version: 2.2 - dev23 Skript Author: Bensku Minecraft Version: 1.8...
  19. Rezz

    Rezz's Snippets - Things you can do in pure Skript 2.2

    Snippets: A replacement for 'contains' UPPERCASE, lowercase, and Capitalization conversions Replace only the first or last occurrence of text Types! Get a variable's type Snippet #1: A replacement for 'contains' function contains(list: objects, check: object) :: boolean: loop {_list::*}...
  20. TdogTAG

    Solved Functions errors :( Help Urgent !

    **** My English is not good **** Greetings to all of you I am getting an error . Sorry, there are errors in all of the functions . Give you a few examples . Example 1 Skript Version : 2.1.2 Plugin List Plugins Version PlugMan v2.1.1 ProtocolLib v4.2.0 QuarSk v1.2 RediSK v2.0 SharpSK...