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: double arithmetics

Previous Thread :: Next Thread 
ehern11 is not online. 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 is not online. 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 is not online. ehern11
Joined: 23 Apr 2011
Total Posts: 1541
01 Jun 2015 10:52 AM
bump
Report Abuse
eLunate is not online. 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 is not online. ehern11
Joined: 23 Apr 2011
Total Posts: 1541
01 Jun 2015 11:50 AM
the size in offset is 12..?
Report Abuse
eLunate is not online. 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 is not online. 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 is not online. 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 is not online. ehern11
Joined: 23 Apr 2011
Total Posts: 1541
01 Jun 2015 12:28 PM
it still keeps coming up as 12.
Report Abuse
eLunate is not online. 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 is not online. 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 is not online. ehern11
Joined: 23 Apr 2011
Total Posts: 1541
01 Jun 2015 03:34 PM
bump
Report Abuse
ehern11 is not online. ehern11
Joined: 23 Apr 2011
Total Posts: 1541
01 Jun 2015 05:33 PM
bump
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