|
| 05 Aug 2016 03:40 AM |
I was looking at a script made by aurarus since some people said look at other peoples scripts to learn...
-- Made by Aurarus -- --------------------------- exitname = "Exit" ---------------------------
function onTouch(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Parent:FindFirstChild("Torso") then
local exit = script.Parent.Parent:FindFirstChild(exitname) -- Directory
hit.Parent.Torso.CFrame = CFrame.new(exit.Position.X, exit.Position.Y + 25, exit.Position.Z) end end
script.Parent.Touched:connect(onTouch)
I get most of the script except the "exitname = Exit"... when he says "exit = script.Parent.Parent:FindFirstChild(exitname)" I dont get it. What I see is him calling "exit" a nil value because he went to workspace and checked for exitname, but exitname isnt a part or anything its a word...? Could someone help explain this?
the part the script belongs to is named "Entrance" and the part the teleporter is supposed to teleport you to is called "Exit"
|
|
|
| Report Abuse |
|
|
|
| 05 Aug 2016 03:41 AM |
| Typo, the first code line said "exitname = "Exit"" |
|
|
| Report Abuse |
|
|
Laedere
|
  |
| Joined: 17 Jun 2013 |
| Total Posts: 23601 |
|
|
| 05 Aug 2016 03:46 AM |
"local exit = script.Parent.Parent:FindFirstChild(exitname) -- Directory"
Basically finds the first child of script.Parent.Parent named "Exit"
|
|
|
| Report Abuse |
|
|