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: Most reliable tween function?

Previous Thread :: Next Thread 
Cleverish is not online. Cleverish
Joined: 19 May 2013
Total Posts: 314
24 Aug 2015 01:53 PM
Does anyone have any super reliable tween functions that they don't mind sharing? Or at least a point in the right direction to make one with a Time feature would be amazing :)

If you're confused on what I mean, I mean like, a function that can tween smoothly between two numbers :)
Report Abuse
Ripepperoni is not online. Ripepperoni
Joined: 04 Jul 2010
Total Posts: 5715
24 Aug 2015 01:55 PM
uhm

http://wiki.roblox.com/index.php?title=Tweening

pls do search before posting
k thanks
Report Abuse
Cleverish is not online. Cleverish
Joined: 19 May 2013
Total Posts: 314
24 Aug 2015 01:57 PM
Pls read my post before posting :)

I don't mean TweenPosition/TweenSize, I just mean number tweening in general. I'm not sure what you would exactly call it, but a smooth transition from one number to another, so it can be used for things like BackgroundTransparency, Position, Size, etc.
Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
24 Aug 2015 01:58 PM
I use math formulas lol

Just make your own
Report Abuse
Cleverish is not online. Cleverish
Joined: 19 May 2013
Total Posts: 314
24 Aug 2015 02:00 PM
@Gnomes, I can make my own, I'm just confused on how to implement the total time it takes to tween into all of it :/
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
24 Aug 2015 02:00 PM
Look in my models

rly kool kat modules

I have a module which was mainly there for cframe interpolation but it'll work just as well for numbers
Report Abuse
LegitimatlyMe is not online. LegitimatlyMe
Joined: 30 Oct 2013
Total Posts: 1108
24 Aug 2015 02:00 PM
(maxVal/maxPercent)*Percent
Report Abuse
Ripepperoni is not online. Ripepperoni
Joined: 04 Jul 2010
Total Posts: 5715
24 Aug 2015 02:00 PM
Then use a foor loop

Or even better be a scrub and still use that tweenfunction

local fake_gui = Instance.new("TextLabel")
fake_gui:TweenPosition(UDim2.new(1,0,0,0),'Out','Quad',1,true)
fake_gui.Changed:connect(function()
true_gui.Transparency = fake_gui.Position.X
end)
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
24 Aug 2015 02:00 PM
wait oopsies ignore me
Report Abuse
Ripepperoni is not online. Ripepperoni
Joined: 04 Jul 2010
Total Posts: 5715
24 Aug 2015 02:02 PM
I never did what i just said but i think it'd work lmao

and then you can still use "Quad","Bounce" and what to ur "tweened" numbers
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
24 Aug 2015 02:05 PM
local function lerp(n1, n2, a)
return (n1+((n2-n1) * a))
end
Report Abuse
EvanHolt is not online. EvanHolt
Joined: 06 Sep 2008
Total Posts: 1264
24 Aug 2015 02:05 PM
Tweening between two numbers:

local current = 0
local totalTime = 0
local start = 53
local end = 127

for i=1, math.abs(end-start) do
if end > start then
current = start + i
else
current = start - i
end
wait(.001)
end
totalTime = .001 * (end-start)

[ George Orwell taught me math! 2 + 2 = 5 ]
Report Abuse
Cleverish is not online. Cleverish
Joined: 19 May 2013
Total Posts: 314
24 Aug 2015 02:09 PM
How does this look?

local a = 10
local b = 30
local t = 2
for i = a,b do
print((b/(b/a))*i/10)
wait(t/(b-a))
end
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