#I want to implement a picking up and throwing system, need help with push

1 messages · Page 1 of 1 (latest)

hardy coral
#

I want a player to pick up and throw another player, I have the picking up system working but I dont know how to apply push in the direction that the vehicle player is looking in to the passenger player

solid valve
#

+1

upbeat oasis
#

you might be able to do it with vectors, but my thought was push player's passengers in the horizontal (and vertical) direction of the player with speed 0.3

#

of course clear passengers of player first

dapper copper
#

direction of player is also a vector

#

Its a direction, iirc with magnitude 1 meaning normalised

hardy coral
#

atleast I'm assuming

dapper copper
#

? no

dapper copper
#

not their location

hardy coral
#

oh

solid valve
# dapper copper `direction of player` is also a vector

I tried to implement this but it didn't work? This is our code:

    if attacker is sneaking:
        wait 2 ticks
        make the victim ride the attacker
        
on click:
    dismount the passenger from player
    push player's passengers in the direction of the player with speed 0.3 ```
#

The passenger just dismounts, it doesn't get pushed?

frank bear
#

after you dismount, you dont have a passenger anymore

solid valve
#

Oh

#

:P

#

How would we do that though?

frank bear
#

its common sense

#

store passenger before dismounting

dapper copper
#

^ local var

solid valve
#

Thanks

hardy coral
hardy coral
frank bear
#

so that means player has multiple passengers thus player's passenger is an array

#

somehow

#

Idk how did you manage it

solid valve
#

What??

hardy coral
frank bear
#

how many players did you pick up

solid valve
#

1

frank bear
#

weird idk

#

broadcast "%player's passenger%"

#

debug

dapper copper
#

cause the player could have multiple passengers

hardy coral
hardy coral
#

it still says the same error so idk

dapper copper
#

basically

hardy coral
#
    set {_hold::player} to player's passenger
    clear passengers of player
    push player's passengers in the direction of the player with speed 1```
solid valve
frank bear
dapper copper
#

you are still using a single variable not a list

#

{_passengers::*}

hardy coral
#

I didnt know about adding * to it

dapper copper
dapper copper
solid valve
#

It works!

#

:D

frank bear
#

also see this

ebon trailBOT
hardy coral
#

problem

upbeat oasis
#

I tried making it and adding a wait 2 ticks worked for me for some reason

#

idk why

hardy coral
#

huhh??

upbeat oasis
#

not 1 tick

#

but 2 ticks

hardy coral
#

ok, cool, gonna have to test that later then

upbeat oasis
#

👍

hardy coral
upbeat oasis
#

fr it took me a while too to figure it out