variable

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

    Every syntax with variables

    on load: set {autoCraftTime::default} to 30 set {autoCraftTime::elite-soldier} to 20 set {autoCraftTime::general} to 15 set {autoCraftTime::senior-general} to 10 set {autoCraftTime::captain} to 5 set {autoCraftTime::elite-captain} to 3 set {autoCraftTime::sergeant} to...
  2. Sovde

    Script NBT Player Data 2025-02-26

    Requires SkBee 3.8.2+, Skript 2.10+. NBT Player Data Basic NBT-based player data system. Stores strings and numbers in NBT, but accessible via variables. Example:{-npd::%player%::strength} = 1 This value is stored in npd_data/<player's uuid>.dat as {strength: 1}. All values under...
  3. C

    Snowball able to successfully shoot fireballs

    I was trying to write a Skript that's able to change snow golem's snowballs to fireballs, though I'm not too good at stuff like this. It kinda worked, but not only do I not really see the fireballs as much (I assume they phase into the ground or they go too fast), the snow golem shoots them...
  4. Laserlp

    Save variable in item

    Hello everyone! I need help by saving Variables per item. This is my code: What happens is that when I have two or more armor sets, the level of the first set gets replaced by the second. In other words, the variable only holds one value for all items. How can I fix this? I don’t think using a...
  5. PixelCraft_I_D_K

    Block's UUID in a variable

    Hi there! I was just wondering how you'd put a block's UUID inside a variable. I'm trying to give the block data (a variable) when right clicked on by a certain item. I have to use %block's uuid%, but that's not working. If I used %player's uuid% that wouldn't work either, since only admins are...
  6. VoiderYT

    Variables that don't reset on load

    I am trying to make a skript thingy that stores a variable (in my case, a list) but when I restart the server, it resets the variable. How would I avoid that? Here is an example (not my case but just a general idea): command /sethome: trigger: set {home} to location of player...
  7. SuperRcraft

    Variable Problems

    command /lootbox [<string>] [<string>] [<string>] [<string>] [<string>] [<string>] [<string>] [<string>]: permission: skript.lootbox.admin trigger: if arg-1 = "create": if {lootbox::list::*} does not contain arg-2: add arg-2 to {lootbox::list::*}...
  8. Kaff

    How can i use Skript variables in another plugin config?

    Basically, i want to use one of my Skript variables in the config of a plugin of Scoreboard. And i'd like learn to use a plugin variable into a Skript also. Is there a way to use a variable Skript in another plugin?
  9. S

    Solved How to send a variable in chat?

    Hello everyone! I'm working on skill upgrade and I need to see how many xp I have, but I don't know how to send variables in chat :( command /alchemy_xp: trigger: send "{%player%_alchemy_level}" to the player send "{%player%_alchemy_max}" to the player send...
  10. R

    More than 1 entity selected

    command /near: trigger: loop mobs in radius 5 of player: set {target} to loop-mobs remove player from {target} set {Place} to {target}'s location if {target} is set: teleport {target} 10 above {Place} delete {target}...
  11. xWires

    Solved Removing an element from a list variable not working properly

    When I remove an element from a list variable, instead of deleting the element, it is just set to <none>, so if you remove the first element of a list with delete {testlist::1} and use this code to look at the list of variables: loop {testlist::*}: send "%loop-index%. ""%loop-value%""" it...
  12. S

    variable in option

    options: Cooldown1: "%{dashCD::%player's uuid%}%" on swap hand items: cancel event if {Dash::%player's uuid%} > 0: set {_u} to {_p}'s uuid if {dash.last1::%{_u}%} is set: set {_wait1} to difference between {dash.last1::%{_u}%} and now else...
  13. T

    Solved Way to make skript more efficient

    I have made this code to make a random string of letters however it is very laggy. I am wondering if there is a way to make it better. command /genstring: permission: the77event.captcha trigger: set {id::*} to "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N"...
  14. M

    Solved Variables getting reset on every while loop

    Hi, I've set up a simple counter that increases a variable's value by 1 every second. However, it seems that the variable is set to null every start of the while loop. What's weird, though, is that the counter does seem to save while in the while loop, but anything outside the while loop or at...
  15. 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 -...
  16. KingDooms

    Results not set even tho they are?

    So making a random critical skript was kinda breaking, but at this point, idk what's wrong. {RandomCritDamag::%player%} is set as 110. A command telling the results says 110 but when actually using it with %attacker%, it doesn't work and it says it's not set. Code: - Not working: variables...
  17. Mjatt_

    Players name as variable

    Hey there, I'm relatively new to coding/skript and wanted to open an GUI when clicking on another player. So that would start with on right click on player bla bla bla. But i want the name of the GUI as the name of the player you clicked on. Could anyone help? I cannot figure it out. All help...
  18. H

    Problem in setting list variable value

    I want to change multiple value of list at once. For example, I already have written down this phrase. set {list::*} to 100 But results are not what I expect. This phrase removes previous data of list, and inserts new data. So, list's (index : value) set to (1:100) How can I solve this issue?
  19. B

    Solved add variable to variable

    I can't add variable to variable.. Am I have to add an addon? or I can solve it by other way? if clicked slot is 4: set {_pay} to 0 loop {NUM::%player%} times: add {STOCKPAY::%{BUY::%player%}%} to {_pay} message "%{_pay}%" to player
  20. A

    Solved add string to player variable

    im trying to add "text" to {test::%player's uuid%} but it doesnt seem to work command /wip: trigger: add "text" to {test::%player's uuid%} send {test::%player's uuid%} to player