dude6354
|
  |
| Joined: 04 Apr 2009 |
| Total Posts: 205 |
|
|
| 30 Sep 2012 02:12 AM |
Hey so im trying to make a block, where if you lick it, it would add the guns ammo value by 16 then remove itself. this is my script:
function onClick(player)
local humanname = player.Name
local human = game.Workspace:findFirstChild(humanname)
local gun = human:findFirstChild(M14)
gun.AmmoLeft.Value = gun.AmmoLeft.Value +16
script.Parent.Parent:Remove() end
script.Parent.ClickDetector.MouseClick:connect(onClick)
this doesnt work. How can i fix this? |
|
|
| Report Abuse |
|
|
dave2011
|
  |
| Joined: 02 Oct 2010 |
| Total Posts: 10581 |
|
| |
|
dude6354
|
  |
| Joined: 04 Apr 2009 |
| Total Posts: 205 |
|
|
| 30 Sep 2012 02:25 AM |
| I meant click... Read the code... |
|
|
| Report Abuse |
|
|
|
| 30 Sep 2012 03:14 AM |
*licks*
-- Live young. Enjoy life. -- |
|
|
| Report Abuse |
|
|
Monkey727
|
  |
| Joined: 12 Jan 2009 |
| Total Posts: 969 |
|
|
| 30 Sep 2012 03:40 AM |
function onClick(player)
local human = game.Workspace:findFirstChild(player)
local gun = human:findFirstChild(M14)
gun.AmmoLeft.Value = gun.AmmoLeft.Value +16
script.Parent.Parent:Remove()
end
script.Parent.ClickDetector.MouseClick:connect(onClick)
Try that, Simply the player is already a string so doesn't need a Name... I think. :| |
|
|
| Report Abuse |
|
|
dude6354
|
  |
| Joined: 04 Apr 2009 |
| Total Posts: 205 |
|
| |
|
| |
|
dude6354
|
  |
| Joined: 04 Apr 2009 |
| Total Posts: 205 |
|
| |
|
| |
|
dude6354
|
  |
| Joined: 04 Apr 2009 |
| Total Posts: 205 |
|
|
| 30 Sep 2012 06:25 PM |
| it doesnt, it says unexpected exception |
|
|
| Report Abuse |
|
|
dude6354
|
  |
| Joined: 04 Apr 2009 |
| Total Posts: 205 |
|
|
| 01 Oct 2012 03:22 PM |
| *bump* Still need help with this. |
|
|
| Report Abuse |
|
|