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: Help with placing a copy of an item inside backpack..

Previous Thread :: Next Thread 
kezman11 is not online. kezman11
Joined: 16 Dec 2011
Total Posts: 124
03 Nov 2014 07:00 AM
Medic = script.Parent

function onClick()
local lighting = game.Lighting.MedKits:GetChildren()
local randy = lighting[math.random(1, #lighting)]
randy:Clone().Parent = game.Players:FindFirstChild()

script.Parent.Parent:Destroy()
end

script.Parent.ClickDetector.MouseClick:connect(onClick)

Thats the script, theres no output, when I click on the Medkit it never places it inside my inventory but it Destroys, help? Thanks.
Report Abuse
murcury57 is not online. murcury57
Joined: 30 Jun 2010
Total Posts: 90299
03 Nov 2014 07:08 AM
[ Content Deleted ]
Report Abuse
kezman11 is not online. kezman11
Joined: 16 Dec 2011
Total Posts: 124
03 Nov 2014 07:12 AM
I wrote exactly what you said and now its saying "13:04:51.703 - Workspace.MedPacks.Medic.Script:8: function arguments expected near 'script'"
Report Abuse
ShadowOfCrimson is not online. ShadowOfCrimson
Joined: 14 Dec 2009
Total Posts: 2153
03 Nov 2014 07:18 AM
post all the outputs here and also, is that the full script?
Report Abuse
murcury57 is not online. murcury57
Joined: 30 Jun 2010
Total Posts: 90299
03 Nov 2014 07:20 AM
[ Content Deleted ]
Report Abuse
kezman11 is not online. kezman11
Joined: 16 Dec 2011
Total Posts: 124
03 Nov 2014 07:33 AM
Yes, its the full script, Im basically making a dayZ style game.

local Medic = script.Parent
local Storage = game:GetService("ServerStorage"):WaitForChild("MedKids")

function onClick(Player)
local Randy = Storage:GetChildren()[math.random(1,#Storage:GetChildren())]
Randy:Clone().Parent=Player:FindFirstChild("Backpack")
Medic.parent.Destroy()
end

Medic.ClickDetector.MouseClick:Connect(onClick)

Im now getting " Expected ':' not '.' calling member function GetService"
Report Abuse
ShadowOfCrimson is not online. ShadowOfCrimson
Joined: 14 Dec 2009
Total Posts: 2153
03 Nov 2014 07:39 AM
Medic.parent:Destroy() <--
Report Abuse
kezman11 is not online. kezman11
Joined: 16 Dec 2011
Total Posts: 124
03 Nov 2014 07:50 AM
Ahh, i see, thanks. :3
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