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: Someone help me find the "nil value" in this code

Previous Thread :: Next Thread 
cheetosrevenge is not online. cheetosrevenge
Joined: 15 Apr 2011
Total Posts: 12565
06 Jul 2014 11:05 AM
Just started scripting today, don't know what im doing wrong.

local brick = Workspace.P1



function ontouch(part)
brick.Transparency = 0
wait(0.5)
brick.Transparency = 0.3
wait(0.5)
brick.Transparency = 0.5
wait(0.5)
brick.Transparency = 0.7
wait(0.5)
brick.Transparency = 0.9

end
brick.Touched:connect(onTouch)

chk chk boom
Report Abuse
lateregistration is not online. lateregistration
Joined: 02 Apr 2013
Total Posts: 2630
06 Jul 2014 11:11 AM
variables are case sensitive, and you did onTouch when trying to connect the ontouch function. you never defined onTouch so it calls a error when u try to connect it to an event.
Report Abuse
Dicentium is not online. Dicentium
Joined: 28 Aug 2011
Total Posts: 18560
06 Jul 2014 11:12 AM
capatilize ontouch in the function

ex : function onTouch(part)

it should work then

since you capatilized this: brick.Touched:connect(onTouch) <- onTouch

but you didn't capatilize this: function ontouch(part) <- ontouch
Report Abuse
Temppeliherra is not online. Temppeliherra
Joined: 24 May 2014
Total Posts: 259
06 Jul 2014 12:56 PM
Output log would've been useful for this, but yeah the poster above me is right.
Report Abuse
CoolioTree is not online. CoolioTree
Joined: 26 Dec 2012
Total Posts: 2509
06 Jul 2014 02:53 PM
"local brick = Workspace.P1



function ontouch(part)
brick.Transparency = 0
wait(0.5)
brick.Transparency = 0.3
wait(0.5)
brick.Transparency = 0.5
wait(0.5)
brick.Transparency = 0.7
wait(0.5)
brick.Transparency = 0.9

end
brick.Touched:connect(onTouch)"

I think it's because brick was defined locally, and also, you never used the argument.

local brick = Workspace.P1



function ontouch(part)
part.Transparency = 0
wait(0.5)
part.Transparency = 0.3
wait(0.5)
part.Transparency = 0.5
wait(0.5)
part.Transparency = 0.7
wait(0.5)
part.Transparency = 0.9

end
brick.Touched:connect(onTouch)
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