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: 'Attempt to call a nil value'

Previous Thread :: Next Thread 
MangoStudio is not online. MangoStudio
Joined: 12 Sep 2012
Total Posts: 2685
15 Jan 2014 03:13 PM
function onTouched()
wait()
local clone = game.Lighting.Car:Clone()
clone.Parent = workspace
end
script.Parent.Touched:connect(Touched)



There's a model in 'Lighting' called 'Car' that I'm trying to copy and paste into Workspace. why isn't is working?
Report Abuse
MangoStudio is not online. MangoStudio
Joined: 12 Sep 2012
Total Posts: 2685
15 Jan 2014 03:16 PM
Bump.
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
15 Jan 2014 03:17 PM
game.Workspace
Report Abuse
MangoStudio is not online. MangoStudio
Joined: 12 Sep 2012
Total Posts: 2685
15 Jan 2014 03:18 PM
@vl

What?
Report Abuse
Wakarimasu is not online. Wakarimasu
Joined: 12 Nov 2013
Total Posts: 1448
15 Jan 2014 03:20 PM
No, saying workspace works so that isn't wrong. Don't try to correct something if you don't know anything about it.

The problem was your connection. Change to this:

script.Parent.Touched:connect(onTouced)
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
15 Jan 2014 03:20 PM
Ignore him, workspace is an automatically set variable that points to Game.Workspace.


Anyway, your error is in the connection line.

You named your function 'onTouched' and then connected to a function named 'Touched', which doesn't exist.

Change

script.Parent.Touched:connect(Touched)

to

script.Parent.Touched:connect(onTouched)
Report Abuse
MangoStudio is not online. MangoStudio
Joined: 12 Sep 2012
Total Posts: 2685
15 Jan 2014 03:24 PM
Ahh I see.
Thanks guys.
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
15 Jan 2014 03:27 PM
I wasent sure, but might worth a try.
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