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 » Scripting Helpers
Home Search
 

Re: Script's broken. Help?

Previous Thread :: Next Thread 
wwemaniac99 is not online. wwemaniac99
Joined: 10 Mar 2010
Total Posts: 41496
08 Apr 2012 01:10 PM
== Output: Workspace.Part.Script:1:attempt to index global 'Script' (a nil value)

local door = Script.Parent -- Script.Parent refers to the Part the Script is in.
function onTouch() -- When the brick is touched... (start of function)
door.CanCollide = false -- Now we can walk through it
door.Transparency = 0.5 -- Now is semi-transparent
door.BrickColor = BrickColor:Random() -- Assigns a random color
wait(2) -- 2 seconds later...
door.CanCollide = true -- Now we can no longer walk through the door
door.Transparency = 0 -- Now is not transparent
door.BrickColor = BrickColor:Random() -- Assigns another random color
end -- ends function
door.Touched:connect(onTouch) -- door is now connected to our function
Report Abuse
wwemaniac99 is not online. wwemaniac99
Joined: 10 Mar 2010
Total Posts: 41496
08 Apr 2012 01:17 PM
bump
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
08 Apr 2012 01:21 PM
It is "script.Parent", notice the lowercase "s".

† KMXD †
Report Abuse
wwemaniac99 is not online. wwemaniac99
Joined: 10 Mar 2010
Total Posts: 41496
08 Apr 2012 01:27 PM
Thanks KNIGHT, that works, but I don't understand. The Script is named "Script", with a capital S, so why should it be lowercase
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
08 Apr 2012 01:32 PM
You can name the script anything, but to access it, the variable is always "script".

† KMXD †
Report Abuse
Xtreme101 is not online. Xtreme101
Joined: 03 Jan 2009
Total Posts: 4385
08 Apr 2012 01:33 PM
'script' refers to the script that the code is in, so it basicly doesn't matter what the name of it is. That is just used for organizing.
Report Abuse
Xtreme101 is not online. Xtreme101
Joined: 03 Jan 2009
Total Posts: 4385
08 Apr 2012 01:34 PM
Dang it Knight...

Plus I joined a week or two before ya.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
08 Apr 2012 01:36 PM
Ok, does it matter...? Though I am jealous of your hat. I hadn't learn to script 'till last year.

:c

† KMXD †
Report Abuse
wwemaniac99 is not online. wwemaniac99
Joined: 10 Mar 2010
Total Posts: 41496
08 Apr 2012 01:54 PM
Oh ok, that makes since. Thanks.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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