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 |
|
|
|
| 12 Feb 2014 05:06 PM |
| too much 2 read break down the problem |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 13 Jun 2013 |
| Total Posts: 10006 |
|
| |
|
K1D4
|
  |
| Joined: 13 Jun 2013 |
| Total Posts: 10006 |
|
| |
|
K1D4
|
  |
| Joined: 13 Jun 2013 |
| Total Posts: 10006 |
|
| |
|
StackEnd
|
  |
| Joined: 20 Oct 2008 |
| Total Posts: 672 |
|
| |
|
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 |
|
|
|
| 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
|
  |
| Joined: 13 Jun 2013 |
| Total Posts: 10006 |
|
| |
|
K1D4
|
  |
| Joined: 13 Jun 2013 |
| Total Posts: 10006 |
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|