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 » Scripting Helpers
Home Search
 

Re: Thirst Regeneration

Previous Thread :: Next Thread 
mannamed13 is not online. mannamed13
Joined: 18 Jul 2011
Total Posts: 13
31 Dec 2013 08:48 PM
I have tried over and over in creating a script that increases a thirst value. I have already designed the Thirst bar and math.random that makes it lose its value. But what I cannot do is add in a Click Detector into a water block and have it, on MouseButton1Click, to regenerate the Thirst value. Please tell me the things I did right and what I need to do to at least get the script working! Script below:


while true do
mouse.MouseButton1Click:connect(function()
Player.Bars.ThirstFrame.Thirst.Size = (97)(20)
end
end


Thirst function:

script.Parent.ThirstFrame.Thirst.Size = script.Parent.ThirstFrame.Thirst.Size - UDim2.new(0,math.random(1,2),0,0)


Thirst Properties:

Absolute size- [0,97] [0,20] Class name- Frame Style- Custom Size constraint- RelativeXY ZIndex- 1
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
31 Dec 2013 08:55 PM
You only need to connect the function once so take out the while lop, and add a closimg bracket after the end to close your connect method.

Foo.Size = (97)(80) or whatever that was probably needs to be UDim2.new()

posting from phone so i camt rewrite it out for you
Report Abuse
mannamed13 is not online. mannamed13
Joined: 18 Jul 2011
Total Posts: 13
02 Jan 2014 12:13 AM
Thank you! I can't really type well on my phone or get all the characters needed either, I understand.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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