#I want to implement a picking up and throwing system, need help with push
1 messages · Page 1 of 1 (latest)
+1
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
direction of player is also a vector
Its a direction, iirc with magnitude 1 meaning normalised
but wouldn't that push them depending on the player's location, since if you ride another player they're gonna be in the same coords it's not gonna really work right??
atleast I'm assuming
? no
this gets the (normalised) vector they are facing
not their location
oh
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?
after you dismount, you dont have a passenger anymore
^ local var
Thanks
we're complete noobs, sorry
how do you do that exactly, set {_player} to player's passenger says it can only be set to one object
so that means player has multiple passengers thus player's passenger is an array
somehow
Idk how did you manage it
What??
literally didnt do anything 😭
how many players did you pick up
1
make it a list
cause the player could have multiple passengers
well its <none> if youre not holding anything and with our system there shouldnt be a way to hold multiple things because when you click it clears the passengers
isnt that just adding :: do the end of it
it still says the same error so idk
set {_hold::player} to player's passenger
clear passengers of player
push player's passengers in the direction of the player with speed 1```
it shouldnt be none you said it gave an error about multiple objects
I didnt know about adding * to it
you are trying to access a single element in the list with index player
I tried it with just ::
set this to the passengers expression
https://skripthub.net/docs/?id=944
multiple passengers were added in 1.11 thats why I was confused
also see this
≈~ suggests that you read Sovde's List Variable Tutorial
it works with mobs but it doesnt work with players
problem
I tried making it and adding a wait 2 ticks worked for me for some reason
idk why
huhh??
ok, cool, gonna have to test that later then
👍
I even tried with a wait 1 tick 😭
fr it took me a while too to figure it out
alright tyyy, it works
