Hutdoi
|
  |
| Joined: 14 Oct 2015 |
| Total Posts: 13 |
|
|
| 23 Apr 2016 01:38 PM |
player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent cost = 100
script.Parent.MouseButton1Click:connect(function() leaderstats = player:FindFirstChild("leaderstats") if leaderstats then points = leaderstats:FindFirstChild("Points") if points then if points.Value >= cost then points.Value = points.Value - cost while true do wait(1) script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.leaderstats.Points.Value = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.leaderstats.Points.Value + 1 end end end end end)
How do I make it cost more everytime I buy it? |
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 23 Apr 2016 01:50 PM |
buyAmount = 0 cost = 100
after buying...
buyAmount = buyAmount + 1 cost = cost + (buyAmount*(50*buyAmount)) |
|
|
| Report Abuse |
|
|
Hutdoi
|
  |
| Joined: 14 Oct 2015 |
| Total Posts: 13 |
|
|
| 23 Apr 2016 01:59 PM |
Ok but now I want to change the name the name when the cost changes how do I do that?
|
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 23 Apr 2016 02:00 PM |
Change the name of what? A text?
|
|
|
| Report Abuse |
|
|
Hutdoi
|
  |
| Joined: 14 Oct 2015 |
| Total Posts: 13 |
|
| |
|
| |
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 23 Apr 2016 02:03 PM |
if BuyAmount == 1 then TextButton.Text = "SecondUpgrade" elseif BuyAmount == 2 then TextButton.Text = "ThirdUpgrade" else TextButton.Text = "Too Many/Little Purchases" end |
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 23 Apr 2016 02:04 PM |
| Oh oops you meant a Text with the price on it I'm assuming. Just use what the other guy said XD |
|
|
| Report Abuse |
|
|
Hutdoi
|
  |
| Joined: 14 Oct 2015 |
| Total Posts: 13 |
|
| |
|
Hutdoi
|
  |
| Joined: 14 Oct 2015 |
| Total Posts: 13 |
|
|
| 23 Apr 2016 02:13 PM |
NewCost = tostring(Click to Buy 1 Click Per Second For)cost = cost + 10 ? |
|
|
| Report Abuse |
|
|
Hutdoi
|
  |
| Joined: 14 Oct 2015 |
| Total Posts: 13 |
|
|
| 23 Apr 2016 02:22 PM |
player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent cost = 100 A = tostring("Click to Buy 1 Click Per Second for".. cost + 10 )
script.Parent.MouseButton1Click:connect(function() leaderstats = player:FindFirstChild("leaderstats") if leaderstats then points = leaderstats:FindFirstChild("Points") if points then if points.Value >= cost then points.Value = points.Value - cost cost = cost + 10 script.Parent.Text = A while true do wait(1) script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.leaderstats.Points.Value = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.leaderstats.Points.Value + 1 end end end end end)
When I buy it once, it changes to 110. Buying it again, it just the text stays at 110 but the price goes up |
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 23 Apr 2016 02:24 PM |
| you have to do the A = thing every time they buy |
|
|
| Report Abuse |
|
|
Hutdoi
|
  |
| Joined: 14 Oct 2015 |
| Total Posts: 13 |
|
| |
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 23 Apr 2016 02:32 PM |
cost = cost + 10 A = what you put before script.Parent.Text = A |
|
|
| Report Abuse |
|
|
Hutdoi
|
  |
| Joined: 14 Oct 2015 |
| Total Posts: 13 |
|
|
| 23 Apr 2016 02:35 PM |
It works! Thanks for all the help!!!
|
|
|
| Report Abuse |
|
|