zyria Posted March 2, 2023 Share Posted March 2, 2023 (edited) For some odd reason my skript will not work and i can't figure it out please help on load: clear {_swords::*} add "iron sword", "diamond sword" and "stone sword" to {_swords::*} command sword: trigger: set {_random} to a random element of {_swords::*} give {_random} to player send "test" Edited March 2, 2023 by zyria Link to comment Share on other sites More sharing options...
lostmatterr Posted March 3, 2023 Share Posted March 3, 2023 Whats not working? the command, the random sword giver, etc. Link to comment Share on other sites More sharing options...
ApexSplat Posted March 3, 2023 Share Posted March 3, 2023 parse the random var as an item type as you are giving the player a string rather than an item type Discord: Dead#6905 Love anime! Link to comment Share on other sites More sharing options...
Znyx Posted March 8, 2023 Share Posted March 8, 2023 When you're adding the items to the list you're adding strings, not items. Also, I belive that the swords variable is local and not global which means you can't access the sword variable from the sword command. I might be wrong on that though, I'm quite new to skript. I would belive this works: on load: set {swords::*} to diamond sword, iron sword and stone sword command /sword: trigger: set {_random} to a random element of {swords::*} give {_random} to player send "&cHere's a random sword!" to player Link to comment Share on other sites More sharing options...
ApexSplat Posted March 8, 2023 Share Posted March 8, 2023 3 hours ago, Znyx said: When you're adding the items to the list you're adding strings, not items. Also, I belive that the swords variable is local and not global which means you can't access the sword variable from the sword command. I might be wrong on that though, I'm quite new to skript. I would belive this works: on load: set {swords::*} to diamond sword, iron sword and stone sword command /sword: trigger: set {_random} to a random element of {swords::*} give {_random} to player send "&cHere's a random sword!" to player yes this fixes it Discord: Dead#6905 Love anime! Link to comment Share on other sites More sharing options...
Hitmorningstar Posted July 14, 2023 Share Posted July 14, 2023 On 3/2/2023 at 4:50 PM, zyria said: For some odd reason my skript will not work and i can't figure it out please help on load: clear {_swords::*} add "iron sword", "diamond sword" and "stone sword" to {_swords::*} command sword: trigger: set {_random} to a random element of {_swords::*} give {_random} to player send "test" on load: clear {_swords::*} add "iron sword", "diamond sword" and "stone sword" to {_swords::*} command /sword: trigger: set {_random} to a random element of {_swords::*} give {_random} to player send "test" Link to comment Share on other sites More sharing options...
devyy Posted August 5, 2023 Share Posted August 5, 2023 Bro easy: on load: clear {_swords::*} add "iron sword", "diamond sword" and "stone sword" to {_swords::*} command /sword: trigger: give (random element of {_swords::*} parsed as item type) to player Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now