Jump to content

I need help with a simple command


Recommended Posts

Hello, I was wondering if it's possible for me to create a command in which I can input an user's name, and it broadcasts a message with the name I input. For example, if I run /voted plqx, it would broadcast this message to all the users online "plqx just voted on the server!" kinda like Minehut's system of voting. Any help is appreciated

Link to post
Share on other sites

I believe I have mad the basic command for you if you have any problem's message me on discord - Boxmonk#2099

command /vote [<player>]:
    usage: &c&lUsage &7>> /vote (Player)
    trigger:
        if arg-1 is not set:
            send "&c&lVoting &7>> Please put in a player name" to player
        else:
            if {voted::%uuid of player%} is not set:
                set {voted::%uuid of player%} to 100
                if {votes::%uuid of arg-1%} is equal to {Votes}:
                    broadcast "&6&lVoting &7>> %player% &7Has Voted For &c%arg-1% &7(%{Votes}%&7/%{Votes}%&7)"
                    wait 10 ticks
                    broadcast "&6&lVoting &7>> &c%arg-1%&7 Has won the election"
                    #do the stuff here
                    set {votes::%uuid of arg-1%} to 0
                else:
                    add 1 to {votes::%uuid of arg-1%}
                    broadcast "&6&lVoting &7>> %player% &7Has Voted For &c%arg-1% &7(%{votes::%uuid of arg-1%}%&7/%{Votes}%&7)"
            else:
                send "&6&lVoting &7>> You have already voted" to player


command /votes [<player>]:
    trigger:
        if arg-1 is not set:
            send "&c&lVotes &7>> Please put in a player name" to player
        else:
            send "&6&lVotes &7>> &c%arg-1%&7 Has %{votes::%uuid of arg-1%}%&7 Vote (s)" to player

command /resetvotes [<player>]:
    permission: voting.reset
    permission message: &c&lPermission&7>> You do not have the permission for this command
    trigger:
        if arg-1 is not set:
            send "&c&lVoting &7>> Please put in a player name" to player
        else:
            set {votes::%uuid of arg-1%} to 0
            send "&6&lVoting &7>> Reset &c%arg-1% &7Votes" to player

command /deletevoted [<player>]:
    permission: voted.reset
    permission message: &c&lPermission&7>> You do not have the permission for this command
    trigger:
        if arg-1 is not set:
            send "&c&lVoted &7>> Please put in a player name" to player
        else:
            delete {voted::%uuid of player%}
            send "&6&lVoting &7>> Reset &c%arg-1% &7Voted status" to player


command /setvotes [<integer>]:
    permission: vote.set
    permission message: &c&lPermission&7>> You do not have the permission for this command
    trigger:
        if arg-1 is not set:
            send "&c&lVote &7>> Please put in a number" to player
        else:
            set {Votes} to Arg-1
            send "&6&lVoties &7>> Set the need amount of votes to &c%arg-1%" to player

 

Edited by Boxmonkey
added set votes to win
Link to post
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...