Pexur
|
  |
| Joined: 23 Jun 2008 |
| Total Posts: 12779 |
|
|
| 16 Mar 2014 01:59 PM |
ShopBrick = script.Parent local debounce = false price = 0 --Put the price here. Stat = "KOs" tool = "LinkedSword"
function onTouched(hit) if (debounce == false) then if (hit.Parent:findFirstChild("Humanoid") ~= nil) then local human = hit.Parent:findFirstChild("Humanoid") if (game.Players:findFirstChild(hit.Parent.Name) ~= nil) then local player = game.Players:findFirstChild(hit.Parent.Name) if (player:findFirstChild("leaderstats") ~= nil) then local stats = player:findFirstChild("leaderstats") if (stats:findFirstChild(Stat) ~= nil) then local stat = stats:findFirstChild(Stat) if (stat.Value >=price) then stat.Value = stat.Value - price if (player:findFirstChild(tool) == nil) then game.Lighting:findFirstChild(tool):clone().Parent = player.StarterGear game.Lighting:findFirstChild(tool):clone().Parent = player.Backpack debounce = true ShopBrick.BrickColor = BrickColor.new("Bright red") wait(2) ShopBrick.BrickColor = BrickColor.new("Bright green") debounce = false end end end end end end end end |
|
|
| Report Abuse |
|
|
Pexur
|
  |
| Joined: 23 Jun 2008 |
| Total Posts: 12779 |
|
|
| 16 Mar 2014 02:00 PM |
| It's like a tycoon button. Once it's hit your money goes away, but I don't want it to do that. |
|
|
| Report Abuse |
|
|
|
| 16 Mar 2014 02:00 PM |
Remove this line:
stat.Value = stat.Value - price
|
|
|
| Report Abuse |
|
|
Pexur
|
  |
| Joined: 23 Jun 2008 |
| Total Posts: 12779 |
|
| |
|