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: I dont understand a script...

Previous Thread :: Next Thread 
breifmanny is not online. breifmanny
Joined: 23 Dec 2011
Total Posts: 341
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
breifmanny is not online. breifmanny
Joined: 23 Dec 2011
Total Posts: 341
05 Aug 2016 03:41 AM
Typo, the first code line said "exitname = "Exit""
Report Abuse
Laedere is not online. 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
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