|
| 04 Dec 2012 06:11 PM |
I have this script in a gun, and it still won't work: function onDied() for i =1,script.MoneyCount.Value do local xp = Instance.new("Part") xp.Parent = game.Workspace xp.Position = script.Parent.Parent.Torso.Position + Vector3.new(math.random(-3,3),math.random(-3,3),math.random(-3,3)) xp.Shape = 1 xp.FormFactor = "Plate" xp.Name = "Ammo" xp.BrickColor = BrickColor.new(21) xp.Reflectance = 0 xp.Size = Vector3.new(1,0.4,2) local clone = script.AmmoGiver:Clone() clone.Disabled = false clone.Parent = xp end end
script.Parent.Died:connect(onDied)
|
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 04 Dec 2012 06:13 PM |
| .Died is an event for Humanoid, not Tools or Models. |
|
|
| Report Abuse |
|
|
|
| 04 Dec 2012 06:14 PM |
| How do I get it into a humaniod? |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 04 Dec 2012 06:15 PM |
| You just attach the event to the humanoid? |
|
|
| Report Abuse |
|
|
|
| 04 Dec 2012 06:15 PM |
You could insert a humanoid model into a gun or something...
There might be some coding involved to get it to work though, I'm not sure. |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 04 Dec 2012 06:16 PM |
| If you don't know how to help, don't. ._. |
|
|
| Report Abuse |
|
|
spynaz
|
  |
| Joined: 17 Feb 2011 |
| Total Posts: 1326 |
|
|
| 04 Dec 2012 06:36 PM |
You get the player's humanoid, the one holding the weapon (Remember, the tool goes into the player's model in workspace when it is equipped):
Tool = script.Parent Humanoid = Tool.Parent:findFirstChild("Humanoid") |
|
|
| Report Abuse |
|
|
|
| 09 Dec 2012 12:57 PM |
Where do I put this then:
Tool = script.Parent Humanoid = Tool.Parent:findFirstChild("Humanoid") |
|
|
| Report Abuse |
|
|
|
| 09 Dec 2012 01:01 PM |
| scripting confuses me but if u can do it u have skill |
|
|
| Report Abuse |
|
|
|
| 09 Dec 2012 02:58 PM |
| Do I need to rewrite or something? |
|
|
| Report Abuse |
|
|
spynaz
|
  |
| Joined: 17 Feb 2011 |
| Total Posts: 1326 |
|
|
| 10 Dec 2012 09:26 PM |
function onDied() for i =1,script.MoneyCount.Value do local xp = Instance.new("Part") xp.Parent = game.Workspace xp.Position = script.Parent.Parent.Torso.Position + Vector3.new(math.random(-3,3),math.random(-3,3),math.random(-3,3)) xp.Shape = 1 xp.FormFactor = "Plate" xp.Name = "Ammo" xp.BrickColor = BrickColor.new(21) xp.Reflectance = 0 xp.Size = Vector3.new(1,0.4,2) local clone = script.AmmoGiver:Clone() clone.Disabled = false clone.Parent = xp end end
Tool = script.Parent Humanoid = Tool.Parent:findFirstChild("Humanoid")
Humanoid.Died:connect(onDied) |
|
|
| Report Abuse |
|
|
|
| 11 Dec 2012 03:53 PM |
| BTW, I'm doing this in test mode. |
|
|
| Report Abuse |
|
|