#how to implement point system in volleyball game

1 messages · Page 1 of 1 (latest)

thick void
#

so i was thinking about just having two scores for both teams team and then whereever the ball lands in a zone it gives the corresponding team a point. I would make 4 zones (in, out, for both teams). Should i do it like this and if so how? (im trying very hard to avoid another xy-problem)

thick void
#

nvm i got it

frosty geyserBOT
thick void
#

nvm, i think i have to know who last touched the ball to know who to give the point to so u cant pass the ball into your own out. No idea how to implement this

frosty geyserBOT
#

-# (helpers summoned) <@&1166082198152159386> <@&1202694677766348840>

unkempt sleet
#

How are you making the ball ?

#

Overall you need to give more details about how your pack is working

thick void
#

is it enough if i send it over?

#

otherwise i have other threads

unkempt sleet
#

Ping me the treads then, that should be enough

#

Nvm, I found it

thick void
#

alr

#

i jsut realised idk how to ping a thread

unkempt sleet
#

To me your best option is to tag the ball when a player touch the ball, then just check that tag

thick void
#

so the ball has that tag until it is touched again

unkempt sleet
#

Yes

thick void
#

but all players would need seperate tags too, right?

unkempt sleet
#

Unless you are using a team system probably

thick void
#

idk how to do that, i think id be more comfortable with just tags

unkempt sleet
#

If you want to know which player touched the ball last you could make a function that clear everyone's saddle slot, then put a saddle on the player who touched the ball, that way you only check the player's and not the ball

#

That could also work

thick void
#

sure, and i did not know players had a saddle slot. Im assuming you're mentioning it bc its a slot u cant acces normally and therefore doesnt interfiere with anythign?

unkempt sleet
#

Yes

#

Just make sure to also apply curse of vanishing to the saddle so players won't drop them if they die 😉😅

thick void
#

right

#

ill see what i can do and probably come back in 2 minutes bc of some problem

unkempt sleet
#

Ok xD

thick void
#

so i have the saddle on the player who last touched the ball

#

now do i have to make all the logic with the zones? so 4 zones with 2 possibilities each`?

#

also how do i remove the saddle if some1 else touches the ball

thick void
thick void
#

i have 2 chickens under the map to reveive the points to better test if it works in singleplayer, the tags are "blue_points" and "red_points"
why doesnt this work?
execute as @n[tag=stand] if entity @s[x=2,z=-2,dx=13,dz=9.5] run scoreboard players add @n[tag=blue_points] points 1
both cmds work individually, ive tested that

thick void
#

the execute does not work, it only works correctly if i am close to it it seems like

thick void
#

QUICK UPDATE:
for the zoning, i tried to make logic like this

am i in red out?
if yes, am i in Red in?
give blue point

if no, does blue have last touch?
    give red point 

if no, does red have last touch?
    give blue point

same for blue

however, when i ask for red/blue in it double activates it since it is also in red out. (atleast in theory) Can i somehow say Red out - Red in? How else should i maybe do this?

Heres the mcfunctions that i used and dont work, but the logic "if ball is in red in = point for blue" worked earlier
#red out #red in execute if entity @s[x=-3,z=-7,y=-64,dx=23,dz=14.5,dy=100] if entity @s[x=2,z=-2,y=-64,dx=12,dz=9.5,dy=100] run scoreboard players set @n[tag=truth_holder_blue] point_truth_blue 1 #red out #last touch by team blue execute if entity @s[x=-3,z=-7,y=-64,dx=23,dz=14.5,dy=100] if entity @p[tag=last_touch,tag=team_blue] run scoreboard players set @n[tag=truth_holder_red] point_truth_red 1 #red out #last touch by team red execute if entity @s[x=-3,z=-7,y=-64,dx=23,dz=14.5,dy=100] if entity @p[tag=last_touch,tag=team_red] run scoreboard players set @n[tag=truth_holder_blue] point_truth_blue 1

unkempt sleet
#

Try this :
execute if entity @s[red out coordinates] unless entity @s[red in coordinates]

#

Should work to detect red out correctly and prevent it from firing two times

remote oar
#

Why are you using the cube check on @s rather than incorporating it in the @n selection?

#

I am asking this because execute as followed by a check on @s seems redundant. You could do both checks on @n and it wouldn't change the results

thick void
#

execute if entity @s[x=2,z=-2,y=-64,dx=12,dz=9.5,dy=100] run scoreboard players add @n[tag=blue_points] points 1
is working but this
execute if entity @s[x=-3,z=-7,y=-64,dx=23,dz=14.5,dy=100] unless entity @s[x=2,z=-2,y=-64,dx=12,dz=9.5,dy=100] if entity @p[tag=last_touch, tag=team_red] run scoreboard players add @n[tag=blue_points] points 1 execute if entity @s[x=-3,z=-7,y=-64,dx=23,dz=14.5,dy=100] unless entity @s[x=2,z=-2,y=-64,dx=12,dz=9.5,dy=100] if entity @p[tag=last_touch, tag=team_blue] run scoreboard players add @n[tag=red_points] points 1
the first one isnt

thick void
#

fixed, had to capitalize the Team of Team_red and Team_blue tag

thick void
frosty geyserBOT
frosty geyserBOT