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: please help with short script

Previous Thread :: Next Thread 
7Mehdi is not online. 7Mehdi
Joined: 12 Jan 2015
Total Posts: 503
25 Oct 2015 07:50 PM
I have this script that raises the value if you click on btn1 and decreases value if you click on btn2, they both work however instead of subtracting -1 when you click button two, it goes back to 1. So if your value is 50 and you click button 2, it'll go to 1. anyone know why this is happening?

local player = game.Players.LocalPlayer
local btn1 = script.Parent.Clothes.Frame3.Work.B
local btn2 = script.Parent.Clothes.Frame3.Work.F

btn1.MouseButton1Down:connect(function()
if player.hiddenstats.Jersey.Value <99 then
player.hiddenstats.Jersey.Value = player.hiddenstats.Jersey.Value +1
btn2.MouseButton1Down:connect(function()
if player.hiddenstats.Jersey.Value >1 then
player.hiddenstats.Jersey.Value = player.hiddenstats.Jersey.Value -1
end
end)
end
end)
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
25 Oct 2015 07:58 PM
local player = game.Players.LocalPlayer
local btn1 = script.Parent.Clothes.Frame3.Work.B
local btn2 = script.Parent.Clothes.Frame3.Work.F

btn1.MouseButton1Down:connect(function()
if player.hiddenstats.Jersey.Value <99 then
player.hiddenstats.Jersey.Value = player.hiddenstats.Jersey.Value +1
end
end)
btn2.MouseButton1Down:connect(function()
if player.hiddenstats.Jersey.Value >1 then
player.hiddenstats.Jersey.Value = player.hiddenstats.Jersey.Value -1
end
end)
Report Abuse
7Mehdi is not online. 7Mehdi
Joined: 12 Jan 2015
Total Posts: 503
25 Oct 2015 08:14 PM
thank you so much
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
25 Oct 2015 08:41 PM
No problem :)
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