Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DT = game:GetService("DataStoreService"):GetDataStore("USRAGECALC")
- PS = DT:GetAsync("asd")
- PTS = {}
- LNS = {}
- if not PS then
- PS = {}
- DT:SetAsync("asd",PS)
- end
- function NewPL(v)
- local F = false
- for i,g in pairs(PS) do
- if g.Name == v.Name then
- F = true
- g.Age = v.AccountAge
- end
- end
- if not F then
- table.insert(PS,{Name=v.Name,Age=v.AccountAge})
- local C = NewP()
- ypcall(function()
- if PTS[#PTS-1] then
- NewLine(C.P,PTS[#PTS-1].P)
- end
- end)
- end
- DT:SetAsync("asd",PS)
- end
- function NewLine(p1,p2)
- local Line = Instance.new("Part",script)
- Line.Anchored = true
- Line.FormFactor = "Custom"
- Line.CanCollide = false
- Line.Locked = true
- Line.BrickColor = BrickColor.new("White")
- local a = {}
- a.p1 = p1
- a.p2 = p2
- a.Line = Line
- function a:Update()
- local M = (p1.Position-p2.Position).magnitude
- Line.Size = Vector3.new(0,0,M)
- Line.CFrame = CFrame.new(p1.Position,p2.Position)*CFrame.new(0,0,-M/2)
- end
- table.insert(LNS,a)
- return a
- end
- function NewP()
- local R = Instance.new("Model",script)
- local P = Instance.new("Part",R)
- P.Anchored = true
- P.FormFactor = "Custom"
- P.Name = "Head"
- P.CanCollide = false
- P.TopSurface = "Smooth"
- P.BottomSurface = "Smooth"
- P.Locked = true
- P.BrickColor = BrickColor.new("Black")
- P.Size = Vector3.new(0.5,0.5,0.5)
- Instance.new("SpecialMesh",P).MeshType = "Sphere"
- Instance.new("Humanoid",R).MaxHealth = 0
- local c = {}
- c.P = P
- c.R = R
- table.insert(PTS,c)
- return c
- end
- for i,v in pairs(PS) do
- local C = NewP()
- ypcall(function()
- if PTS[#PTS-1] then
- NewLine(C.P,PTS[#PTS-1].P)
- end
- end)
- end
- game.Players.PlayerAdded:connect(function(v)
- NewPL(v)
- end)
- function clerp(a,b,c)
- return CFrame.new(
- a.X+(b.X-a.X)*c,
- a.Y+(b.Y-a.Y)*c,
- a.Z+(b.Z-a.Z)*c
- )
- end
- coroutine.resume(coroutine.create(function()
- for i,v in pairs(game.Players:GetPlayers()) do
- wait(0.5)
- NewPL(v)
- end
- end))
- A = 0
- while wait() do
- A = A +(2/#PS)
- table.sort(PS,function(c,d) if c.Age ~= d.Age then return c.Age > d.Age else return #c.Name>#d.Name end end)
- for i,v in pairs(PS) do
- --print(i,.Name,v.Age)
- for _,g in pairs(PTS) do
- if _ == i then
- g.R.Name = v.Name.."\nAge:"..v.Age.."("..tostring(math.ceil((v.Age/365)*100)/100)..")"
- g.P.CFrame = clerp(g.P.CFrame,
- CFrame.new(0,1+v.Age/50,0)
- *CFrame.Angles(0,math.rad(A),0)
- *CFrame.new(0,0,(i*4)-(#PS*4)/2),
- 0.1)
- --print(g.P.CFrame)
- end
- end
- end
- for i,v in pairs(LNS) do
- ypcall(function()
- v:Update()
- end)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement