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: I need help, again

Previous Thread :: Next Thread 
akuma67 is not online. akuma67
Joined: 17 Aug 2014
Total Posts: 69
01 Aug 2017 12:28 PM
I'm trying to make it so that when you touch a block, you get teleported to another place. It doesn't work, here's my current code:

local TeleportService = game:GetService("TeleportService")
local level1Id = 953034005
local level2Id = 953034005

function onTouched(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
TeleportService:Teleport(level1Id, player)
end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
Artismz is not online. Artismz
Joined: 14 Jun 2016
Total Posts: 979
01 Aug 2017 12:40 PM
You made the levels the exact same place...


Report Abuse
akuma67 is not online. akuma67
Joined: 17 Aug 2014
Total Posts: 69
01 Aug 2017 12:45 PM
@Artismz Oh yeah, I screwed up
Report Abuse
akuma67 is not online. akuma67
Joined: 17 Aug 2014
Total Posts: 69
01 Aug 2017 12:50 PM
I edited it: local TeleportService = game:GetService("TeleportService")
local level1Id = 953034005
local level2Id = 952998887

function onTouched(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
TeleportService:Teleport(level1Id, player)
end
end

script.Parent.Touched:connect(onTouched)
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