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 » Scripters
Home Search
 

Re: Teleportation help..

Previous Thread :: Next Thread 
Kramer777 is not online. Kramer777
Joined: 07 Sep 2013
Total Posts: 14696
17 Feb 2016 02:41 PM
The script works fine in studio, but not in game.

function onTouched()
game:GetService('TeleportService'):Teleport(364909697)
end
script.Parent.Touched:connect(onTouched)


Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
17 Feb 2016 02:43 PM
need to define the second parameter, player.

also i dont think teleportservice works in studio
Report Abuse
Kramer777 is not online. Kramer777
Joined: 07 Sep 2013
Total Posts: 14696
17 Feb 2016 02:44 PM
It's a multi place game..


Report Abuse
Kramer777 is not online. Kramer777
Joined: 07 Sep 2013
Total Posts: 14696
17 Feb 2016 02:49 PM
Bump


Report Abuse
128Gigabytes is online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
17 Feb 2016 02:52 PM
need to define the second parameter, player.

also i dont think teleportservice works in studio [2]

Why did you point out that its a game universe? That has nothing to do with it.
Report Abuse
Kramer777 is not online. Kramer777
Joined: 07 Sep 2013
Total Posts: 14696
17 Feb 2016 02:53 PM
No, the place that it teleports to is in the game universe...


Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
17 Feb 2016 02:53 PM
mk so

script.Parent.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
-- teleport stuff
end)
Report Abuse
128Gigabytes is online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
17 Feb 2016 02:55 PM
That doesn't even make sense.
The hub world and all the sub worlds are all part of the game universe.

And it still doesn't make a difference either way.
Report Abuse
Kramer777 is not online. Kramer777
Joined: 07 Sep 2013
Total Posts: 14696
17 Feb 2016 02:56 PM
Then I guess I'm an outlaw.
'cause it works on studio..
But not in game..


Report Abuse
Kramer777 is not online. Kramer777
Joined: 07 Sep 2013
Total Posts: 14696
17 Feb 2016 03:01 PM
I've tried everything..
It only works in studio..
Could it be that I need to change it to a local script?


Report Abuse
128Gigabytes is online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
17 Feb 2016 03:02 PM
I just tested it and it definitely doesn't work in studio.

Either way that is not important, you need to define the player for it to work in a server.
Report Abuse
Kramer777 is not online. Kramer777
Joined: 07 Sep 2013
Total Posts: 14696
17 Feb 2016 03:03 PM
That's because you didn't make the game... I did... You can teleport t games you've made.. Just not someone else's..


Report Abuse
Kramer777 is not online. Kramer777
Joined: 07 Sep 2013
Total Posts: 14696
17 Feb 2016 03:04 PM
And how would I define player?
I'm kinda new to this part of scripting 3:


Report Abuse
128Gigabytes is online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
17 Feb 2016 03:06 PM
I know that, I changed it to teleport to my place.

It doesn't work in studio, because the game doesn't know you are Kramer777 in studio it just knows you are 'Player'


Your script never says "Hey this is the player that touched me teleport them here"
It just says "teleport here"

Who do you expect it to teleport if you don't tell it who?
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
17 Feb 2016 03:06 PM
Read the code I posted..
Report Abuse
Kramer777 is not online. Kramer777
Joined: 07 Sep 2013
Total Posts: 14696
17 Feb 2016 03:06 PM
^^
Tried that. Didn't work either.


Report Abuse
128Gigabytes is online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
17 Feb 2016 03:09 PM
local teleportService = game:getService("TeleportService")

script.Parent.Touched:connect(function(basePart)
local player = game.Players:getPlayerFromCharacter(basePart.Parent)
if (player) then
teleportService:Teleport(364909697, player)
end
end)
Report Abuse
Kramer777 is not online. Kramer777
Joined: 07 Sep 2013
Total Posts: 14696
17 Feb 2016 03:14 PM
@Giga
Thanks.. Finally got it working
If you wanna check out the thing I'm making here's the link:
http://www.roblox.com/games/363503545/ROBLOX-Story-Mode-Alpha


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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