generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: One way tele position help

Previous Thread :: Next Thread 
K1D4 is not online. K1D4
Joined: 13 Jun 2013
Total Posts: 10006
12 Feb 2014 05:05 PM
------------------------------------
modelname="teleporter1b"
------------------------------------

function onTouched(part)
if part.Parent ~= nil then
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil then
local teleportfrom=script.Parent.Enabled.Value
if teleportfrom~=0 then
if h==humanoid then
return
end
local teleportto=script.Parent.Parent:findFirstChild(modelname)
if teleportto~=nil then
local torso = h.Parent.Torso
local location = {teleportto.Position}
local i = 1

local x = location[i].x
local y = location[i].y
local z = location[i].z

x = x + math.random(-1, 1)
z = z + math.random(-1, 1)
y = y + math.random(2, 3)

local cf = torso.CFrame
local lx = 0
local ly = y
local lz = 0

script.Parent.Enabled.Value=0
teleportto.Enabled.Value=0
torso.CFrame = CFrame.new(Vector3.new(x,y,z), Vector3.new(lx,ly,lz))
wait(3)
script.Parent.Enabled.Value=1
teleportto.Enabled.Value=1
else
print("Could not find teleporter!")
end
end
end
end
end

script.Parent.Touched:connect(onTouched)


The problem is, lets say I'm making an obby and I jump in [ lava = tele 1 ] once I go to tele 2 [ back to the start of the obby. ], I bounce up then back down. Is there a way to fix this?
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
12 Feb 2014 05:06 PM
too much 2 read break down the problem
Report Abuse
K1D4 is not online. K1D4
Joined: 13 Jun 2013
Total Posts: 10006
12 Feb 2014 05:08 PM
Well, I want to not bounce when landing to tele 2 when jumping into tele 1
Report Abuse
K1D4 is not online. K1D4
Joined: 13 Jun 2013
Total Posts: 10006
12 Feb 2014 05:15 PM
B-b-b-BUMPPPP
Report Abuse
K1D4 is not online. K1D4
Joined: 13 Jun 2013
Total Posts: 10006
12 Feb 2014 05:23 PM
Rumpity bump bump
Report Abuse
K1D4 is not online. K1D4
Joined: 13 Jun 2013
Total Posts: 10006
12 Feb 2014 05:27 PM
mooooo3 my garden tool
Report Abuse
StackEnd is not online. StackEnd
Joined: 20 Oct 2008
Total Posts: 672
12 Feb 2014 05:28 PM
Google "debounce"
Report Abuse
K1D4 is not online. K1D4
Joined: 13 Jun 2013
Total Posts: 10006
12 Feb 2014 05:31 PM
says something that keeps a system from running too many times
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
12 Feb 2014 05:36 PM
Whats up Kida. Btw, that is a free model I think. :P

try this:

script.Parent.Touched:connect(function(hit)
h = hit:findFirstChild("Humanoid")
if h ~= nil then
hit:MoveTo(Vector3.new(0,0,0,0)) --Change the 0 to the position the player is being teleported. Put this script inside a brick.
end
end)

Tell me if it works.
Report Abuse
K1D4 is not online. K1D4
Joined: 13 Jun 2013
Total Posts: 10006
12 Feb 2014 05:36 PM
It is a fm
Report Abuse
K1D4 is not online. K1D4
Joined: 13 Jun 2013
Total Posts: 10006
12 Feb 2014 05:37 PM
oh and yo bro
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
12 Feb 2014 05:37 PM
Try what I said. It only teleports the person once, unless they touch it again. So it is a "One way teleport."
Report Abuse
K1D4 is not online. K1D4
Joined: 13 Jun 2013
Total Posts: 10006
12 Feb 2014 05:44 PM
I don't think it worked, I put this script inside of the brick

script.Parent.Touched:connect(function(hit)
h = hit:findFirstChild("Humanoid")
if h ~= nil then
hit:MoveTo(Vector3.new(-328.82, -2.785, -103.75)) --Change the 0 to the position the player is being teleported. Put this script inside a brick.
end
end)
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
12 Feb 2014 05:49 PM
script.Parent.Touched:connect(function(hit)
h = hit.Parent:findFirstChild("Humanoid")
if h ~= nil then
hit:MoveTo(Vector3.new(-328.82, -2.785, -103.75)) --Change the 0 to the position the player is --being teleported. Put this script inside a--------brick.
end
end)

or

script.Parent.Touched:connect(function(hit)
h = hit.Parent:findFirstChild("Humanoid")
if h ~= nil then
hit.Parent:MoveTo(Vector3.new(-328.82, -2.785, -103.75)) --Change the 0 to the position the player is being teleported. Put this script inside a --brick.
end
end)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image