Jump to content

Adding player to group when a variable = 1000


Recommended Posts

I am trying to make a script in skript to monitor total blocks mined and be able to show it to the player and then when the player has reached 1000 blocks broken they get added to a Luck Perms group (member)

so far i have this:

on break:
	add 1 to {blocks.broken.%player%}
command /blocks:
	trigger:

		message "&eTotal Blocks Broken &4» &6%{blocks.broken.%player%}%"

on join:
	if {blocks.broken.%player%} is not set:
		set {blocks.broken.%player%} to 0
		
if {blocks.broken.%player%} is greater than 999
	trigger:
 

but i cannot find anyway to add the player to a group at this level. i have so far used different pieces of code i have found online but cant find anything to progress.

I also do not want to install essentials as it removes some command functionality 
 Current Plugin List (and worldguard)

image.png.31aac6bbc8b70891e529560597dadc0b.png

Edited by GalaxtaGaming
Link to comment
Share on other sites

Here. You had a few errors. First, trigger only comes after a command argument, and second, putting the if statement in the join trigger, doesn't allow the player to get the reward until they rejoin. Here is what I would do: (sorry this is on mobile there is no insert code option -_-)

on break:

    add 1 to {blocks.broken.%player%}

    if {blocks.broken.%player%} is greater than 999:

        make console execute command "/lp user set group miners" #fix this to be your actual luckperms command

command /blocks:

    trigger:

        send "&eTotal Blocks Broken &4» &6%{blocks.broken.%player%}%" to player

on join:

   if {blocks.broken.%player%} is not set:

        set {blocks.broken.%player%} to 0

 

 
Edited by Gam3rBoi

Main MC account: Gam3rBoi (VIP in MH)

Alt MC account: *Gam3rBoi2147

Farcade server owner

Skripter with 6+ months experience + time learning coding concepts

Message me through the forums if you need anything!

Link to comment
Share on other sites

8 hours ago, Gam3rBoi said:

Here. You had a few errors. First, trigger only comes after a command argument, and second, putting the if statement in the join trigger, doesn't allow the player to get the reward until they rejoin. Here is what I would do: (sorry this is on mobile there is no insert code option -_-)

on break:

    add 1 to {blocks.broken.%player%}

    if {blocks.broken.%player%} is greater than 999:

        make console execute command "/lp user set group miners" #fix this to be your actual luckperms command

command /blocks:

    trigger:

        send "&eTotal Blocks Broken &4» &6%{blocks.broken.%player%}%" to player

on join:

   if {blocks.broken.%player%} is not set:

        set {blocks.broken.%player%} to 0

 

 

you didnt address the actual question they had, but ye there was alot of broken things there

 

 

13 hours ago, GalaxtaGaming said:

I am trying to make a script in skript to monitor total blocks mined and be able to show it to the player and then when the player has reached 1000 blocks broken they get added to a Luck Perms group (member)

so far i have this:

on break:
	add 1 to {blocks.broken.%player%}
command /blocks:
	trigger:

		message "&eTotal Blocks Broken &4» &6%{blocks.broken.%player%}%"

on join:
	if {blocks.broken.%player%} is not set:
		set {blocks.broken.%player%} to 0
		
if {blocks.broken.%player%} is greater than 999
	trigger:
 

but i cannot find anyway to add the player to a group at this level. i have so far used different pieces of code i have found online but cant find anything to progress.

I also do not want to install essentials as it removes some command functionality 
 Current Plugin List (and worldguard)

image.png.31aac6bbc8b70891e529560597dadc0b.png

Try this
 

if <Your Variable> = 1000:

 

Edited by AgentGamerPro

 

 

image.png.bc433d6489d70ad831075fe76809b993.png
 

Owner of Lifestealed, Labs, Encore, UNOfficially and Observed
 

OG [VIP] 12/26/20 - 10/27/2021
OG [PRO] 12/27/21 - 11/18/2022
OG [LEGEND] 11/18/2022 - 3/14/2023
[DEFAULT] 3/14/2023 - 5/8/2024

[MOD] 5/8/2024 - Present

 

Link to comment
Share on other sites

@AgentGamerProI thought they asked for the actual command help, not the 1000 players check.

14 hours ago, GalaxtaGaming said:

--> but i cannot find anyway to add the player to a group at this level. i have so far used different pieces of code i have found online but cant find anything to progress.

I also do not want to install essentials as it removes some command functionality 
 Current Plugin List (and worldguard)

 

Edited by Gam3rBoi

Main MC account: Gam3rBoi (VIP in MH)

Alt MC account: *Gam3rBoi2147

Farcade server owner

Skripter with 6+ months experience + time learning coding concepts

Message me through the forums if you need anything!

Link to comment
Share on other sites

11 hours ago, Gam3rBoi said:

Here. You had a few errors. First, trigger only comes after a command argument, and second, putting the if statement in the join trigger, doesn't allow the player to get the reward until they rejoin. Here is what I would do: (sorry this is on mobile there is no insert code option -_-)

on break:

    add 1 to {blocks.broken.%player%}

    if {blocks.broken.%player%} is greater than 999:

        make console execute command "/lp user set group member"

command /blocks:

    trigger:

        send "&eTotal Blocks Broken &4» &6%{blocks.broken.%player%}%" to player

on join:

   if {blocks.broken.%player%} is not set:

        set {blocks.broken.%player%} to 0

 

 

One question would this give the person who broke 1000 blocks the rank or what would it do as the normal syntax is

   /lp user [Name] set group member

Link to comment
Share on other sites

No, it would not. The only command that would work is the normal syntax, so replace what I put for the command with what the normal syntax is.

Main MC account: Gam3rBoi (VIP in MH)

Alt MC account: *Gam3rBoi2147

Farcade server owner

Skripter with 6+ months experience + time learning coding concepts

Message me through the forums if you need anything!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...