Swoof
|
  |
| Joined: 13 Mar 2010 |
| Total Posts: 16146 |
|
|
| 25 May 2014 01:08 PM |
local BUY = game.ServerStorage.ShopItems[item]:clone() BUY.Parent = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.StarterGear
this is just a segment of the script which doesn't seem to be working
any idea why? |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 25 May 2014 01:11 PM |
Make sure that if and where you defined item that it's a string;
item = Item Wrong
item = "Item" Right
|
|
|
| Report Abuse |
|
|
|
| 25 May 2014 01:12 PM |
putting stuff in startergear wont make it appear to the player unless they respawn.
|
|
|
| Report Abuse |
|
|
Swoof
|
  |
| Joined: 13 Mar 2010 |
| Total Posts: 16146 |
|
|
| 25 May 2014 01:12 PM |
here is the full script gives the player the item to their backpack fine but the player does not respawn with it
a = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent function onClick()
item = "Wooden Bow" price = 500
a:WaitForChild("leaderstats") Cash = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.leaderstats.Coins if Cash.Value >= price and not a.Backpack:FindFirstChild(item) then Cash.Value = Cash.Value - 1 local BUY = game.ServerStorage.ShopItems[item]:clone() BUY.Parent = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.StarterGear BUY.Parent = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Backpack BUY.Handle.Anchored = false
end end
script.Parent.MouseButton1Click:connect(onClick) |
|
|
| Report Abuse |
|
|
Swoof
|
  |
| Joined: 13 Mar 2010 |
| Total Posts: 16146 |
|
|
| 25 May 2014 01:13 PM |
@ver
yes, I am giving the item to both startergear and backpack but they still dont spawn with it |
|
|
| Report Abuse |
|
|
|
| 25 May 2014 01:13 PM |
you need to clone it twice, place one clone is StarterGear and the other in Backpack
so like
a = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent function onClick()
item = "Wooden Bow" price = 500
a:WaitForChild("leaderstats") Cash = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.leaderstats.Coins if Cash.Value >= price and not a.Backpack:FindFirstChild(item) then Cash.Value = Cash.Value - 1 local BUY = game.ServerStorage.ShopItems[item]:clone() local clone = BUY:clone() clone.Parent = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.StarterGear BUY.Parent = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Backpack BUY.Handle.Anchored = false
end end
script.Parent.MouseButton1Click:connect(onClick)
|
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 25 May 2014 01:14 PM |
| Nothing is wrong with that. |
|
|
| Report Abuse |
|
|
|
| 25 May 2014 01:15 PM |
it is, he's cloning it once, putting it in startergear - then putting it from startergear into backpack.
|
|
|
| Report Abuse |
|
|
Swoof
|
  |
| Joined: 13 Mar 2010 |
| Total Posts: 16146 |
|
|
| 25 May 2014 01:16 PM |
Yeah, tyvm fixed now
stupid mistake dont know how i missed that |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 25 May 2014 01:16 PM |
Ohhhh haha didn't see that. Yeah..
game.ServerStorage[tool]:Clone().Parent = SterterGear game.ServerStorage[tool]:Clone().Parent = Backpack |
|
|
| Report Abuse |
|
|