DukeCow
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 13176 |
|
|
| 01 Aug 2014 10:08 PM |
I made 2 bricks, green and red. When you touch on let's say the green one, it'd teleport you to the position of the red one, but 5 studs up. Green and red are in a model, this script is inside of green script.Parent.Touched:connect(function(hit) local hum = hit.Parent:findFirstChild("Humanoid") if hum ~= nil then hit.Parent.Position = Vector3.new(script.Parent.Parent.red.Position.X, script.Parent.Parent.red.Position.Y + 5, script.Parent.Parent.red.Position.Z) end end) |
|
|
| Report Abuse |
|
Tauritaar
|
  |
| Joined: 30 Dec 2012 |
| Total Posts: 1785 |
|
|
| 01 Aug 2014 10:16 PM |
Your situation is great exercise for my mind. Thank you.
--SCRIPT--
local red = script.Parent.Parent.Red local green = script.Parent local model = script.Parent.Parent
function onTouch(hit) local human = hit.Parent.Humanoid human.Parent:findFirstChild("Torso").Position = red.Position.x, red.Position.y + 5, red.Position.z end
function onTouch(hit2) human.Parent:findFirstChild("Torso").Position = green.Position.x, green.Position.y + 5, green.Position.z end
script.Parent.Touched:connect(onTouch) script.Parent.Parent.Red.Touched:connect(onTouch) |
|
|
| Report Abuse |
|