tester140
|
  |
| Joined: 05 Aug 2008 |
| Total Posts: 40 |
|
|
| 19 Apr 2009 04:24 PM |
local part = script.Parent local button = part.Parent local machine = button.Parent local land = machine.Parent local debounce = false cost = 80
function onTouched(hit) if (debounce == false) then debounce = true local humanoid = hit.Parent:findFirstChild("Humanoid") if (humanoid ~= nil) then local player = game.Players:findFirstChild(hit.Parent.Name) if (land.OwnerName.Value == player.Name) then local stats = player:findFirstChild("leaderstats") if (stats ~= nil) then if (stats.Cash.Value >= cost) then stats.Cash.Value = stats.Cash.Value - cost local delay = machine.Delay if (delay.Value > 7) then delay.Value = delay.Value - 1 cost = cost * 2 button.Name = "Upgrade production! Cost: "..cost elseif (delay.Value == 2) then delay.Value = delay.Value - 1 button:remove() end else local msg = Instance.new("Hint") msg.Text = "You don't have enough Cash, "..player.Name.."!" msg.Parent = player wait(2) msg:remove() end end else local msg = Instance.new("Hint") msg.Text = "You aren't the owner of this Factory, "..player.Name.."!" msg.Parent = player wait(2) msg:remove() end end wait(0.5) debounce = false end end
part.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
tester140
|
  |
| Joined: 05 Aug 2008 |
| Total Posts: 40 |
|
| |
|
tester140
|
  |
| Joined: 05 Aug 2008 |
| Total Posts: 40 |
|
|
| 19 Apr 2009 08:19 PM |
| BUMP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|
|
| Report Abuse |
|
|
|
| 19 Apr 2009 08:21 PM |
| Looks like you got your ends right... lemme check connection... |
|
|
| Report Abuse |
|
|
| |
|
Ozzypig
|
  |
| Joined: 27 Mar 2008 |
| Total Posts: 4906 |
|
|
| 19 Apr 2009 08:23 PM |
| Why don't you look at the output and see if you can find what's wrong? |
|
|
| Report Abuse |
|
|
tester140
|
  |
| Joined: 05 Aug 2008 |
| Total Posts: 40 |
|
|
| 19 Apr 2009 08:34 PM |
| Nothing appears it just keeps on going without changing price se how it says * 2 on the cost value? It won't change =/ |
|
|
| Report Abuse |
|
|