|
| 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 |
|
|
| |
|
|
| 17 Feb 2016 07:08 PM |
Just move their whole character model
|
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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 |
|
|
| |
|
Haggie125
|
  |
| Joined: 02 Apr 2008 |
| Total Posts: 761 |
|
| |
|
|
| 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
|
  |
| Joined: 02 Apr 2008 |
| Total Posts: 761 |
|
|
| 17 Feb 2016 07:24 PM |
| That's the same thing you started with? |
|
|
| Report Abuse |
|
|
|
| 17 Feb 2016 07:25 PM |
The slight difference was that script was in a model.
|
|
|
| Report Abuse |
|
|
|
| 17 Feb 2016 07:26 PM |
And Touched isn't a member of model, obviously.
@feqi
didn't do anything |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|