|
| 05 Sep 2011 06:50 PM |
I have a script that has a monster drop an item when it dies. The problem is that it is dropped into the workspace and it can be bounced around by the monster's body parts. I need the script edited so that the item goes into the backpack of the killer. I realize that in order to do that it may take quite a bit more script to be added. But Ineed this to be done. I will be trying to find out how to convert it but if you can make it work how I want it then either post it here or pm me a copy of it.
function onDied() wait(1) s = game.Lighting["Full Health Potion"]:Clone() s.Parent = game.Workspace s.Handle.Position = script.Parent.Parent.Torso.Position end script.Parent.Died:connect(onDied)
|
|
|
| Report Abuse |
|
|
|
| 05 Sep 2011 06:57 PM |
script.Parent.Died:connect(function() wait(1) s = game.Lighting["Full Health Potion"]:Clone() s.Parent = game.Workspace s.Handle.Position = script.Parent.Parent.Torso.Position end)
Is this script under something? |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2011 07:00 PM |
Oops, I forgot somethings...
script.Parent.Died:connect(function(p) wait(1) s = game.Lighting["Full Health Potion"]:Clone().Parent = workspace s.Handle.Position = script.Parent.Parent.Torso.Position end)
This part, do you want the tool to be in the player's backpack?
s.Handle.Position = script.Parent.Parent.Torso.Position
If so, then do this:
s.Parent = p.Parent.Parent.Parent.Parent.Backpack |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2011 07:00 PM |
| that is the entire script. The script goes inside the humanoid. |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2011 07:07 PM |
I want the tool in the player's backpack. is this what you meant?
script.Parent.Died:connect(function(p) wait(1) s = game.Lighting["Full Health Potion"]:Clone().Parent = workspace p.Parent.Parent.Parent.Parent.Backpack end)
that doesnt work or did you mean a different way to set up the script? if so then just put how you want the script to be. |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2011 07:08 PM |
I mean
script.Parent.Died:connect(function(p) wait(1) s = game.Lighting["Full Health Potion"]:Clone().Parent = workspace s.Parent = p.Parent.Parent.Parent.Parent.Backpack end)
I left out the s.Parent = in the post above. |
|
|
| Report Abuse |
|
|