|
| 04 Feb 2013 10:18 PM |
It's a gui shop button script, supposed to give you a gun for 100 OSC. I made sure the parenting was right, but when I click the button no credits are taken and no gun is given. Can anyone figure out what is wrong?
player = script.Parent.Parent.Parent.Parent.Parent money = player.leaderstats.OSC price = 100 tool = game.Lighting:findFirstChild("Addesso Rifle")
function buy() if money.Value >= price then money.Value = money.Value - price local a = tool:clone() a.Parent = player.Backpack local b = tool:clone() b.Parent = player.StarterGear
end end script.Parent.MouseButton1Down:connect(buy) |
|
|
| Report Abuse |
|
thane1326
|
  |
| Joined: 08 Apr 2009 |
| Total Posts: 867 |
|
|
| 05 Feb 2013 04:07 AM |
It's probably the amount of parents you have to get to the player. Maybe to little, or too much. BTW, you can use 1 line to clone the tool:
tool:clone().Parent = player.Backpack |
|
|
| Report Abuse |
|