What is equal to TeleportEntity()

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
velocity
Senior Member
Posts: 220
Joined: Sat May 10, 2014 6:17 pm

What is equal to TeleportEntity()

Postby velocity » Sat Oct 01, 2016 1:35 pm

I'm trying to push a client in a direction

What's equal to TeleportEntity(client, NULL_VECTOR, NULL_VECOTR, Velocity) in sourcepython?
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: What is equal to TeleportEntity()

Postby iPlayer » Sat Oct 01, 2016 3:37 pm

Syntax: Select all

from mathlib import Vector

...

player.teleport(velocity=Vector(1000, 0, 0))


It's also worth mentioning that you can use base_velocity to push the player:

Syntax: Select all

player.base_velocity = Vector(1000, 0, 0)


Setting base_velocity adds another vector to player's current velocity, while teleporting player sets player's velocity to that vector.
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
velocity
Senior Member
Posts: 220
Joined: Sat May 10, 2014 6:17 pm

Re: What is equal to TeleportEntity()

Postby velocity » Sun Oct 09, 2016 1:27 pm

Thank you for an example!

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 21 guests