How to push a player toward something?

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

pepper82

Member
Jan 26, 2017
272
1
18
41
Hey all,

I want to push a player toward an enemy in a nice way, look at the picture:
ecn8dgL.png

I do not want the player to be pushed straight.

How to do it?
 
Needs SkQuery.

Syntax:
code_language.skript:
#Skript
(push|thrust) %entities% %direction% [(at|with) (speed|velocity|force) %number%]

#SkQuery (Returns direction)
[the] direction from %location% to %location%

Examples:
code_language.skript:
push player (direction from player to {_loc}) at speed 2.5

push player (direction from player to location of {_player}) at speed 3
If you want them to get an arc, push them up and wait a tick before using the code above.
 
Status
Not open for further replies.