RoScripts
|
  |
| Joined: 27 Oct 2012 |
| Total Posts: 1824 |
|
|
| 23 Jan 2013 09:25 PM |
debounce = true
function click() if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then debounce = false h = Instance.new("Hat") p = Instance.new("Part") h.Name = "Hat" p.Parent = h p.Position = hit.Parent:findFirstChild("Head").Position p.Name = "Handle" p.formFactor = 0 p.Size = Vector3.new(-0,-0,-1) p.BottomSurface = 0 p.TopSurface = 0 p.Locked = true script.Parent.Mesh:clone().Parent = p h.Parent = hit.Parent h.AttachmentPos = Vector3.new(0,0.4,0) wait(5) debounce = true end end
script.Parent.ClickDetector.MouseClick:connect(click)
---------
It's supposed to give you a hat when you clicki. Output states that in
if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) Hit is not specified.
This was originally used with touch. Now I would like to change it with click. Can anyone help? |
|
|
| Report Abuse |
|
|
RoScripts
|
  |
| Joined: 27 Oct 2012 |
| Total Posts: 1824 |
|
|
| 23 Jan 2013 09:27 PM |
| I think I see the problem... |
|
|
| Report Abuse |
|
|
RoScripts
|
  |
| Joined: 27 Oct 2012 |
| Total Posts: 1824 |
|
| |
|
crouton04
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 4459 |
|
| |
|
RoScripts
|
  |
| Joined: 27 Oct 2012 |
| Total Posts: 1824 |
|
|
| 23 Jan 2013 09:31 PM |
@Crou
Tried that earlier. Still not working. |
|
|
| Report Abuse |
|
|
RoScripts
|
  |
| Joined: 27 Oct 2012 |
| Total Posts: 1824 |
|
| |
|
MHebes
|
  |
| Joined: 04 Jan 2013 |
| Total Posts: 2278 |
|
|
| 23 Jan 2013 09:35 PM |
Assuming this worked with the .Touched version:
function click(player) char = player.Character if (char:findFirstChild("Humanoid") ~= nil and debounce == true) then debounce = false h = Instance.new("Hat") p = Instance.new("Part") h.Name = "Hat" p.Parent = h p.Position = char:findFirstChild("Head").Position p.Name = "Handle" p.formFactor = 0 p.Size = Vector3.new(-0,-0,-1) p.BottomSurface = 0 p.TopSurface = 0 p.Locked = true script.Parent.Mesh:clone().Parent = p h.Parent = char h.AttachmentPos = Vector3.new(0,0.4,0) wait(5) debounce = true end end
script.Parent.ClickDetector.MouseClick:connect(click) |
|
|
| Report Abuse |
|
|
RoScripts
|
  |
| Joined: 27 Oct 2012 |
| Total Posts: 1824 |
|
|
| 23 Jan 2013 09:43 PM |
It still won't work.
No output either. |
|
|
| Report Abuse |
|
|
MHebes
|
  |
| Joined: 04 Jan 2013 |
| Total Posts: 2278 |
|
|
| 23 Jan 2013 09:46 PM |
Try this. Also, you set the size of the part to -0,-0,-1. That'll just revert to .2,.2,.2, the minimum brick dimensions.
function click(player) char = player.Character if (char:findFirstChild("Humanoid") ~= nil and debounce == true) then debounce = false h = Instance.new("Hat") p = Instance.new("Part") h.Name = "Hat" p.Parent = h p.Position = char:findFirstChild("Head").Position p.Name = "Handle" p.formFactor = 0 p.Size = Vector3.new(-0,-0,-1) p.BottomSurface = 0 p.TopSurface = 0 p.Locked = true script.Parent.Mesh:clone().Parent = p h.Parent = char.Head h.AttachmentPos = Vector3.new(0,0.4,0) wait(5) debounce = true end end
script.Parent.ClickDetector.MouseClick:connect(click) |
|
|
| Report Abuse |
|
|
RoScripts
|
  |
| Joined: 27 Oct 2012 |
| Total Posts: 1824 |
|
|
| 23 Jan 2013 09:54 PM |
Still not working :/
Dang it... |
|
|
| Report Abuse |
|
|
MHebes
|
  |
| Joined: 04 Jan 2013 |
| Total Posts: 2278 |
|
|
| 23 Jan 2013 09:58 PM |
debounce = true
function click(player) char = player.Character if (char:findFirstChild("Humanoid") ~= nil and debounce == true) then debounce = false h = Instance.new("Hat") p = Instance.new("Part") h.Name = "Hat" p.Parent = h p.Position = char:findFirstChild("Head").Position p.Name = "Handle" p.formFactor = 0 p.Size = Vector3.new(-0,-0,-1) p.BottomSurface = 0 p.TopSurface = 0 p.Locked = true script.Parent.Mesh:clone().Parent = p h.Parent = char.Head h.AttachmentPos = Vector3.new(0,0.4,0) wait(5) debounce = true end end
script.Parent.ClickDetector.MouseClick:connect(click) |
|
|
| Report Abuse |
|
|
RoScripts
|
  |
| Joined: 27 Oct 2012 |
| Total Posts: 1824 |
|
|
| 23 Jan 2013 10:41 PM |
Sorry for the late response.
And it worked.
Thank you so much.
If there's anything I could help you in, message me.
I do all types of graphic designs. |
|
|
| Report Abuse |
|
|