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

    Now, what are you waiting for? Join the community now!

  1. ChedRed

    Setting a Variable to Location Arbitrarily

    I want to set a variable to a location, but I keep getting an error saying it does not recognize the type. For example: {spawns::1} = location(12, 34, 56) This fails and returns the error `can't understand the value 'location(12, 34, 56)'` and I have no idea why. Official documentation has not...
  2. OpulTL

    hey so i need some help with a skript that im getting confused with

    so im trying to do this: push {grapple.ability.ident::%uuid of player%} from location of {grapple.ability.ident::%uuid of player%} to location of {grapple.ability.user::%uuid of attacker%} now i know how to do push events pretty well but im having trubble using variables for it...
  3. wrymain

    Solved adding balance to a variable

    command /depositall: trigger: set {_p} to player set {_money} to {_p}'s balance add {_money} to {bank::%{_p}%} add 1 to {bank::%{_p}%} send "%{_money}% | %{bank::%{_p}%}%" adding {_money} to {bank::%{_p}%} does not work but adding 1 works. i also...
  4. 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...
  5. 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...
  6. 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...
  7. 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...
  8. 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...
  9. 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...
  10. 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::*}...
  11. 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?
  12. 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...
  13. 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}...
  14. 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...
  15. 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...
  16. 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"...
  17. 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...
  18. 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 -...
  19. 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...
  20. 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...