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 |
|
|
|
| 13 Mar 2012 10:50 AM |
Num = Parent.Script.Value Change to Num = Script.Parent.Value |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 13 Mar 2012 11:18 AM |
| ah. I found it and turned it off. |
|
|
| Report Abuse |
|
|
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 |
|
|
| |
|
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 |
|
|