Zecrit
|
  |
| Joined: 24 Jan 2013 |
| Total Posts: 2618 |
|
|
| 28 Jun 2015 07:39 AM |
--Line: function stacktargetshop(name) local Box = ChildShopStore:FindFirstChild(Name) --<< print("G") end
--Call: mouse.Button1Down:connect(function() local targ = mouse.Target if targ.Parent.Name == "ShopBrickGrouping" then print(targ.Name) stacktargetshop(targ.Name) end end)
? |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2015 07:42 AM |
There is so many errors...
First, you are not passing a created variable through local Box = ChildShopStore:FindFirstChild(). You have never defined ChildShopStore and you have failed to grab the mouse to use it. Also, your methods for checking will error.
if(targ.Parent)then if(targ.Parent.Name == "ShopBrickGrouping")then -- correct end end |
|
|
| Report Abuse |
|
|
Zecrit
|
  |
| Joined: 24 Jan 2013 |
| Total Posts: 2618 |
|
|
| 28 Jun 2015 07:50 AM |
What kind of incompetent fool do you think I am? This is the whole script, I omitted the unnecessary things:
local player = game.Players.LocalPlayer local queen = script.Parent.ScreenGui local mouse = player:GetMouse() local workspace = game.Workspace local shoplist = workspace.ShopBrickGrouping local gui = script.Parent.ScreenGui local ShopItems = game.ServerStorage.Shopitems local ChildItems = ShopItems:GetChildren() local ShopStore = game.ServerStorage.Shops local ChildShopStore = ShopStore:GetChildren() local ItemPaddingY = 55 local MouseX = 0 local MouseY = 0
local Station local Wallet local Inventory local shopGUIsopen = false
local shops = { [shoplist.Blue] = 0, [shoplist.Red] = 0, [shoplist.Green] = 0, [shoplist.Pink] = 0 }
function stacktargetshop(name) local Box = ChildShopStore:FindFirstChild(name) local Spec = Box.Species.Value local Folder = ChildItems:FindFirstChild(Spec) for i, v in pairs(Folder:GetChildren()) do local b = v:Clone() b.Parent = queen.Shop.Supply b.Position.X.Offset = ItemPaddingY ItemPaddingY = ItemPaddingY + 55 end end
mouse.Button1Down:connect(function() local targ = mouse.Target if targ.Parent.Name == "ShopBrickGrouping" then print(targ.Name) stacktargetshop(targ.Name) end end)
|
|
|
| Report Abuse |
|
|
ganger800
|
  |
| Joined: 06 Dec 2012 |
| Total Posts: 427 |
|
|
| 28 Jun 2015 07:52 AM |
why wouldn't this work... a table is not an instance
local ChildShopStore = ShopStore:GetChildren() local Box = ChildShopStore:FindFirstChild(name) |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2015 07:56 AM |
You have failed to realize the importance of having everything shown for us to look at.
local shoplist = workspace.ShopBrickGrouping local ShopItems = game.ServerStorage.Shopitems
Should be
local shoplist = workspace:WaitForChild("ShopBrickGrouping") local Storage = game:GetService("ServerStorage") local ShopItems = Storage:WaitForChild("Shopitems") local ShopStore = Storage:WaitForChild("Shops")
...
local ChildItems = ShopItems:GetChildren() local ChildShopStore = ShopStore:GetChildren()
This should be called at the time of it needing to get children. Doing this at the beginning will break you using this, as it is just a reference. Plus, the children may not be ready to grab and give false results.
...
if targ.Parent.Name == "ShopBrickGrouping" then
Should be
if targ.Parent then if targ.Parent.Name == "ShopBrickGrouping" then
end end |
|
|
| Report Abuse |
|
|
Zecrit
|
  |
| Joined: 24 Jan 2013 |
| Total Posts: 2618 |
|
| |
|