generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: I need someone to edit this script

Previous Thread :: Next Thread 
greatestdan is not online. greatestdan
Joined: 08 Sep 2008
Total Posts: 504
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
stuntkid257 is not online. stuntkid257
Joined: 12 Jul 2010
Total Posts: 1394
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
stuntkid257 is not online. stuntkid257
Joined: 12 Jul 2010
Total Posts: 1394
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
greatestdan is not online. greatestdan
Joined: 08 Sep 2008
Total Posts: 504
05 Sep 2011 07:00 PM
that is the entire script. The script goes inside the humanoid.
Report Abuse
greatestdan is not online. greatestdan
Joined: 08 Sep 2008
Total Posts: 504
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
greatestdan is not online. greatestdan
Joined: 08 Sep 2008
Total Posts: 504
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image