Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --
- -- Http link: https://www.dropbox.com/s/zsexg0bjbd0b2gt/Function%20Library.lua?dl=1
- --[[ Function Storage ]]--
- -- random generators
- function random2d(x,y,seed)
- local seedMulti = Random.new(seed or 1):NextInteger(1,1000000)
- local xRand = Random.new(x*seedMulti):NextInteger(1,1000000)
- local yRand = Random.new(-y*seedMulti):NextInteger(1,1000000)
- return Random.new(xRand+yRand):NextNumber()
- end
- -- Recursive Children --
- local GetRecursiveChildren=function(P)local t,n,G=table.foreach,{}G=function(c,p)table.insert(n,p)t(p:GetChildren(),G)end t(P:GetChildren(),G)return n end
- -- table clone --
- function cloneTable(t,recursive)
- local e = {}
- for i,v in pairs(t ) do
- local i,v = i,v
- if type(i ) == "table" and recursive then
- i=cloneTable(i,recursive)
- end
- if type(v ) == "table" and recursive then
- v=cloneTable(v,recursive)
- end
- e[i]=v
- end
- setmetatable(e,type(getmetatable(t ))=="table" and getmetatable(t ) or getmetatable(e ))
- return e
- end
- -- Reflect --
- function reflect(input, normal)
- return -2 * input:Dot(normal) * normal + input;
- end
- --Normal Grabber
- local Normals = {} -- Add .lookVector to NormalAngle function to get unit direction of surface in global space
- Normals[1]={Side="Right",SurfaceDistance=function(Part)return(Part.Size.X/2)end,NormalAngle=function(Part)return CFrame.new(Part.Position,
- (Part.CFrame*CFrame.new(1,0,0)).p)end,Normal=Vector3.new(1,0,0),Angle=CFrame.Angles(0,0,math.rad(-90)),is={X=true,Y=false,Z=false}}
- Normals[2]={Side="Top",SurfaceDistance=function(Part)return Part.Size.Y/2 end,NormalAngle=function(Part)return CFrame.new(Part.Position,
- (Part.CFrame*CFrame.new(0,1,0)).p)end,Normal=Vector3.new(0,1,0),Angle=CFrame.Angles(math.rad(0*0),0,0),is={X=false,Y=true,Z=false}}
- Normals[3]={Side="Back",SurfaceDistance=function(Part)return Part.Size.Z/2 end,NormalAngle=function(Part)return CFrame.new(Part.Position,
- (Part.CFrame*CFrame.new(0,0,1)).p)end,Normal=Vector3.new(0,0,1),Angle=CFrame.Angles(math.rad(90),0,0),is={X=false,Y=false,Z=true}}
- Normals[4]={Side="Left",SurfaceDistance=function(Part)return Part.Size.X/2 end,NormalAngle=function(Part)return CFrame.new(Part.Position,
- (Part.CFrame*CFrame.new(-1,0,0)).p)end,Normal=Vector3.new(-1,0,0),Angle=CFrame.Angles(0,0,math.rad(90)),is={X=true,Y=false,Z=false}}
- Normals[5]={Side="Bottom",SurfaceDistance=function(Part)return Part.Size.Y/2 end,NormalAngle=function(Part)return CFrame.new(Part.Position,
- (Part.CFrame*CFrame.new(0,-1,0)).p)end,Normal=Vector3.new(0,-1,0),Angle=CFrame.Angles(math.rad(180),0,0),is={X=false,Y=true,Z=false}}
- Normals[6]={Side="Front",SurfaceDistance=function(Part)return Part.Size.Z/2 end,NormalAngle=function(Part)return CFrame.new(Part.Position,
- (Part.CFrame*CFrame.new(0,0,-1)).p)end,Normal=Vector3.new(0,0,-1),Angle=CFrame.Angles(math.rad(-90),0,0),is={X=false,Y=false,Z=true}}
- -- miners haven
- function getRequiredUpgrades(sval,max,percraise,cap)
- local amount = 0
- local sval = sval
- local tab = {}
- if max then
- repeat
- sval=sval+(sval*percraise)
- amount = amount +1
- table.insert(tab,{sval,amount})
- until sval>=max
- elseif cap then
- for i = 1,cap do
- sval=sval+(sval*percraise)
- amount = amount +1
- table.insert(tab,{sval,amount})
- end
- end
- return amount,sval,tab
- end
- print(getRequiredUpgrades(81000,500000000,0.45))
- -- osu lold--v
- function GetImprovement(a,b)
- return (b-a)/(100-b)
- end
- -- osu --^
- --[[ Lerps ]]--
- -- lerp --
- function lerp(a,b,c)
- return a+(b-a)*c
- end
- local Player = game.Players.LocalPlayer
- local T = Instance.new("Trail",Player.Character.Head)
- T.Texture = "rbxassetid://181044754"
- A0,A1 = Instance.new("Attachment",Player.Character.Head),Instance.new("Attachment",Player.Character.Head)]
- T.Attachment0,T.Attachment1 = A0,A1
- A1.Position = Vector3.new(0,-.5,0)
- function truerandom(a,b)
- return a+(b-a)*math.random()
- end
- -- 2x2 lerp (bilinear)
- function biterpolate(x,y,tl,tr,bl,br)
- local top = tl+(tr-tl)*x
- local bottom = bl+(br-bl)*x
- return top+(bottom-top)*y
- end
- local m = {}
- -- Color lerp --
- function colerp(a,b,c)
- return Color3.new(a.r+(b.r-a.r)*c,a.g+(b.g-a.g)*c,a.b+(b.b-a.b)*c)
- end
- -- Gui lerp --
- function glerp(a,b,c)
- local axs,axo,ays,ayo,bxs,bxo,bys,byo=a.X.Scale,a.X.Offset,a.Y.Scale,a.Y.Offset,b.X.Scale,b.X.Offset,b.Y.Scale,b.Y.Offset
- local xs,xo,ys,yo = axs+(bxs-axs)*c,axo+(bxo-axo)*c,ays+(bys-ays)*c,ayo+(byo-ayo)*c
- xo,yo = (axo-bxo)<0 and math.ceil(xo) or math.floor(xo),(ayo-byo)<0 and math.ceil(yo) or math.floor(yo)
- return UDim2.new(xs,xo,ys,yo)
- end
- -- Vector lerp --
- function vlerp(a,b,c)
- local x=pcall(function()return a.Z end)
- local d=x and Vector3.new or Vector2.new
- return d(a.X+(b.X-a.X)*c,a.Y+(b.Y-a.Y)*c,x and a.Z-(b.Z-a.Z)*c)
- end
- -- CFrame lerp --
- ```lua
- function clerp(a,b,m)
- local c,d={a:components()},{b:components()}
- table.foreach(c,function(a,b)c[a]=c[a]+(d[a]-c[a])*m end)
- return CFrame.new(unpack(c))
- end
- ```
- function squeeze(h,e,c)
- --[[ this function is used to make mountains rarer and plains more common, it
- squeezes height values towards 0.5, which is water level for this terrain generator
- --]]
- if h>=c then
- return c+((((h-c)/c)^e)/2)
- else
- return c-((((c-h)/c)^e)/2)
- end
- end
- print(squeeze(0.5,3,0.6))
- function squeeze(h,e,c)
- if h>=c then
- return c+((h-c)/(1-c))^e*(1-c)
- else
- return c-((c-h)/(c))^e*(c)
- end
- end
- print(squeeze(.6,3,.7))
- function test(tab,iter)
- if iter then
- if iter<=3 then
- iter = iter + 1
- return iter,"asd"
- end
- else
- return 0,"asd"
- end
- end
- for i,v in test,{asd=1,asd2=2,asd3=3} do
- print(i,v)
- end
- ```lua
- function clerp(a,b,m) -- longer, but 5 times more efficient
- local x,y,z,R00,R01,R02,R10,R11,R12,R20,R21,R22 = a:components()
- local x_2,y_2,z_2,R00_2,R01_2,R02_2,R10_2,R11_2,R12_2,R20_2,R21_2,R22_2 = b:components()
- return CFrame.new(x+(x_2-x)*m,y+(y_2-y)*m,z+(z_2-z)*m,R00+(R00_2-R00)*m,R01+(R01_2-R01)*m,
- R02+(R02_2-R02)*m,R10+(R10_2-R10)*m,R11+(R11_2-R11)*m,R12+(R12_2-R12)*m,
- R20+(R20_2-R20)*m,R21+(R21_2-R21)*m,R22+(R22_2-R22)*m)
- end
- ```
- local cf = CFrame.new()
- local cf2 = CFrame.new(10,10,10)
- local s = tick()
- for i = 1,10000 do
- local x = cf:lerp(cf2,0.5)
- end
- print(tick()-s)
- -- Sine lerp --
- --[[function slerp(a,b,c) -- lol
- return a+(b-a)*(1-((math.sin((math.pi*((math.abs(b-a)*c)/math.abs(b-a)))+(math.pi/2))+1)/2))
- end]]
- function slerp(a,b,c)
- return a+(b-a)*((math.sin(math.pi*(c-.5))+1)/2)
- end
- function hslerp(a,b,c)
- return -(a+(b-a)*(1-(math.sin((math.pi/2)*((math.abs(b-a)*c)/math.abs(b-a)))+1)))
- end
- -- exponential lerp (?)
- function xlerp(a,b,c)
- return a+(b-a)*(c*c)
- end
- --[[ |Lerps end| ]]--
- -- Get All BrickColors --
- function GetAllBrickColors()
- local T={}
- for r=1,255,10 do for g=1,255,10 do for b=1,255,10 do
- local C=BrickColor.new(r/255,g/255,b/255)
- if not T[C.Name] then
- T[C.Name]=C.Name
- end
- end end end
- return T
- end
- -- sleep --
- function sleep(T) -- Doesn't work in certain circumstances (doesnt appear to work at all anymore)
- local n = tick()
- repeat coroutine.yield() until tick()-n>(T or 0)
- return tick()-n
- end
- -- Within Area --
- function WithinBounds(x,y,X,Y,Size)
- local a,b,c,d = x<=X+Size,x>=X-Size,y<=Y+Size,y>=Y-Size
- if a and b and c and d then
- return true
- else
- return false
- end
- end
- -- Key Down system --
- local Mouse = game.Players.LocalPlayer:GetMouse()
- local Key = {Down={},AllDown={},Byte={},Mouse = {}}
- Mouse.KeyDown:connect(function(k)
- Key.Down[k]=true
- Key.AllDown[string.lower(k)]=true
- Key.Byte[string.byte(k)]=true
- Key.AllDown[string.upper(k)]=true end)
- Mouse.KeyUp:connect(function(k)
- Key.Down[k]=nil
- Key.AllDown[string.lower(k)]=nil
- Key.Byte[string.byte(k)]=nil
- Key.AllDown[string.upper(k)]=nil end)
- Mouse.Button1Down:connect(function() Key.Mouse[1]=true end)
- Mouse.Button1Up:connect(function() Key.Mouse[1]=nil end)
- Mouse.Button2Down:connect(function() Key.Mouse[2]=true end)
- Mouse.Button2Up:connect(function() Key.Mouse[2]=nil end)
- -- Get Corners of Gui & GetDistance & GetAngle --
- function GetDistance(P1,P2)
- return math.sqrt((P1.x-P2.x)^2 + (P1.y-P2.y)^2)
- end
- function GetLength(x,y)
- return ((x^2)+(y^2))^0.5
- end
- function GetDistance(P1,P2) -- Untested
- local a,b = pcall(function()return P1.X.Offset end),pcall(function()return P2.X.Offset end)
- return math.sqrt((a and(P1.X.Offset-P2.X.Offset)^2 or(P1.X-P2.X)^2)+(b and(P1.Y.Offset-P2.Y.Offset)^2 or(P1.Y-P2.Y)^2))
- end
- ```lua
- function GetCorners(Gui,R) -- R is EXTRA rotation
- local GetDistance = function()return math.sqrt((P1.x-P2.x)^2+(P1.y-P2.y)^2)end
- local Center = Gui.AbsolutePosition+Vector2.new(Gui.AbsoluteSize.X/2,Gui.AbsoluteSize.Y/2)
- local Rot = Gui.Rotation+(R or 0)
- local TLD = GetDistance(Gui.AbsolutePosition,Center)
- local TopLeft = Center+Vector2.new(math.cos(math.rad(Rot-135)),math.sin(math.rad(Rot-135)))*TLD
- local TopRight = Center+Vector2.new(math.cos(math.rad(Rot-45)),math.sin(math.rad(Rot-45)))*TLD
- local BottomLeft = Center+Vector2.new(math.cos(math.rad(Rot+135)),math.sin(math.rad(Rot+135)))*TLD
- local BottomRight = Center+Vector2.new(math.cos(math.rad(Rot+45)),math.sin(math.rad(Rot+45)))*TLD
- return UDim2.new(0,TopLeft.x,0,TopLeft.y),UDim2.new(0,TopRight.x,0,TopRight.y),UDim2.new(0,BottomLeft.x,0,BottomLeft.y),UDim2.new(0,BottomRight.x,0,BottomRight.y)
- end
- ```
- function GetUnitDirection(Rot)
- return math.cos(math.rad(Rot)),math.sin(math.rad(Rot))
- end
- function GetDistanceTest(P,P2,PO) -- Uses Point and GetUnitDirection, less efficient than GetDistance without need of angles
- local RotO = -Vector2.new(GetUnitDirection(PO or Point(P,P2)))
- local Off = P2-P
- local x = Off/RotO
- return x.X
- end
- local function isWithin(a,b,x,y)
- local min,max,ceil,floor = math.min,math.max,math.ceil,math.floor
- local ra = {x=floor(min(a.x,b.x)),y=floor(min(a.y,b.y))}
- local rb = {x=ceil(max(a.x,b.x)),y=ceil(max(a.y,b.y))}
- if x>=ra.x and x<=rb.x and y>=ra.y and y<=rb.y then
- return true
- end
- end
- local function GetIntersection(a,b,c,d)
- local slope1 = (b.y-a.y)/(b.x-a.x)
- local ycept1 = a.y-(slope1*a.x)
- local slope2 = (d.y-c.y)/(d.x-c.x)
- local ycept2 = c.y-(slope2*c.x)
- local slope3 = (slope2-slope1)
- local ycept3 = (ycept2-ycept1)
- local x = -(ycept3/slope3)
- local y = (slope1*x)+ycept1
- if isWithin(a,b,x,y) and isWithin(c,d,x,y) then
- return V2(x,y)
- end
- end
- function WithinBounds(P1,P2,TDI) -- TDI = Total radius, obj1.radius+obj2.radius
- local a = pcall(function()return P1.X.Offset end)
- local b = pcall(function()return P2.X.Offset end)
- return (((a and(P1.X.Offset-P2.X.Offset) or(P1.X-P2.X))^2)+((b and(P1.Y.Offset-P2.Y.Offset) or(P1.Y-P2.Y))^2))<(TDI/2)^2
- end
- function Point(V1,V2)
- local X,Y=V1.X-V2.X,V1.Y-V2.Y
- local AS=math.atan2(Y,X)
- return 360*(AS/(math.pi*2))
- end
- function GetAngle(V1,V2)
- local Adjacent,Opposite = V2.X-V1.X,V2.Y-V1.Y
- local Hypotenuse = ((Adjacent^2)+(Opposite^2))^0.5
- local Sine,Cosine = Opposite/Hypotenuse,Adjacent/Hypotenuse
- local OppositeAngle = math.asin(Sine)
- local AdjacentAngle = math.acos(Cosine)
- local RealAngle = (OppositeAngle<0 and math.pi+(math.pi-AdjacentAngle) or AdjacentAngle)
- return 360*(RealAngle/(math.pi*2))
- end
- function Point(UD1,UD2)
- local a,b=pcall(function()return UD1.X.Offset end),pcall(function()return UD2.X.Offset end)
- local X,Y=(a and UD1.X.Offset or UD1.X)-(b and UD2.X.Offset or UD2.X),(a and UD1.Y.Offset or UD1.Y)-(b and UD2.Y.Offset or UD2.Y)
- local AS=math.atan2(Y,X)
- return 360*(AS/(math.pi*2))
- end
- local function fibonacci_sphere(samples,randomize)
- local samples = samples or 1
- local rnd = 1
- if randomize then
- rnd = math.random() * samples
- end
- local points = {}
- local offset = 2/samples
- local increment = math.pi * (3 - math.sqrt(5));
- local cos,sin,insert = math.cos,math.sin,table.insert
- for i = 1,samples do--range(samples):
- local y = ((i * offset) - 1) + (offset / 2);
- local r = (1 - y^2)^0.5
- local phi = ((i + rnd) % samples) * increment
- local x = cos(phi) * r
- local z = sin(phi) * r
- insert(points,{x,y,z})
- end
- return points
- end
- -- New Server --
- function NewServer() -- Only works in SBs supporting NewLocalScript
- if not NewLocalScript then return end
- Instance.new("Hint",Workspace).Text = "Creating a new server..."
- wait(1)
- print("Start...")
- while wait() do
- for i,v in pairs(game.Players:GetPlayers()) do
- print("Teleported "..tostring(v))
- if NewLocalScript then
- local Par = v:FindFirstChild("Backpack") or v.Character or v:FindFirstChild("PlayerGui")
- NewLocalScript(Par,[[
- a,b = ypcall(function()
- game.Players.LocalPlayer:Kick()
- wait(5)
- game:GetService("TeleportService"):Teleport(game.PlaceId)
- end)
- if not a then
- print(b)
- end
- ]])
- end
- end
- end
- end
- -- Time and Date
- ```lua
- local date = {}
- function date:GetTime(e,full)
- return
- (not full and math.floor((e or tick())/31556900) or tick()/31556900)+1970, -- years
- not full and math.floor(((e or tick())%31556900)/86400) or ((e or tick())%31556900)/86400, -- days
- not full and math.floor((((e or tick())%86400)/3600)) or (((e or tick())%86400)/3600), -- hours
- not full and math.floor((((e or tick())%86400)%3600)/60) or (((e or tick())%86400)%3600)/60, -- minutes
- not full and math.floor((((e or tick())%86400)%3600)%60) or (((e or tick())%86400)%3600)%60 -- seconds
- end
- function date:TimeToSeconds(seconds,minutes,hours,days,years)
- local years,days,hours,minutes,seconds = years or 0, days or 0, hours or 0, minutes or 0, seconds or 0
- return (years*31556900)+(days*86400)+(hours*3600)+(minutes*60)+seconds
- end
- print(date:GetTime(tick()))
- ```
- ```lua
- local Time = {} -- improved
- function Time:GetDate(e)
- local e,floor = e or tick(),math.floor
- local years = floor(e/31556900)+1970
- local days = floor((e%31556900)/86400)
- local hours = floor((e%86400)/3600)
- local minutes = floor((e%3600)/60)
- local seconds = floor(e%60)
- local milliseconds = floor((e%1)/0.001)
- return years,days,hours,minutes,seconds,milliseconds
- end
- function Time:TimeToSeconds(seconds,minutes,hours,days,years)
- local years,days,hours,minutes,seconds = years or 0, days or 0, hours or 0, minutes or 0, seconds or 0
- return (years*31556900)+(days*86400)+(hours*3600)+(minutes*60)+seconds
- end
- print(Time:GetDate(os.time()))
- ```
- while wait() do
- Instance.new("Humanoid",Workspace):Destroy(wait())
- end
- local GetRecursiveChildren=function(P)local t,n,G=table.foreach,{}G=function(c,p)table.insert(n,p)t(p:GetChildren(),G)end t(P:GetChildren(),G)return n end
- for i,v in pairs(GetRecursiveChildren(Workspace)) do
- if v.ClassName=="PointLight" then
- v.Shadows = true
- v.Range=20
- v.ShadowCutoff = 1
- end
- end
- local function(self)
- end
- local c0 = {
- RightArm = CF(1.5,0.5,0),
- LeftArm = CF(-1.5,0.5,0),
- RightLeg = CF(0.5,-1,0),
- LeftLeg = CF(-0.5,-1,0),
- RootJoint = CF(0,0,0),
- Neck = CF(0,1,0)
- }
- local c1 = {
- RightArm = CF(0,0.5,0),
- LeftArm = CF(0,0.5,0),
- RightLeg = CF(0,1,0),
- LeftLeg = CF(0,1,0),
- RootJoint = CF(0,0,0),
- Neck = CF(0,-0.5,0)
- }
- -- fancy lighting --
- local p = Instance.new("Part",Workspace.CurrentCamera)
- p.Anchored = true
- p.Material = "Neon"
- p.FormFactor = "Custom"
- p.Size = Vector3.new(100,100,0)
- p.Transparency = 0.9
- p.CanCollide = false
- Workspace.CurrentCamera.FieldOfView = 50
- local Sun = Instance.new("SunRaysEffect",Workspace.CurrentCamera)
- Sun.Intensity = 0.15
- Sun.Spread = 0.8
- local Color = Instance.new("ColorCorrectionEffect",Workspace.CurrentCamera)
- Color.TintColor=Color3.new(255/255,247/255,215/255)
- local Blur = Instance.new("BlurEffect",Workspace.CurrentCamera)
- Blur.Size = 0.6
- game:GetService("RunService").RenderStepped:connect(function()
- p.CFrame = Workspace.CurrentCamera.CoordinateFrame*CFrame.new(0,0,-5)
- end)
- function GetParents(obj)
- local txt = obj.Name
- local tbl = {}
- local lastobj = obj
- repeat
- asd = lastobj.Parent
- txt = asd.Name.."."..txt
- lastobj = asd
- table.insert(tbl,lastobj)
- until lastobj == game
- return txt,tbl
- end
- ```lua
- function Point(UD1,UD2)
- local X,Y=UD1.X-UD2.X,UD1.Y-UD2.Y
- local AS=math.atan2(Y,X)
- return 360*(AS/(math.pi*2))
- end
- function GetUnitDirection(Rot)
- return math.cos(math.rad(Rot)),math.sin(math.rad(Rot))
- end
- local x = Point(Vector2.new(0,0),Vector2.new(-5,-5))
- local a,b = GetUnitDirection(x)
- print((a*9000000),(b*9000000))
- ```
- function pair(x,y)
- return (x^2+3*x+2*x*y+y+y^2)/2
- end
- function GetDistance(P1,P2)
- return math.sqrt((P1.x-P2.x)^2 + (P1.y-P2.y)^2)
- end
- print(GetDistance(Vector2.new(0,0),Vector2.new(4500000,4500000)))
- function GetIntersection(a,b,c,d)
- -- get abc of a,b
- local a1 = b.y-a.y
- local b1 = a.x-b.x
- local c1 = a1*a.x + b1*a.y
- -- get abc of c,d
- local a2 = d.y-c.y
- local b2 = c.x-d.x
- local c2 = a2*c.x + b2*c.y
- local determinant = a1*b2 - a2*b1
- if determinant ~= 0 then
- local x = (b2*c1 - b1*c2)/determinant
- local y = (a1*c2 - a2*c1)/determinant
- if isWithin(a,b,x,y) and isWithin(c,d,x,y) then
- return {x=x,y=y}
- end
- end
- end
- intersect_sphere = function(Ray_Pos,Ray_Dir,Sphere_Pos,Sphere_Size)
- local Offset = Ray_Pos-Sphere_Pos -- L
- local distance_To_Plane = -Offset:Dot(Ray_Dir)
- if distance_To_Plane<0 then return end
- local ray_Plane_Position = Ray_Pos+(Ray_Dir*distance_To_Plane)
- local sphere_Plane_Distance = (ray_Plane_Position-Sphere_Pos).magnitude
- if sphere_Plane_Distance>Sphere_Size then return end
- local distance_To_Plane_Position = ((Sphere_Size^2)-(sphere_Plane_Distance^2))^.5
- local distance_To_Intersect = distance_To_Plane-distance_To_Plane_Position
- return distance_To_Intersect,distance_To_Plane,distance_To_Plane_Position,sphere_Plane_Distance
- end
- function matrix_multiply(a,b)
- local result,arows,acols,brows,bcols = {},#a,#a[1],#b,#b[1]
- for i = 1,arows do
- local row,resultRow = a[i],{}
- for i2 = 1,bcols do
- local r = 0
- for i3 = 1,acols do
- r = r + (row[i3]*b[i3][i2])
- end
- resultRow[i2]=r
- end
- result[i]=resultRow
- end
- return result
- end
- -- for farmtown
- function getValue(sproutTime,plantCount,travelTime)
- local sproutTime=sproutTime+(travelTime or 0)
- local moneyPerHarvest = 3.2*plantCount
- local moneyPerSecond = moneyPerHarvest/sproutTime
- local moneyPerMinute = moneyPerSecond*60
- local moneyPerHour = (moneyPerMinute*60)-3000
- print(moneyPerHour,(moneyPerMinute*60))
- return moneyPerHour*4,moneyPerMinute,moneyPerSecond,moneyPerHarvest
- end
- print(getValue(115,104))
- function plotValue(wc,spc,fc,suc)
- return ((wc*6)+(spc*7)+(fc*9)+(suc*10))/32
- end
- print(plotValue(1486,856,804,670))
- local t = {
- {35923,39207,22176,20808,17293}
- {8302,7697,6820,6216,29035};
- {8921,8144,7051,6320,30438};
- {5137,4767,4220,3835,17959};
- {4827,4483,3974,3614,16899};
- {4022,3745,3328,3031,14127};
- }
- for i,v in pairs(t) do
- for a,b in pairs(v) do
- v[a]=b/6
- end
- print(unpack(v))
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement