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
 

Quick question 2

Previous Thread :: Next Thread 
Gofven is not online. Gofven
Joined: 18 Jun 2015
Total Posts: 767
07 Nov 2016 11:21 AM
I want a single player to teleport from part 1 to part 2 instantly after walking into this door, but how?

local tele = game.Workspace.TcCore.Elevators.Doors

function Teleport(Player, MainTele, TargetTele)

Player.Humanoid:MoveTo(TargetTele.Position)

end
local MainTele = tele.DoorOutside
local TargetTele = tele.Teleporty

MainTele.Touched:Connect(function(hit)
Teleport(hit.Parent, MainTele, TargetTele)
end)
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
07 Nov 2016 11:39 AM
tele = workspace.TcCore.Elevators.Doors -- may have to wait for this to be loaded
MainTele = tele.DoorOutside
TargetTele = tele.Teleporty

MainTele.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
hit.Parent.HumanoidRootPart.CFrame = TargetTele.CFrame
end
end)



Report Abuse
Gofven is not online. Gofven
Joined: 18 Jun 2015
Total Posts: 767
07 Nov 2016 12:28 PM
Thanks man, extra quick question - How do I change their teamcolor? It cannot be changed trough their humanoid right?
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
07 Nov 2016 12:37 PM
You can use the player variable we assigned that uses :GetPlayerFromCharacter() on the hit.Parent
player.TeamColor = BrickColor.new("Bright red")


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