A very good TELEPORT script?

Posts 1–2 of 2 · Page 1 of 1
A very good TELEPORT script?
Hello i have this teleport script

local PENETRATE = true -- set to 'nil' instead of 'true' if you don't want it to penetrate through walls, etc
local player_unit = managers.playerlayer_unit()
local camera = player_unit:camera()
local mvec_to = Vector3()
local from_pos = cameraosition()
mvector3.set( mvec_to, camera:forward() )
mvector3.multiply( mvec_to, 2000 )
mvector3.add( mvec_to, from_pos )
local col_ray = World:raycast( "ray", from_pos, mvec_to, "slot_mask", managers.slot:get_mask( "bullet_impact_targets" ) )
if col_ray then
if PENETRATE then
local offset = Vector3()
mvector3.set(offset, camera:forward())
mvector3.multiply(offset, 100)
mvector3.add(col_ray.hit_position, offset)
end
managers.player:warp_to(col_ray.hit_position, player_unit:rotation())
end

if managers.hud then
managers.hud:show_hint( { text = "TELEPORT" } )
end

IS not really good because it work sometime...sometime yes..sometime no..i want know if there is other script of teleport very good also where you can change the meteers to teleport you.help
Quote Originally Posted by Urazfenix88 View Post
Hello i have this teleport script

local PENETRATE = true -- set to 'nil' instead of 'true' if you don't want it to penetrate through walls, etc
local player_unit = managers.playerlayer_unit()
local camera = player_unit:camera()
local mvec_to = Vector3()
local from_pos = cameraosition()
mvector3.set( mvec_to, camera:forward() )
mvector3.multiply( mvec_to, 2000 )
mvector3.add( mvec_to, from_pos )
local col_ray = World:raycast( "ray", from_pos, mvec_to, "slot_mask", managers.slot:get_mask( "bullet_impact_targets" ) )
if col_ray then
if PENETRATE then
local offset = Vector3()
mvector3.set(offset, camera:forward())
mvector3.multiply(offset, 100)
mvector3.add(col_ray.hit_position, offset)
end
managers.player:warp_to(col_ray.hit_position, player_unit:rotation())
end

if managers.hud then
managers.hud:show_hint( { text = "TELEPORT" } )
end

IS not really good because it work sometime...sometime yes..sometime no..i want know if there is other script of teleport very good also where you can change the meteers to teleport you.help
That's the same script I use and it works just fine for me. Minus the Hud Text Display on Screen Part, don't really see the need for it to tell you it teleported when you can obliviously tell when you tele
Posts 1–2 of 2 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us