Aidih Posted February 9 Posted February 9 (edited) on first join: set {predefined::*} to 1, 2. and 3 set {_gen} to random object out of {predefined::*} if {_gen} is =1: execute console command "/luckperms user %player% parent set team-1" if {_gen} is =2: execute console command "/luckperms user %player% parent set team-2" else:: execute console command "/luckperms user %player% parent set team-3" Edited February 9 by Aidih
sulfur Posted February 9 Posted February 9 (edited) 7 errors damn (ez spoonfeed) Quote set {predefined::*} to 1, 2. and 3 This isn't a thing, you can set a local variable "{_var}" to a random integer between 1 and 3, like: set {_predefined} to random integer between 1 and 3 Also make sure you didn't do any typos, because there was a typo in ... to 1, 2. and 3 (you used a dot instead of a comma) Quote if {_gen} is =1: You added "=" before the integer, did you even reload the skript? (/sk reload <file name>) "=" | equal to ">" | greater than "<" | less than ">=" | greater than or equal to "<=" | less than or equal to You did: if {_gen} is is1: Also you didn't even set any random number to the local var {_gen}, but you did for {_predefined} ... if {_predefined} is 1: ... Also you have indentation errors on: Quote execute console command "[cmd]" In skript, you need to maintain consistent indentation, meaning you cannot indent 1 line 5 spaces, and the next 7 spaces. Usually it's recommended you use tabs, however. A good rule of thumb is to always indent the subsequent line whenever the previous statement ends with a ":", an exception to this in command statements with items before the trigger such as "permission:" or "aliases:" With conditional statements and loops, any code that is indented within the statement will be run as a part of the statement, other code will not run within the statement. Here's an example. command /test: permission: skript.test trigger: if {example} is not set: broadcast "Thisdwipjorgv" wait 1 tick loop all players: send "Hello, %loop-player%" else if {example2} is true: broadcast "Thujioerfgtsero5tfhuigb" ... if {_predefined} = 1: execute console command "/luckperms user %player% parent set team-1" ... Quote else:: You added 2 of ":" and else is used for stuff like "is true/false" "is set/not set" Here's the fixed code: on first join: set {_predefined} to random integer between 1 and 3 if {_predefined} = 1: execute console command "/luckperms user %player% parent set team-1" if {_predefined} = 2: execute console command "/luckperms user %player% parent set team-2" if {_predefined} = 3: execute console command "/luckperms user %player% parent set team-3" Also I removed " set {_gen} to random object out of {predefined::*}" because it's useless, why are you setting a variable to numbers and using another variable to set to the variable thats set to numbers (smth like that I honestly dont know what i said) Also I might be wrong, and I don't know how to explain things properly so ya AND YOU ARE IN THE WRONG FORUM! Edited February 9 by sulfur Forgot to add one more thing
DuckyProgrammer Posted February 16 Posted February 16 Moved to Minehut -> Skript -> Discussion. Please use the right forum when making a post. No rank - 2017-2021 Minehut Tester - 2021-2023 Minehut Volunteer Moderator - 2023-Current Report a player/server: Report Player / Server Create a support ticket: Submit a request Did I help you? If so, feel free to give me a like!
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