|
| 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
|
  |
| 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 |
|
|
| 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 |
|