#how to implement point system in volleyball game
1 messages · Page 1 of 1 (latest)
nvm i got it
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
-# (helpers summoned) <@&1166082198152159386> <@&1202694677766348840>
How are you making the ball ?
Overall you need to give more details about how your pack is working
alr
i jsut realised idk how to ping a thread
https://discord.com/channels/935560260725379143/1431540819302551602
this is the other one, harder to find bc i asked the wrong question
To me your best option is to tag the ball when a player touch the ball, then just check that tag
so the ball has that tag until it is touched again
Yes
but all players would need seperate tags too, right?
Unless you are using a team system probably
idk how to do that, i think id be more comfortable with just tags
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
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?
Yes
Just make sure to also apply curse of vanishing to the saddle so players won't drop them if they die 😉😅
Ok xD
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
here i can just clear everyones horse slot if they have one before aplying the new one
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
the execute does not work, it only works correctly if i am close to it it seems like
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
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
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
the code i pasted in here is pretty much nonsense, idk if it answers your question but that .mcfunction file is being ran by the ball, therefore @s
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
fixed, had to capitalize the Team of Team_red and Team_blue tag
alr it is working wonderfully, thanks