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 » Scripters
Home Search
 

Re: Making a clone and then parenting it isn't working.

Previous Thread :: Next Thread 
SpeakerColonia is not online. SpeakerColonia
Joined: 11 Jul 2012
Total Posts: 10238
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
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
23 Nov 2016 08:44 PM
inv:FindFirstChild("a")

Report Abuse
SpeakerColonia is not online. SpeakerColonia
Joined: 11 Jul 2012
Total Posts: 10238
23 Nov 2016 08:45 PM
A is a variable.


25,767
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
23 Nov 2016 08:45 PM
a is a string value?
Report Abuse
SpeakerColonia is not online. SpeakerColonia
Joined: 11 Jul 2012
Total Posts: 10238
23 Nov 2016 08:46 PM
A is a number value.


25,767
Report Abuse
Soybeen is not online. 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
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
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
SpeakerColonia is not online. SpeakerColonia
Joined: 11 Jul 2012
Total Posts: 10238
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
SpeakerColonia is not online. SpeakerColonia
Joined: 11 Jul 2012
Total Posts: 10238
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
SpeakerColonia is not online. SpeakerColonia
Joined: 11 Jul 2012
Total Posts: 10238
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 is not online. HlCOM
Joined: 29 Mar 2009
Total Posts: 3332
23 Nov 2016 09:48 PM

m.Parent = inv[a]

?
Report Abuse
PhoenixSigns is not online. PhoenixSigns
Joined: 17 Sep 2011
Total Posts: 1137
23 Nov 2016 09:53 PM
You have to convert a to a string

So inv:FindFirstChild(tostring(a))
Report Abuse
SpeakerColonia is not online. SpeakerColonia
Joined: 11 Jul 2012
Total Posts: 10238
23 Nov 2016 11:32 PM
I tried that and it didn't work. Still printed out nil.


25,535
Report Abuse
HlCOM is not online. HlCOM
Joined: 29 Mar 2009
Total Posts: 3332
23 Nov 2016 11:33 PM
m.Parent = inv[a]

?
Report Abuse
TimeTicks is not online. 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
SpeakerColonia is not online. SpeakerColonia
Joined: 11 Jul 2012
Total Posts: 10238
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
SpeakerColonia is not online. SpeakerColonia
Joined: 11 Jul 2012
Total Posts: 10238
24 Nov 2016 12:45 AM
Just found out the mistake. Had to add ScrollingFrame to inv.


25,545
Report Abuse
PhoenixSigns is not online. PhoenixSigns
Joined: 17 Sep 2011
Total Posts: 1137
25 Nov 2016 10:12 AM
facepalm
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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