generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Help with a script

Previous Thread :: Next Thread 
Hutdoi is not online. 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 is not online. 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 is not online. 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 is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
23 Apr 2016 02:00 PM
Change the name of what? A text?

Report Abuse
Hutdoi is not online. Hutdoi
Joined: 14 Oct 2015
Total Posts: 13
23 Apr 2016 02:01 PM
Yeah
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
23 Apr 2016 02:02 PM
tostring()???
Report Abuse
eRanged is not online. 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 is not online. 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 is not online. Hutdoi
Joined: 14 Oct 2015
Total Posts: 13
23 Apr 2016 02:12 PM
How do I use a tostring?
Report Abuse
Hutdoi is not online. 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 is not online. 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 is not online. 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 is not online. Hutdoi
Joined: 14 Oct 2015
Total Posts: 13
23 Apr 2016 02:30 PM
How do I do that?
Report Abuse
eRanged is not online. 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 is not online. Hutdoi
Joined: 14 Oct 2015
Total Posts: 13
23 Apr 2016 02:35 PM
It works! Thanks for all the help!!!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image