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: Teleport to CFrame on touch

Previous Thread :: Next Thread 
iPenguinSuperTime is not online. iPenguinSuperTime
Joined: 25 Apr 2012
Total Posts: 3757
17 Feb 2016 06:59 PM
function onTouched(part)
local player = game:GetPlayers()
local char = player.Character
player.char.Torso.CFrame = CFrame.new(90.7299805, 0.600009024, -23.1899891) --input CFrame here

end


script.Parent.Touched:connect(onTouched)




y u no work
Report Abuse
iPenguinSuperTime is not online. iPenguinSuperTime
Joined: 25 Apr 2012
Total Posts: 3757
17 Feb 2016 07:07 PM
bump
Report Abuse
jhend27513 is not online. jhend27513
Joined: 17 Sep 2011
Total Posts: 3369
17 Feb 2016 07:08 PM
Just move their whole character model

Report Abuse
Haggie125 is not online. Haggie125
Joined: 02 Apr 2008
Total Posts: 761
17 Feb 2016 07:10 PM
The CFraming their torso part is fine, you just aren't getting the players correctly. Youll have to do a loop to get to each player, like this:

local PlayerTable = game.Players:GetChildren()
for i=1,#PlayerTable do
local Character = PlayerTable[i].Character
if Character and Character:FindFirstChild("Torso") then
Character.Torso.CFrame = CFrame.new(...) --Input CFrame here
end
end
Report Abuse
feqi is not online. feqi
Joined: 15 Feb 2016
Total Posts: 35
17 Feb 2016 07:10 PM
function onTouched(part)
if part.Parent:findFirstChild("Torso") then
part.Parent.Torso.CFrame = CFrame.new(Vector3.new(90.7299805, 0.600009024, -23.1899891)) --input CFrame here
end
end


script.Parent.Touched:connect(onTouched)
Report Abuse
Haggie125 is not online. Haggie125
Joined: 02 Apr 2008
Total Posts: 761
17 Feb 2016 07:14 PM
Oh I ignored half of what I read and assumed you wanted to teleport everyone. Heh.
Report Abuse
iPenguinSuperTime is not online. iPenguinSuperTime
Joined: 25 Apr 2012
Total Posts: 3757
17 Feb 2016 07:18 PM
so how can I fix it?
Report Abuse
Haggie125 is not online. Haggie125
Joined: 02 Apr 2008
Total Posts: 761
17 Feb 2016 07:20 PM
Do what feqi said
Report Abuse
iPenguinSuperTime is not online. iPenguinSuperTime
Joined: 25 Apr 2012
Total Posts: 3757
17 Feb 2016 07:22 PM
>>>"GetPlayers is not a valid member of DataModel"

function onTouched(part)
local player = game:GetPlayers()
local char = player.Character
player.char.Torso.CFrame = CFrame.new(90.7299805, 0.600009024, -23.1899891) --input CFrame here

end


script.Parent.Head.Touched:connect(onTouched)
Report Abuse
Haggie125 is not online. Haggie125
Joined: 02 Apr 2008
Total Posts: 761
17 Feb 2016 07:24 PM
That's the same thing you started with?
Report Abuse
iPenguinSuperTime is not online. iPenguinSuperTime
Joined: 25 Apr 2012
Total Posts: 3757
17 Feb 2016 07:25 PM
The slight difference was that script was in a model.

Report Abuse
iPenguinSuperTime is not online. iPenguinSuperTime
Joined: 25 Apr 2012
Total Posts: 3757
17 Feb 2016 07:26 PM
And Touched isn't a member of model, obviously.

@feqi

didn't do anything
Report Abuse
UnstableScript0 is not online. UnstableScript0
Joined: 21 Dec 2015
Total Posts: 1189
17 Feb 2016 07:28 PM
local CFrame = CFrame.new(0, 0, 0)

function onTouched(part)
if game.Players:GetPlayerFromCharacter(part.Parent) then
part.Parent:MoveTo(CFrame.p)
end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
ShrekWillGetYou is not online. ShrekWillGetYou
Joined: 31 Oct 2010
Total Posts: 550
17 Feb 2016 07:31 PM
function onTouched(hit)
hit.Parent:MoveTo(0,0,0) -- position here
end

script.Parent.Touched:connect(onTouched)



Report Abuse
iPenguinSuperTime is not online. iPenguinSuperTime
Joined: 25 Apr 2012
Total Posts: 3757
17 Feb 2016 07:37 PM
I appreciate everyone's help with this!

Unstable, you the man.

For whatever reason, the script wasn't in the part, so the parent of the script was model, which invalidates touched.


Thanks, everybody! :)
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