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: Help me with TP script

Previous Thread :: Next Thread 
drumman22 is online. 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
CoolioTree is not online. CoolioTree
Joined: 26 Dec 2012
Total Posts: 2509
07 Feb 2014 08:53 PM
Put it in the other teleport brick, I think?
Report Abuse
YumERAGON is not online. YumERAGON
Joined: 18 Apr 2012
Total Posts: 3893
07 Feb 2014 08:54 PM
Thus being "one way teleporter"
Report Abuse
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
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
CoolioTree is not online. CoolioTree
Joined: 26 Dec 2012
Total Posts: 2509
07 Feb 2014 08:55 PM
Oh, sorry.

@OP, I believe he trolled you...
Report Abuse
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
07 Feb 2014 08:59 PM
me?
Report Abuse
CoolioTree is not online. CoolioTree
Joined: 26 Dec 2012
Total Posts: 2509
07 Feb 2014 09:00 PM
No, his friend.
Report Abuse
CoolioTree is not online. CoolioTree
Joined: 26 Dec 2012
Total Posts: 2509
07 Feb 2014 09:00 PM
Ahhhhhh, that was a fragment, not a sentence...
Report Abuse
drumman22 is online. drumman22
Joined: 25 Aug 2009
Total Posts: 646
07 Feb 2014 09:00 PM
my friend trolled me? ;o
Report Abuse
CoolioTree is not online. CoolioTree
Joined: 26 Dec 2012
Total Posts: 2509
07 Feb 2014 09:01 PM
Possibly.

Or he sucks.
Report Abuse
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
07 Feb 2014 09:02 PM
Did my way work, or no?
Report Abuse
drumman22 is online. drumman22
Joined: 25 Aug 2009
Total Posts: 646
07 Feb 2014 09:02 PM
im about to check so wait :P
Report Abuse
drumman22 is online. 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
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
07 Feb 2014 09:07 PM
show me what you did.Post the script.
Report Abuse
drumman22 is online. 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
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
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 is online. 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
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
07 Feb 2014 09:13 PM
where did it teleport you to then?
Report Abuse
drumman22 is online. drumman22
Joined: 25 Aug 2009
Total Posts: 646
07 Feb 2014 09:14 PM
Nowhere. It did nothing ;/
Report Abuse
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
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 is online. drumman22
Joined: 25 Aug 2009
Total Posts: 646
07 Feb 2014 09:23 PM
It works! Thanks a lot :D.
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