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
|
  |
| Joined: 30 Jun 2010 |
| Total Posts: 90299 |
|
| |
|
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 |
|
|
|
| 03 Nov 2014 07:18 AM |
| post all the outputs here and also, is that the full script? |
|
|
| Report Abuse |
|
|
murcury57
|
  |
| Joined: 30 Jun 2010 |
| Total Posts: 90299 |
|
| |
|
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 |
|
|
|
| 03 Nov 2014 07:39 AM |
| Medic.parent:Destroy() <-- |
|
|
| Report Abuse |
|
|
kezman11
|
  |
| Joined: 16 Dec 2011 |
| Total Posts: 124 |
|
| |
|