• Hey! Register here to create your account, engage with the community, and talk about what is new!

How can I make it so a player can grab another and throw them at any point?

onion_hq

New member
Joined
Dec 23, 2023
Messages
14
Reaction score
0
I already figured out code to let a player Right Click another to put them on their head, but can't figure out how to make it so if they right click while carrying a player that player gets thrown
 

RodaballoXD

New member
Joined
Mar 18, 2024
Messages
29
Reaction score
2
OK. I guess you have a loop that selects the player you are going to teleport, and uses some set vars and player action to teleport the player infinitely.

When the players starts to carry another, you should set a game variable called %default carrying (or anything that has %default in its name) to 1. The loop shouldn't have a repeat forever block, it should be repeat while %default carrying = 1.

When you want the player to stop carrying, you just have to set %default carrying to 0, so the loop breaks.
 

onion_hq

New member
Joined
Dec 23, 2023
Messages
14
Reaction score
0
OK. I guess you have a loop that selects the player you are going to teleport, and uses some set vars and player action to teleport the player infinitely.

When the players starts to carry another, you should set a game variable called %default carrying (or anything that has %default in its name) to 1. The loop shouldn't have a repeat forever block, it should be repeat while %default carrying = 1.

When you want the player to stop carrying, you just have to set %default carrying to 0, so the loop breaks.
I already have that, the problem now is how do I throw the grabbed player?
 

RodaballoXD

New member
Joined
Mar 18, 2024
Messages
29
Reaction score
2
After the loop, outside of the brackets, use some launch player actions. Or you can get the direction the player who is carrying is looking, give that vector whatever length you want, and set the speed of the player that was been carried to that.
 
Last edited:

onion_hq

New member
Joined
Dec 23, 2023
Messages
14
Reaction score
0
The issue here is that I'm using "Right Click" event to allow the grabbing player to throw the other one, but how do I select the grabbed player? Victim doesn't work in this event. Would it be some kind of Select Object?
 

RodaballoXD

New member
Joined
Mar 18, 2024
Messages
29
Reaction score
2
I don't really know exactly what to do, but surely you'll have to use Select Object. Maybe you can Select default target, invert selection and then filter by distance, that will not select what the player was looking at, but the closet one. Anyways, if you have managed to select the player that gets on top of the player that RClicked, you should be able to use that same selection when throwing them away.
 
Top Bottom