drumman22
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 646 |
|
|
| 07 Feb 2014 08:52 PM |
a Friend has scripted me this One Way Teleporter script. But the problem is it will only work once in the game and then never again. Can someone help me.
Here is the script..
modelname="Be-teleported-to"
function onTouched(part) if part.Parent ~= nil then local h = part.Parent:findFirstChild("Humanoid") local q = part.Parent q.Head.Transparency = 0.5 q.Torso.Transparency = 0.5 q:findFirstChild("Right Arm").Transparency = 0.5 q:findFirstChild("Left Arm").Transparency = 0.5 q:findFirstChild("Right Leg").Transparency = 0.5 q:findFirstChild("Left Leg").Transparency = 0.5 wait(0.5) q.Head.Transparency = 0 q.Torso.Transparency = 0 q:findFirstChild("Right Arm").Transparency = 0 q:findFirstChild("Left Arm").Transparency = 0 q:findFirstChild("Right Leg").Transparency = 0 q:findFirstChild("Left Leg").Transparency = 0 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("No teleporter lol") end end end end end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 08:53 PM |
| Put it in the other teleport brick, I think? |
|
|
| Report Abuse |
|
|
YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
|
| 07 Feb 2014 08:54 PM |
| Thus being "one way teleporter" |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 08:55 PM |
an easy way would be
location = Put coordinates for other teleporter here
function hit(h) if h.Parent:findFirstChild("Humanoid") then h.Parent:MoveTo(location) end end
script.Parent.Touched:connect(hit) |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 08:55 PM |
Oh, sorry.
@OP, I believe he trolled you... |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 07 Feb 2014 09:00 PM |
| Ahhhhhh, that was a fragment, not a sentence... |
|
|
| Report Abuse |
|
|
drumman22
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 646 |
|
| |
|
| |
|
| |
|
drumman22
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 646 |
|
|
| 07 Feb 2014 09:02 PM |
im about to check so wait :P
|
|
|
| Report Abuse |
|
|
drumman22
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 646 |
|
|
| 07 Feb 2014 09:06 PM |
| doesn't seem to work :/ That or I'm not doing it correct. |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 09:07 PM |
| show me what you did.Post the script. |
|
|
| Report Abuse |
|
|
drumman22
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 646 |
|
|
| 07 Feb 2014 09:09 PM |
| I put the script into a brick and posted the coordinates to where I want it to go to. and didn't seem to work. I don't know how to script barely so I don't know if that was what I was supposed to do. |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 09:11 PM |
location = Put coordinates for other teleporter here
That means go to the other brick you want the person to be teleported to and copy and paste the position of that brick in the script.
an example is:
location = 123,456,789 |
|
|
| Report Abuse |
|
|
drumman22
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 646 |
|
|
| 07 Feb 2014 09:12 PM |
| Yeah I know and I did that. But when I stepped on the TP it didn't teleport me to the set coordinates :/ |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 09:13 PM |
| where did it teleport you to then? |
|
|
| Report Abuse |
|
|
drumman22
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 646 |
|
|
| 07 Feb 2014 09:14 PM |
| Nowhere. It did nothing ;/ |
|
|
| Report Abuse |
|
|
|
| 07 Feb 2014 09:17 PM |
location = game.Workspace["Name Of Brick Here"] --[[If its not in workspace and inside a model or something, tell me]]
function hit(h) if h.Parent:findFirstChild("Humanoid") then h.Parent:MoveTo(location.Position) end end
script.Parent.Touched:connect(hit)
--Make sure this is inside the brick |
|
|
| Report Abuse |
|
|
drumman22
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 646 |
|
|
| 07 Feb 2014 09:23 PM |
| It works! Thanks a lot :D. |
|
|
| Report Abuse |
|
|