|
| 23 Nov 2016 08:43 PM |
local m = Instance.new("Part") m.Parent = inv:FindFirstChild(a) print(m.Parent)
The parent would become nil instead of inv:FindFirstChild(a) (for the inventory).
25,781 |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
|
| 23 Nov 2016 08:46 PM |
A is a number value.
25,767 |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 23 Nov 2016 08:46 PM |
| Where do you make the clone..? If you need to a parent a clone just say ################### = a |
|
|
| Report Abuse |
|
|
|
| 23 Nov 2016 08:47 PM |
| well FindFirstChild takes a string value as the first argument so that's why your part is being parented to nil |
|
|
| Report Abuse |
|
|
|
| 23 Nov 2016 08:57 PM |
| Aggressive, before the part is created, the FindFirstChild worked with number values: debounce = true script.Parent.T.Touched:connect(function(h) if h == game.Workspace.Model.Wood then print("!") debounce = false a = 1 loop = true inv = game.ReplicatedFirst.Menu.Profilelay.Inventory while # ## 35 and loop == true do wait(-1) i = 1 invSlot = inv.ScrollingFrame:FindFirstChild(a):GetChildren() while i<=2 do print(invSlot[i]) if ########## ## nil then loop = false end i = i + 1 end a = a + 1 end if loop == false then local m = Instance.new("Part") m.Parent = inv:FindFirstChild(""..a.."") print(m.Parent) end end end) Rest of the code: 25,777 |
|
|
| Report Abuse |
|
|
|
| 23 Nov 2016 09:18 PM |
| debounce = true script.Parent.T.Touched:connect(function(h) if h == game.Workspace.Model.Wood then print("!") debounce = false a = 0 loop = true inv = game.ReplicatedFirst.Menu.Profilelay.Inventory while # ## 35 and loop == true do a = a + 1 wait(-1) i = 1 invSlot = inv.ScrollingFrame:FindFirstChild(a):GetChildren() while i<=2 do print(invSlot[i]) if ### #### [i] == nil then loop = false end i = i + 1 end end if loop == false then local m = Instance.new("Part") m.Parent = inv:FindFirstChild(""..a.."") print(a) print(m.Parent) end end end) 25,775 |
|
|
| Report Abuse |
|
|
|
| 23 Nov 2016 09:19 PM |
| debounce = true script.Parent.T.Touched:connect(function(h) if h == game.Workspace.Model.Wood then print("!") debounce = false a = 0 loop = true inv = game.ReplicatedFirst.Menu.Profilelay.Inventory while # ## 35 and loop == true do a = a + 1 wait(-1) i = 1 invSlot = inv.ScrollingFrame:FindFirstChild(a):GetChildren() while i<=2 do print(invSlot[i]) if i n # # # # # [i] == nil then loop = false end i = i + 1 end end if loop == false then local m = Instance.new("Part") m.Parent = inv:FindFirstChild(""..a.."") print(a) print(m.Parent) end end end) 25,765 |
|
|
| Report Abuse |
|
|
HlCOM
|
  |
| Joined: 29 Mar 2009 |
| Total Posts: 3332 |
|
| |
|
|
| 23 Nov 2016 09:53 PM |
You have to convert a to a string
So inv:FindFirstChild(tostring(a)) |
|
|
| Report Abuse |
|
|
|
| 23 Nov 2016 11:32 PM |
I tried that and it didn't work. Still printed out nil.
25,535 |
|
|
| Report Abuse |
|
|
HlCOM
|
  |
| Joined: 29 Mar 2009 |
| Total Posts: 3332 |
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 24 Nov 2016 12:01 AM |
why would you clone a part into an inventory. thats dumb
part.Parent = inventory[a.Value]
|
|
|
| Report Abuse |
|
|
|
| 24 Nov 2016 12:38 AM |
@TimeTick
I'm not literally cloning a part into the ROBLOX inventory. I'm inserting it into a custom inventory.
25,545 |
|
|
| Report Abuse |
|
|
|
| 24 Nov 2016 12:45 AM |
Just found out the mistake. Had to add ScrollingFrame to inv.
25,545 |
|
|
| Report Abuse |
|
|
| |
|