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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Button does nothing when clicked (probably easy fix)

Previous Thread :: Next Thread 
johny220 is not online. johny220
Joined: 30 Oct 2011
Total Posts: 4584
11 Aug 2015 03:20 PM
cost = script.Parent
level = cost.Parent.Level
button = script.Parent.Parent.Parent
ChaChing = game.Players.LocalPlayer.leaderstats.Cash
Clickspeed = game.Players.LocalPlayer.Backpack.ClickSpeed

if level.Value == 1 then cost.Value = 50 Clickspeed.Value = 1
if level.Value == 2 then cost.Value = 125 Clickspeed.Value = 0.8
if level.Value == 3 then cost.Value = 300 Clickspeed.Value = 0.7
if level.Value == 4 then cost.Value = 800 Clickspeed.Value = 0.6
if level.Value == 5 then cost.Value = 2000 Clickspeed.Value = 0.5
if level.Value == 6 then cost.Value = 3200 Clickspeed.Value = 0.3
if level.Value == 7 then cost.Value = 5000 Clickspeed.Value = 0.2
if level.Value == 8 then cost.Value = 11500 Clickspeed.Value = 0.12
if level.Value == 9 then cost.Value = 25000 Clickspeed.Value = 0.1
if level.Value == 10 then cost.Value = 50000 Clickspeed.Value = 0.07
if level.Value == 11 then cost.Value = 100000 Clickspeed.Value = 0.03
if level.Value == 12 then cost.Value = 250000 Clickspeed.Value = 0.01
if level.Value == 13 then Clickspeed.Value = 0 script.Parent.Parent.Text = "MAX" script.Parent.Parent.TextColor3 = Color3.new(255, 39, 39) script.Parent.Parent.TextStrokeColor3 = Color3.new(170, 10, 10)
end
end
end
end
end
end
end
end
end
end
end
end
end

if ChaChing.Value >= cost.Value then
script.Parent.MouseButton1Down:connect(function()
script.Parent.Sound:Play()
level = level + 1
end)
end

--------------------------------------------------------------

the last few lines are probably where I messed up. I dunno what I did wrong. I checked the parents and all that, and there are no blue or red squiggly's anywhere
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
11 Aug 2015 03:23 PM
Now is this in a local script??
Report Abuse
johny220 is not online. johny220
Joined: 30 Oct 2011
Total Posts: 4584
11 Aug 2015 03:25 PM
dangit lol. totally forgot
Report Abuse
johny220 is not online. johny220
Joined: 30 Oct 2011
Total Posts: 4584
11 Aug 2015 03:30 PM
oh wait they actually are
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
11 Aug 2015 03:31 PM
You got a click detector as well???
Report Abuse
johny220 is not online. johny220
Joined: 30 Oct 2011
Total Posts: 4584
11 Aug 2015 03:34 PM
you don't need those for GUI's. It's an imagebutton
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
11 Aug 2015 03:35 PM
I'm no expert on GUIs lol. I'm still a noob in scripting
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
11 Aug 2015 03:36 PM
for christ sakes. LEARN HOW TO USE LOOPS. AND ELSEIFS God dammit


"Talk is cheap. Show me the code." - Linus Torvalds
Report Abuse
johny220 is not online. johny220
Joined: 30 Oct 2011
Total Posts: 4584
11 Aug 2015 03:39 PM
what do I need loops for lol
Report Abuse
johny220 is not online. johny220
Joined: 30 Oct 2011
Total Posts: 4584
11 Aug 2015 03:39 PM
cost = script.Parent
level = cost.Parent.Level
button = script.Parent.Parent.Parent
ChaChing = game.Players.LocalPlayer.leaderstats.Cash
Clickspeed = game.Players.LocalPlayer.Backpack.ClickSpeed

if level.Value == 1 then cost.Value = 50 Clickspeed.Value = 1
elseif level.Value == 2 then cost.Value = 125 Clickspeed.Value = 0.8
elseif level.Value == 3 then cost.Value = 300 Clickspeed.Value = 0.7
elseif level.Value == 4 then cost.Value = 800 Clickspeed.Value = 0.6
elseif level.Value == 5 then cost.Value = 2000 Clickspeed.Value = 0.5
elseif level.Value == 6 then cost.Value = 3200 Clickspeed.Value = 0.3
elseif level.Value == 7 then cost.Value = 5000 Clickspeed.Value = 0.2
elseif level.Value == 8 then cost.Value = 11500 Clickspeed.Value = 0.12
elseif level.Value == 9 then cost.Value = 25000 Clickspeed.Value = 0.1
elseif level.Value == 10 then cost.Value = 50000 Clickspeed.Value = 0.07
elseif level.Value == 11 then cost.Value = 100000 Clickspeed.Value = 0.03
elseif level.Value == 12 then cost.Value = 250000 Clickspeed.Value = 0.01
elseif level.Value == 13 then Clickspeed.Value = 0 script.Parent.Parent.Text = "MAX" script.Parent.Parent.TextColor3 = Color3.new(255, 39, 39) script.Parent.Parent.TextStrokeColor3 = Color3.new(170, 10, 10)
end

if ChaChing.Value >= cost.Value then
script.Parent.MouseButton1Down:connect(function()
script.Parent.Sound:Play()
level.Value = level.Value + 1
end)
end

ok more organized sorry it was 2 am when i made dat
Report Abuse
Dman2436 is not online. Dman2436
Joined: 26 May 2012
Total Posts: 1039
11 Aug 2015 03:41 PM
is it a text button?
Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
11 Aug 2015 03:41 PM
Ewww, use tables.

Women are like fine wine, I can't get their tops off
Report Abuse
johny220 is not online. johny220
Joined: 30 Oct 2011
Total Posts: 4584
11 Aug 2015 03:46 PM
bruh i just said it's an imagebutton
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