Solved Factions

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

slxshxr

Member
Jul 28, 2018
11
0
0
24
I need a script for block settings home (/sethome) at any factions claim/land.

Second script for buying faction's power with $$. Something like:
code_language.skript:
on rightclick on sign:
    if line 1 of event-block is "buy power":
        if player's balance is more or equal to 15000:
           #do stuff

#do stuff- add 1 to faction's max power. That power regenerate by 1 every 24 hours.
 
Okay, I whipped this up quickly for you. I haven't tested it because I don't have a faction server.
You will need the add-on CONQUER for this to work
The first part here is the ability to stop setting homes
code_language.skript:
on command "sethome":
    if faction at player is set:
        cancel event
        send "&cYou can not set a home in a faction"
The next part will set a delay and let the player up the power of their faction. I couldn't find a syntax regarding power of faction, so I just set it to run a console command. You didn't specify which faction plugin you are using, so I dont know the command, so make sure to edit that.
code_language.skript:
on rightclick on sign:
    if line 1 of event-block is "buy power":
        if player's balance is more or equal to 15000:
            if faction of player is not set:
                send "&cYou do not belong to a faction"
            else:
                if {faction::power::%faction of player%} is set:
                    if difference between {faction::power::%faction of player%} and now <= 24 hours:
                        set {_dif} to the difference between {faction::power::%faction of player%} and now
                        set {_wait} to (24 hours - {_dif})
                        send "&cYou can only add to your faction power once every 24 hours. Please wait %{_wait}%"
                        stop
                    if difference between {faction::power::%faction of player%} and now > 24 hours:
                        set {faction::power::%faction of player%} to now
                        execute console command "command here"
                        #i dont know the command to add power, as i dont know which faction plugin youre using
                        #also conquer doesnt have any syntax dealing with power
                        #wherever in the command it needs the faction id just use %{faction::power::%faction of player%}%
                        #or if it just adds power to the players faction i guess use %player%
                        send "&aYou added 1 to the power of your faction"
                        stop
                if {faction::power::%faction of player%} is not set:
                    set {faction::power::%faction of player%} to now
                    execute console command "command here"
                    #i dont know the command to add power, as i dont know which faction plugin youre using
                    #also conquer doesnt have any syntax dealing with power
                    #wherever in the command it needs the faction id just use %{faction::power::%faction of player%}%
                    #or if it just adds power to the players faction i guess use %player%
                    send "&aYou added 1 to the power of your faction"
                    stop
 
One more question D:.

By command i can only set powerboost of faction, so it'll be always 1.

I want let player's buy max power (add 1 to actually).
I have faction plugin by massivecore

I tried this 2, but not working:
code_language.skript:
add maximum power of faction to {_pow} parsed as number
                    set faction's maximum power to ({_pow} + 1)

code_language.skript:
set the maximum power of the faction to (faction's maximum power + 1)
 
One more question D:.

By command i can only set powerboost of faction, so it'll be always 1.

I want let player's buy max power (add 1 to actually).
I have faction plugin by massivecore

I tried this 2, but not working:
code_language.skript:
add maximum power of faction to {_pow} parsed as number
                    set faction's maximum power to ({_pow} + 1)

code_language.skript:
set the maximum power of the faction to (faction's maximum power + 1)
Well that is because that syntax doesn't exist. Unless you are finding something I cant find.
I searched thru all of Conquers docs, and I see nothing regarding power.
So unless your faction plugin has a command to do it, I dont see any way around it.
[doublepost=1533059679,1533059476][/doublepost]My only suggestion at this point is to either send a request to the Dev of factions, asking for them to add a command to change the max power of the faction, or message the Dev of Conquer and ask if they could possibly add in a syntax to change the max power of a faction.
 
Okey, i did it.
If somebody else search:
code_language.skript:
execute console command "f powerboost faction %faction of player% %{buyedpower.%faction of player%}%"
                add 1 to {buyedpower.%faction of player%}