send "&3&lScenarios:" to all players
add {GoldenRetriever} to {top::*}
add {BleedingSweets} to {top::*}
add {Shieldless} to {top::*}
add {NetheriteDrop} to {top::*}
add {Webless} to {top::*}
add {AutoEnchant} to {top::*}
loop 3 times:
set {mayor} to max({top::*})
if {mayor} = {GoldenRetriever}:
send "&bGoldenRetriever" to all players
set {GoldenRetriever} to true
remove {GoldenRetriever} from {top::*}
if {mayor} = {BleedingSweets}:
send "&bBleedingSweets" to all players
set {BleedingSweets} to true
remove {BleedingSweets} from {top::*}
if {mayor} = {Shieldless}:
send "&bShieldless" to all players
set {Shieldless} to true
remove {Shieldless} from {top::*}
if {mayor} = {NetheriteDrop}:
send "&bNetheriteDrop" to all players
set {NetheriteDrop} to true
remove {NetheriteDrop} from {top::*}
if {mayor} = {Webless}:
send "&bWebless" to all players
set {Webless} to true
remove {Webless} from {top::*}
if {mayor} = {AutoEnchant}:
send "&bAutoEnchant" to all players
set {AutoEnchant} to true
remove {AutoEnchant} from {top::*}
send " " to all players```
#Doesn't send the biggest value
1 messages · Page 1 of 1 (latest)
if name of event-inventory is "&3&lScenario Selector":
if index of event-slot = 11:
cancel event
if {voteSweets::%player's uuid%} is not set:
if ({maxvote::%player's uuid%} ? 0) is less than 3:
add 1 to {BleedingSweets}
add 1 to {maxvote::%player's uuid%}
set {voteSweets::%player's uuid%} to true
send "&eYou have voted for BleedingSweets!"
else:
send "&4You have reached the maximum amount of votes!"
else:
delete {voteSweets::%player's uuid%}
remove 1 from {BleedingSweets}
remove 1 from {maxvote::%player's uuid%}
send "&3Removed your vote from BleedingSweets!"```
this is how I do the counting system
thanks for all the help in advance!
so true
damn
Too be fair your code is bad.
yeah, I always use the simplest option as I am not so good at it
no
You are using a hardcoded way
- No one wants to read all of that.
- What are you even trying to do?
- Where does it stop working
Send a small snippet and a description of what this is supposed to do and where it fails
Basically I want it to list the top 3 chosen ones
How do you “choose”
A gui I made
If I wasn't doing something I would fix it
YOU MADE?
I was about to say that you helped me with
But your writing is just way faster 💀
Spoon feeding means that you didnt make it
He did I just redid it
Ah
Thank you, I don’t need it fast anyway
Choses whats?
The top 3 chosen scenarios in the gui
Basically I am trying to code a uhc plugin
Wait, I have to turn on my pc rq
these:
add {BleedingSweets} to {top::*}
add {Shieldless} to {top::*}
add {NetheriteDrop} to {top::*}
add {Webless} to {top::*}
add {AutoEnchant} to {top::*}```
Why not {scenarios::*}
I mean it doesn't really make a difference, right?
and is do you know a way to make my thing work?
( sorry for the ping )
send gui
I mean
set {scenario::vampire} to true
Then on death check if its true and heal the attacker
Idk
And for the voting
Just add 1 to {votes::NAME HERE}
also for your auto enchant
on preparing craft of any iron armor or iron sword:
set {_o} to event-item
if event-item is a iron sword:
enchant {_o} with sharpness 1
else:
enchant {_o} with protection 1
set slot 0 of event-inventory to {_o}
ive never used preparing craft before, but is it nessisary to stringify an item and then parse it as an item? why not just set o to event-item?
huh
if name of player's held item is "&3Scenarios":
set {_Scenarios} to chest inventory with 3 rows named "&3&lScenario Selector"
set slot (integers between 0 and 3) of {_Scenarios} to cyan stained glass pane named "Made by meter"
set slot 4 of {_Scenarios} to chest named "&3NoCleanUp" with lore "You can't hit or be hit for 15s after a kill" and " " and "&eAlready included"
set slot (integers between 5 and 9) of {_Scenarios} to cyan stained glass pane named "Made by meter"
set slot 10 of {_Scenarios} to golden apple named "&3Golden Retriever" with lore "Each kill drops 2 Golden Apples"
set slot 11 of {_Scenarios} to sugar named "&3Bleeding Sweets" with lore "Each kill drops" and "» &b1 Diamond" and "» &b5 Arrows" and "» &b1 String"
set slot 12 of {_Scenarios} to shield named "&3Shieldless" with lore "Shields will disabled"
set slot 13 of {_Scenarios} to barrier named "&4Close"
set slot 14 of {_Scenarios} to netherite scrap named "&3Netherite Drop" with lore "Breaking diamonds has the chance to drop netherite scraps"
set slot 15 of {_Scenarios} to web named "&3Webless" with lore "Webs will be disabled"
set slot 16 of {_Scenarios} to book named "&3AutoEnchant" with lore "Iron Armor gets prot 1 automatically" and "Iron Swords get sharpness 1 automatically" and " " and "&4Not working"
set slot (integers between 17 and 21) of {_Scenarios} to cyan stained glass pane named "Made by meter"
set slot 22 of {_Scenarios} to furnace named "&3AutoSmelter" with lore "Ores get smelted automatically" and " " and "&eAlready included"
set slot (integers between 23 and 26) of {_Scenarios} to cyan stained glass pane named "Made by meter"
open {_Scenarios} to player```
how votes get counted:
if name of event-inventory is "&3&lScenario Selector":
cancel event
if index of event-slot = 10:
cancel event
if {voteGolden::%player's uuid%} is not set:
if ({maxvote::%player's uuid%} ? 0) is less than 3:
add 1 to {GoldenRetriever}
add 1 to {maxvote::%player's uuid%}
set {voteGolden::%player's uuid%} to true
send "&eYou have voted for GoldenRetriever!"
else:
send "&4You have reached the maximum amount of votes!"
else:
delete {voteGolden::%player's uuid%}
remove 1 from {GoldenRetriever}
remove 1 from {maxvote::%player's uuid%}
send "&3Removed your vote from Golden Retriever!"```
where they get chosen after voting:
add {BleedingSweets} to {top::*}
add {Shieldless} to {top::*}
add {NetheriteDrop} to {top::*}
add {Webless} to {top::*}
add {AutoEnchant} to {top::*}
loop 3 times:
set {mayor} to max({top::*})
if {mayor} = {GoldenRetriever}:
send "&bGoldenRetriever" to all players
set {GoldenRetriever} to true
remove {GoldenRetriever} from {top::*}
if {mayor} = {BleedingSweets}:
send "&bBleedingSweets" to all players
set {BleedingSweets} to true
remove {BleedingSweets} from {top::*}
if {mayor} = {Shieldless}:
send "&bShieldless" to all players
set {Shieldless} to true
remove {Shieldless} from {top::*}
if {mayor} = {NetheriteDrop}:
send "&bNetheriteDrop" to all players
set {NetheriteDrop} to true
remove {NetheriteDrop} from {top::*}
if {mayor} = {Webless}:
send "&bWebless" to all players
set {Webless} to true
remove {Webless} from {top::*}
if {mayor} = {AutoEnchant}:
send "&bAutoEnchant" to all players
set {AutoEnchant} to true
remove {AutoEnchant} from {top::*}
send " " to all players```
nl
wdym?
I still don't get what your are trying to say
so just put %% around {GoldenRetriever}?
No
send “cool stuff” to player
send “ “ to player
vs
send “ %nl%cool stuff%nl% “ to player```
ohh
what's the fix to my problem tho?
it's like the only issue I have left rn
.
no errors doesnt mean good code
and if you are going to use this code on a public server it should be done professionally
I know what you are trying to say but I first wanna find the fix to the problem, there's no real point of adding those things if it doesn't even work
and what's the difference by adding else ifs?
I have never used that tbh
@elder mauve sorry for the ping but do you know the issue?
So that I can read through the code, that way I dont have to read duplicate lines
Can each player only vote for one scenario?
Else ifs are great
If the first condition is false, then if another is passed
3 votes
and 3 get chosen out of 6 scenarios I have made until now
Ok
@elder mauve sorry for the ping but you said you knew how to fix it
I’m no home
alr, Imma try that rq
set {mayor} to max({votes::*})
if {mayor} = {GoldenRetriever}:
send "&d» &bGoldenRetriever" to all players
set {GoldenRetriever} to true
remove {votes::GoldenRetriever} from {votes::*}
if {mayor} = {BleedingSweets}:
send "&d» &bBleedingSweets" to all players
set {BleedingSweets} to true
remove {votes::BleedingSweets} from {votes::*}
if {mayor} = {Shieldless}:
send "&d» &bShieldless" to all players
set {Shieldless} to true
remove {votes::Shieldless} from {votes::*}
if {mayor} = {NetheriteDrop}:
send "&d» &bNetheriteDrop" to all players
set {NetheriteDrop} to true
remove {votes::NetheriteDrop} from {votes::*}
if {mayor} = {Webless}:
send "&d» &bWebless" to all players
set {Webless} to true
remove {votes::Webless} from {votes::*}
if {mayor} = {AutoEnchant}:
send "&d» &bAutoEnchant" to all players
set {AutoEnchant} to true
remove {votes::AutoEnchant} from {votes::*}
send " " to all players```
so like this?
if name of event-inventory is "&3&lScenario Selector":
if index of event-slot = 15:
cancel event
if {voteWebless::%player's uuid%} is not set:
if ({maxvote::%player's uuid%} ? 0) is less than 3:
add 1 to {votes::Webless}
add 1 to {maxvote::%player's uuid%}
set {voteWebless::%player's uuid%} to true
send "&eYou have voted for Webless!"
else:
send "&4You have reached the maximum amount of votes!"
else:
delete {voteWebless::%player's uuid%}
remove 1 from {votes::Webless}
remove 1 from {maxvote::%player's uuid%}
send "&3Removed your vote from Webless!"```
@stone cloak this still doesn't work for some reason
idk if the problem is that some maybe have the same votes number?
i don't suggest pinging him
^ i check discord periodically so I’ll eventually get around, no need to ping me
tell me when you can, thank you
try something like
if {votes::%scenario%} does not contain player's uuid:
add player's uuid to {votes::%scenario%}
send "You voted for %{votes::%scenario%}%" to player
remove 1 from {remainingVotes::%player's uuid%}
else:
send "You have already voted for %{votes::%scenario%}%" to player```
then loop {votes::*}, and check the sizes
that's basically my code with new variables tho
if name of event-inventory is "&3&lScenario Selector":
if index of event-slot = 15:
cancel event
if {voteWebless::%player's uuid%} is not set:
if ({maxvote::%player's uuid%} ? 0) is less than 3:
add 1 to {votes::Webless}
add 1 to {maxvote::%player's uuid%}
set {voteWebless::%player's uuid%} to true
send "&eYou have voted for Webless!"
else:
send "&4You have reached the maximum amount of votes!"
else:
delete {voteWebless::%player's uuid%}
remove 1 from {votes::Webless}
remove 1 from {maxvote::%player's uuid%}
send "&3Removed your vote from Webless!"```
first it checks if you voted, then the votecount and then it adds your vote