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: FindFirstChild

Previous Thread :: Next Thread 
wetrel is not online. wetrel
Joined: 19 Jun 2009
Total Posts: 919
27 Jan 2014 10:09 PM
I have these lines:

ItemTransferName = GUI[Selection].Text
if SelectionLetter == "A" or SelectionLetter == "B" or SelectionLetter == "C" or SelectionLetter == "D" or SelectionLetter == "E" then
if SubA:findFirstPerson(ItemTransferName) ~= nil then
ItemTransfer = SubA[ItemTransferName]
ItemTransfer.Parent = SelectedChest.Contents.Inv
ReItemInv = SubA:getChildren()
for ReItemA = 1, #ReItemInv do
ReItemInv[ReItemA].Parent = SubB
end
if #ReItemInv < 1 then ItemAdded() end
ReItemChe = SelectedChest.Contents.Inv:getChildren()
for ReItemB = 1, #ReItemChe do
ReItemChe[ReItemB].Parent = SelectedChest.Contents.Add
end
if #ReItemChe < 1 then SelectedChest.Update.Value = SelectedChest.Update.Value + 1 end
end
elseif SelectionLetter == "F" or SelectionLetter == "G" or SelectionLetter == "H" or SelectionLetter == "I" or SelectionLetter == "J" and SubA:findFirstPerson(GUI[Selection].Text) ~= nil then
if SubA:findFirstPerson(ItemTransferName) ~= nil then
ItemTransfer = SelectedChest.Contents.Inv[ChestGUI[Selection].Text]
ItemTransfer.Parent = SubA
ReItemInv = SubA:getChildren()
for ReItemA = 1, #ReItemInv do
ReItemInv[ReItemA].Parent = SubB
end
if #ReItemInv < 1 then ItemAdded() end
ReItemChe = SelectedChest.Contents.Inv:getChildren()
for ReItemB = 1, #ReItemChe do
ReItemChe[ReItemB].Parent = SelectedChest.Contents.Add
end
if #ReItemChe < 1 then SelectedChest.Update.Value = SelectedChest.Update.Value + 1 end
for Clear = 1,25 do
if ChestGUI:findFirstChild("Lab") ~= nil then
ChestGUI.Lab:Remove()
end
if ChestGUI:findFirstChild("Pic") ~= nil then
ChestGUI.Pic:Remove()
end
end
end

The "SubA:findFirstPerson(ItemTransferName) ~= nil" always comes out true. Im trying to make it false if the item does not exist, and true if the item does exist.
Report Abuse
wetrel is not online. wetrel
Joined: 19 Jun 2009
Total Posts: 919
27 Jan 2014 10:14 PM
I suppose the whole issue can be shortened to
if SubA:findFirstPerson(ItemTransferName) ~= nil then
but it is always true! The variable is updated.
Report Abuse
TrueSoulWolf is not online. TrueSoulWolf
Joined: 02 Apr 2011
Total Posts: 460
27 Jan 2014 10:16 PM
Narrow down the script, awfully large. Too much to read.
Report Abuse
wetrel is not online. wetrel
Joined: 19 Jun 2009
Total Posts: 919
27 Jan 2014 10:18 PM
I did, look at my second post.
Report Abuse
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
27 Jan 2014 10:20 PM
Change this
ItemTransferName = GUI[Selection].Text
To this
ItemTransferName = GUI[Selection]
And this
SubA:findFirstPerson(ItemTransferName) ~= nil
To this
SubA:findFirstPerson(ItemTransferName.Text) ~= nil
Report Abuse
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
27 Jan 2014 10:20 PM
Also its FindFirstChild, not person
Report Abuse
wetrel is not online. wetrel
Joined: 19 Jun 2009
Total Posts: 919
27 Jan 2014 10:20 PM
Ill try it, Ill be right back.
Report Abuse
wetrel is not online. wetrel
Joined: 19 Jun 2009
Total Posts: 919
27 Jan 2014 10:22 PM
Thank you so much :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