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: A Nil Value?

Previous Thread :: Next Thread 
Jakeup10 is not online. Jakeup10
Joined: 29 Nov 2008
Total Posts: 6782
13 Mar 2012 09:45 AM
debounce = true
Num = Parent.Script.Value

function onTouched(hit)
if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true and Num == 1) then
debounce = false
h = Instance.new("Hat")
p = Instance.new("Part")
h.Name = "EggHatForEGGS"
p.Parent = h
p.Position = hit.Parent:findFirstChild("Head").Position
p.Name = "Handle"
p.formFactor = 0
p.Size = Vector3.new(2, 1, 1)
p.BottomSurface = 0
p.TopSurface = 0
p.Locked = true

h.Parent = hit.Parent
h.AttachmentPos = Vector3.new(0, .38, 0)
wait(5)
script.Parent.brick:remove()
debounce = true
end
end

script.Parent.Touched:connect(onTouched)

Yes I was trying to make a script which waits until the value = 1,but then I noticed it keeps going my stuff is a nil value?
I think it has to do with line 2,but I would also like help for the line after function touched,the one which says value = 1 then?
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
13 Mar 2012 10:50 AM
Num = Parent.Script.Value
Change to
Num = Script.Parent.Value
Report Abuse
SN0X is not online. SN0X
Joined: 24 Oct 2011
Total Posts: 7277
13 Mar 2012 11:05 AM
No, change to
script.Parent.Value

(script shouldn't be capitalized)
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
13 Mar 2012 11:12 AM
^^
Right, that's what I meant but I'm on my iPhone so, it always makes you capitalize the first letter of each line.
Report Abuse
SN0X is not online. SN0X
Joined: 24 Oct 2011
Total Posts: 7277
13 Mar 2012 11:13 AM
It does that on Android too. It's really annoying. You can turn it off, though, somewhere in the settings. Well, in Android you can.
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
13 Mar 2012 11:18 AM
ah. I found it and turned it off.
Report Abuse
Jakeup10 is not online. Jakeup10
Joined: 29 Nov 2008
Total Posts: 6782
13 Mar 2012 01:19 PM
But the value is in the script,so won't it need to go script.parent.script.Value?
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
13 Mar 2012 03:22 PM
No
Num = script.Value
Report Abuse
TINISH0TZ is not online. TINISH0TZ
Joined: 20 Nov 2009
Total Posts: 2549
13 Mar 2012 03:25 PM
In lua, you don't need to capitalize anything unless you're quoting.
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