#A command based on a minecraft scoreboard value (/scoreboard)
1 messages · Page 1 of 1 (latest)
right, but how would i be able to apply that to the entered name
im extremely new to skript
this is what i have so far. i have the objective created and i set one of my friends' "flc" values to 1, and it wont work (it doesnt detect them i believe)
You should always use code blocks to make it easier to read; ```code here```
permission: police.permission.node
trigger:
if {flc::%arg 1%} is set:
if {flc::%arg 1%} is 1:
send "%arg 1% possesses a valid firearms license."
else:
send "%arg 1% does NOT possess a valid firearms license."
else:
send "Error: Player %arg 1% not found or has not been assigned a firearms license."```
^^^
if it helps im running skript 2.6.4
thats actually a bit outdated
2.8+ is out
2.8 also brought a bunch of new features
would updating it mess with the addons or skripts
my server is also 1.12.2
im pretty sure thats why i hesitated
but im unsure
still not working
should i rewrite my skript
its so simple but its failing ðŸ˜
trigger:
set {_player} to arg-1
if {_player} is not online:
send "&cError: That player is not online."
stop
if {_player}'s flc is 1:
send "&a%{_player}% possesses a valid firearms license."
else:
send "&c%{_player}% does NOT possess a valid firearms license."
this wont work either bc line 7
i feel like its the way im trying to check if they have the scoreboard objective
because the argument type is a string (text), not a player
also that local variable is very useless, just use the arg-1 expression
yes
you need to have correct syntax for your code to work
trigger:
if arg-1 is not online:
send "&cError: That player is not online."
stop
if arg-1's flc is 1:
send "&a%arg-1% possesses a valid firearms license."
else:
send "&c%arg-1% does NOT possess a valid firearms license."```
heres what i have, theres no errors, but it still only responds with "&c%arg-1% does NOT possess a valid firearms license."
can you please turn off reply pings
because %someone%'s flc isnt a thing in skript
theres an option to turn it off. click that, or hold shift before replying
i found it, also, would my line look like this?
if objective "flc" is 1 for arg-1:
ive done so much tinkering and it still wont work
if theres no errors it will only tell me that they dont have a firearms license despite the score being 1
"wont work" doesnt tell many any important information
other than you have an issue, which i can deduce by the fact that youre here
^
ive rewritten it many times attempting to fix it but nothing
i cant see any of these rewrites though
wont work as in what we last left off with, adding "if objective "flc" is 1 for arg-1:"
trigger:
if arg-1 is not online:
send "&cError: That player is not online."
stop
if objective "flc" is 1 for arg-1:
send "&a%arg-1% possesses a valid firearms license."
else:
send "&c%arg-1% does NOT possess a valid firearms license."```
the only error is line 6
skript fails to understand the condition
hope that clarifies
we already considered this right? i mentioned a line i rewrote in attempt to follow the correct syntax and its still incorrect. ive looked over and over and i still dont see what to change
thats a new docs link
my apologies
would if score of arg-1 for {_flc} is 1 be correct?
if that local variable is set to a string
what would i set it to though
thats the question
this whole time ive been struggling to target the scoreboard
trigger:
if arg-1 is not online:
send "&cError: That player is not online."
stop
if score of arg-1 for {_flc} is 1:
send "&a%arg-1% possesses a valid firearms license."
else:
send "&c%arg-1% does NOT possess a valid firearms license."```
so i would need to add a line (3) that would set it
but what would i set it to
you said its already set
thats a variable
an unset variable, too
you want to put a string there
look at the syntax in addition to the examples
the variable is an example of a potential way to have a string
nah like set as in ingame
i dont have the variable set in this skript of course
in game i did /scoreboard players set (my friends user) flc 1
which would mean they would have the tag, or in this instance the firearms license, that would say they do
uhuh
sorry im really confused ðŸ˜
now you use thay key, "flc". not the variable
so if i were to say if score of arg-1 for "flc" is 1:
it would directly target the scoreboard objective?
i kinda just answered myself with a no bc it still is an error
trigger:
if arg-1 is not online:
send "&cError: That player is not online."
stop
if score of arg-1 for "flc" is 1:
send "&a%arg-1% possesses a valid firearms license."
else:
send "&c%arg-1% does NOT possess a valid firearms license."```
try broadcast score of player for "flc"
if broadcast score of player for "flc" is 1:
?
something i should have done is list my addons too
- Skellett
- skDragon
- SkQuery
thats all wtf
uh, yeah.
- You need skbee installed
- remove skquery, its outdated and anything it can do, skript or skbee can do
would this work if i were to change the addons
accordingly
also, wouldnt this be bad for SkBee or am i mistaken
done
if this were correct, it still prompts an error
heres what I have again to keep things easier
trigger:
if arg-1 is not online:
send "&cError: That player is not online."
stop
if broadcast score of player for "flc" is 1:
send "&a%arg-1% possesses a valid firearms license."
else:
send "&c%arg-1% does NOT possess a valid firearms license."```
✅
(this is a screenshot showing SkBee is installed successfully)
no is 1... you just want the expression, youre not comparing it to anything
wdym
sorry for ping
if im not mistaken im testing if their flc scoreboard value in game is 1
how else would i test for that?
you are just broadcasting some object
like broadcast 1
you dont want broadcast 1 < 2, as you arent comparing it in a condition or anything
if broadcast score of player for "flc": ?
im lost
can you write a brief example describing your point?
once i figure this out, it will solve so many other problems
it seems so simple
literally just broadcst it
but without the "is 1" at the end..
first, this doesnt work
it still shows an error
second, its supposed to be conditional
considering i want two different type sof messages
if i do /scoreboard players list ohrockk
and flc = 1
i want it to message the person who does the command that i have a valid license
and if flc = 0
vise versa
wouldnt that be considered conditional or am mistaken
my skript just probably doesnt show what i want because as i said im new
but thats what im aiming for
you are using that expression in a condition, yes, but you cant broadcast a condition
you just want to broadcast that expression--to see if its valid and set to what you expect it to be
wouldnt i need to change more though?
im attempting to test for the score, and if its one, itll send the message
then the else would be if it isnt 0, so it would message that they dont have it
i see so were debugging
do you want me to just
broadcast gi
hi
or something
in that line
not just "something"
oh i understand now
trigger:
if arg-1 is not online:
send "&cError: That player is not online."
stop
if broadcast score of player for "flc"
send "&a%arg-1% possesses a valid firearms license."
else:
send "&c%arg-1% does NOT possess a valid firearms license."```
should it look like this?
if this is what you want, it gives an indent error on line 7 (because theres no colon on line 6)
and line 6 shows that it doesnt understand the condition
so remove if?
sorry for the ping again ðŸ˜
just forget about the if statement for now.
we need to make sure the expression works first
if broadcast score of player for "flc"
broadcast test
no
just broadcast the score right after the trigger
so delete if
trigger:
if arg-1 is not online:
send "&cError: That player is not online."
stop
broadcast score of player for "flc"
send "&a%arg-1% possesses a valid firearms license."
else:
send "&c%arg-1% does NOT possess a valid firearms license."```
i ran that and it still doesnt understand
did you install skbee?
WHAT
version 1.10??
is that the latest that works on your server version?
this requires 2.6+
1.12.2
yes
the only reason i use 1.12.2 is because its easy for people to join on newer versions
im also fluent with the command system bc 1.20 fucks it up
or anything beyond 1.12.2
i could try using it
its possible it could still work
its just not 100%
ill try installing it
the only version that supports my skript version is 2.18
another thing i forgot to add, i have jars of skrayfall and tuske
problem is when i try installing 2.8.4 (cleaned the addons) and i try using the /skript, it just shows an error message
org.bukkit.command.CommandException: Cannot execute command 'skript' in plugin Skript v2.8.4 - plugin is disabled.
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:36) ~[patched_1.12.2.jar:git-Paper-1620]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:152) ~[patched_1.12.2.jar:git-Paper-1620]
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:685) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1492) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1297) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:14) ~[patched_1.12.2.jar:git-Paper-1620]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:850) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:423) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:774) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:666) ~[patched_1.12.2.jar:git-Paper-1620]
at java.lang.Thread.run(Thread.java:829) [?:?]```
yeah remove those too
