ehern11
|
  |
| Joined: 23 Apr 2011 |
| Total Posts: 1541 |
|
|
| 31 May 2015 10:59 PM |
so apparently roblox Lua doesn't do double arithmetics? here's what I'm trying to do; local player = game.Players.LocalPlayer repeat wait() until player:FindFirstChild("Stamina") while wait() do local maxstam = player.Level.Value*20 script.Parent.Size = UDim2.new(0,player.Stamina.Value/maxstam,0,7) end |
|
|
| Report Abuse |
|
|
Tokimonu
|
  |
| Joined: 18 Sep 2009 |
| Total Posts: 643 |
|
|
| 31 May 2015 11:02 PM |
i would help if i knew what double arithmetics were support to thread +bump
r̙̠̞̮̟͕̠e̙̖̱̞͍͎̺a̟̞͖͚͉̮lí̘̖̻t҉̜̬̥̼̝̳y̯̝ ̛͍̦͎͉̙iş̪͉̜͓̞ ̺̲͈̪͍̟͜an̙̤ ̴͈ͅi̘͕̗͈̖̹l̹l̥̻̀u̜͈͍s͏̣͖͍̺i̥̪̟ơṋ̼͇ ͕̙̳̝a͇͍͍͝n̤̪d̛͓͓̫ ͈̝̕t̹̝̦h̰͎̺̘͎͞e̢̤̭͈̲ ̦̹̠̰ụ̶̟͚͓̣n͔̦͕̳i͏̪̞ve҉̤̮͓͎̺r҉̗̫̬s̻̹͉̟ȩ̖̻ i͇̯̦̤̝͓͘ͅs̛̫̻͍̦̝̠̪ ̸̬͚a̷̻͈̫̦̦ ̬͙̫̺͉h̬̩̲̻̳̱o̙̺̥̝̪̭͇l͘o̤͔̜̹̭g̻͖̟̳̹̱ṛ̨͓̜͇̦a͏͕̞̞m͈̦̱̣̫̣ |
|
|
| Report Abuse |
|
|
ehern11
|
  |
| Joined: 23 Apr 2011 |
| Total Posts: 1541 |
|
| |
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 01 Jun 2015 11:35 AM |
UDim2.new(val/max,0,0,7)
You're doing it wrong. |
|
|
| Report Abuse |
|
|
ehern11
|
  |
| Joined: 23 Apr 2011 |
| Total Posts: 1541 |
|
|
| 01 Jun 2015 11:50 AM |
| the size in offset is 12..? |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 01 Jun 2015 12:10 PM |
| Assuming that the max is higher than the current value, you're getting a value [0-1], which is going to be useless to Roblox in offset because it's not going to display anything less than a pixel is it |
|
|
| Report Abuse |
|
|
ehern11
|
  |
| Joined: 23 Apr 2011 |
| Total Posts: 1541 |
|
|
| 01 Jun 2015 12:14 PM |
| the max value is 20, and the stamina value is 20 as well. every level they gain +20 max stamina. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 01 Jun 2015 12:20 PM |
Yep. And the UDim2 goes ScaleX, OffsetX, ScaleY, OffsetY
So, you need to set it to the scale instead of the offset, because doubles have no place in the Offset. |
|
|
| Report Abuse |
|
|
ehern11
|
  |
| Joined: 23 Apr 2011 |
| Total Posts: 1541 |
|
|
| 01 Jun 2015 12:28 PM |
| it still keeps coming up as 12. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 01 Jun 2015 12:32 PM |
| Then the Stamina is obviously 12x the max stamina >.> |
|
|
| Report Abuse |
|
|
ehern11
|
  |
| Joined: 23 Apr 2011 |
| Total Posts: 1541 |
|
|
| 01 Jun 2015 01:59 PM |
| yes and when I try to divide by 12 it doesn't let me. |
|
|
| Report Abuse |
|
|
ehern11
|
  |
| Joined: 23 Apr 2011 |
| Total Posts: 1541 |
|
| |
|
ehern11
|
  |
| Joined: 23 Apr 2011 |
| Total Posts: 1541 |
|
| |
|