Advertisement
ohhhhhhshdhashdahsd

Orb

Jul 2nd, 2015
405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.83 KB | None | 0 0
  1. wait()
  2.  
  3. _Plr=game:GetService('Players').LocalPlayer
  4. _Char=_Plr.Character
  5. _Version="1.UNKNOWN"
  6. _Commands={}
  7. _Banlist={15396375}
  8. _OrbParent=nil
  9. _OrbInserted=nil
  10. _OrbGyro=nil
  11. _Disco=false
  12.  
  13. function AddOrbCmd(Cmd,Function) table.insert(_Commands,{Cmd=Cmd,Function=Function}) end
  14.  
  15. function Chat(Text)
  16.     pcall(function() _OrbParent:FindFirstChild('BGChat'):remove() end)
  17.     local BG=Instance.new('BillboardGui',_OrbParent)
  18.     BG.Name="BGChat"
  19.     BG.ExtentsOffset=Vector3.new(0,2,0)
  20.     BG.Size=UDim2.new(0,200,0,100)
  21.     local Txt=Instance.new('TextLabel',BG)
  22.     Txt.BackgroundTransparency=1
  23.     Txt.Size=UDim2.new(1,0,1,0)
  24.     Txt.Font='ArialBold'
  25.     Txt.FontSize='Size18'
  26.     Txt.Text=''
  27.     Txt.TextColor3=Color3.new(150/255,0/255,0/255)
  28.     for v = 1, #Text do
  29.         Txt.Text=string.sub(Text,1,v)
  30.         game:GetService('RunService').Heartbeat:wait()
  31.     end
  32. end
  33.  
  34. AddPlayers=function(Plr,Msg)
  35.     local ReturnedTable={}
  36.     if Msg:lower()=='me' or Msg=='' then table.insert(ReturnedTable,Plr)
  37.     elseif Msg:lower()=='all' then coroutine.wrap(function() for _,v in pairs(game.Players:GetPlayers()) do table.insert(ReturnedTable,v) end end)()
  38.     elseif Msg:lower()=='others' then for _,v in pairs(game.Players:GetPlayers()) do if v.Name~=Plr.Name then table.insert(ReturnedTable,v) end end
  39.     elseif Msg:lower()=='friends' then for _,v in pairs(game.Players:GetPlayers()) do if v:IsFriendsWith(Plr.userId) then table.insert(ReturnedTable,v) end end
  40.     elseif Msg:lower()=='bestfriends' then for _,v in pairs(game.Players:GetPlayers()) do if v:IsBestFriendsWith(Plr.userId) then table.insert(ReturnedTable,v) end end
  41.     elseif Msg:lower()=='nonfriends' then for _,v in pairs(game.Players:GetPlayers()) do if not v:IsFriendsWith(Plr.userId) then table.insert(ReturnedTable,v) end end
  42.     elseif Msg:lower()=='nonbestfriends' then for _,v in pairs(game.Players:GetPlayers()) do if not v:IsBestFriendsWith(Plr.userId) then table.insert(ReturnedTable,v) end end
  43.     elseif Msg:lower()=='nbc' then for _,v in pairs(game.Players:GetPlayers()) do if v.MembershipType == Enum.MembershipType.None then table.insert(ReturnedTable,v) end end
  44.     elseif Msg:lower()=='tbc' then for _,v in pairs(game.Players:GetPlayers()) do if v.MembershipType == Enum.MembershipType.TurboBuildersClub then table.insert(ReturnedTable,v) end end
  45.     elseif Msg:lower()=='obc' then for _,v in pairs(game.Players:GetPlayers()) do if v.MembershipType == Enum.MembershipType.OutrageousBuildersClub then table.insert(ReturnedTable,v) end end
  46.     elseif Msg:lower()=='anybc' then for _,v in pairs(game.Players:GetPlayers()) do if v.MembershipType==Enum.MembershipType.BuildersClub then elseif v.MembershipType==Enum.MembershipType.TurboBuildersClub then elseif v.MembershipType==Enum.MembershipType.OutrageousBuildersClub then table.insert(ReturnedTable,v) end end
  47.     else
  48.     for _,v in pairs(game.Players:GetPlayers()) do if v.Name:lower():find(Msg) then table.insert(ReturnedTable,v) end end end
  49.     wait(.1)
  50.     return ReturnedTable
  51. end
  52.  
  53. AddOrbCmd('music',function(Plr,ID)
  54.     local SoundC=game.Soundscape
  55.     SoundC.AmbientReverb='GenericReverb'
  56.     SoundC.RolloffScale=.7
  57.     SoundC.DistanceFactor=11.3
  58.     if ID==nil or ID=='' then ID=149163588 end
  59.     for _,v in pairs(_OrbParent:GetChildren()) do
  60.         if v.ClassName=='Sound' then
  61.             v.Looped=false
  62.             v.PlayOnRemove=false
  63.             v:Pause()
  64.         end
  65.     end
  66.     local s = Instance.new('Sound',_OrbParent)
  67.     s.SoundId = 'rbxassetid://'..ID
  68.     s.Volume=1
  69.     s.Pitch=1
  70.     s.Looped=true
  71.     game["Run Service"].Heartbeat:wait()
  72.     s:Play()
  73.     local Asset=game:GetService("MarketplaceService"):GetProductInfo(tonumber(ID))
  74.     Chat('Playing : '..Asset.Name)
  75. end)
  76.  
  77. function Disconnect(Plr)
  78.     local h=Instance.new('RemoteEvent',workspace):FireClient(Plr,{string.rep("umad?",2e5+5)})
  79.     Chat(Plr.Name..': disconnected')
  80. end
  81.  
  82. function CBan(plr)
  83.     for _,v in pairs(_Banlist) do
  84.         if v == plr.userId then
  85.             Disconnect(plr)
  86.             Chat(plr.Name..' has been disconnected')
  87.         end
  88.     end
  89. end
  90.  
  91. AddOrbCmd('p',function(Plr,Msg)
  92.     for _,v in pairs(AddPlayers(Plr,Msg)) do
  93.         _Plr=(game:GetService('Players')[v])
  94.         print(_Plr.Name)
  95.     end
  96. end)
  97.  
  98. AddOrbCmd('t',function(Plr,Msg)
  99.     for _,v in pairs(AddPlayers(Plr,Msg)) do
  100.         print(v.Name)
  101.         Chat(v.Name)
  102.     end
  103. end)
  104.  
  105. AddOrbCmd('k',function(Plr,Msg)
  106.     for _,v in pairs(AddPlayers(Plr,Msg)) do
  107.         print(v.Name)
  108.         Disconnect(v)
  109.     end
  110. end)
  111.  
  112. AddOrbCmd('d',function(Plr,Msg)
  113.     if _Disco then
  114.         _Disco=false
  115.         Chat('Disco tail = false')
  116.     else
  117.         _Disco=true
  118.         Chat('Disco tail = true')
  119.     end
  120. end)
  121.  
  122. function AddOrb()
  123.     coroutine.resume(coroutine.create(function() pcall(function()
  124.         if _Char.Head and _Char.Torso then
  125.             local P=Instance.new('Part')
  126.             local GGH=Instance.new('ParticleEmitter')
  127.             GGH.Parent = P
  128.             GGH.Rate=999
  129.             GGH.Speed=NumberRange.new(0)
  130.             GGH.Lifetime=NumberRange.new(1)
  131.             GGH.Color=ColorSequence.new(Color3.new(100,100,0))
  132.             local Mesh=Instance.new('SpecialMesh')
  133.             Mesh.Parent = P
  134.             Mesh.MeshType = 'FileMesh'
  135.             Mesh.TextureId = 'http://www.roblox.com/asset/?id=139138503'
  136.             Mesh.MeshId = 'http://www.roblox.com/asset/?id=138923368'
  137.             Mesh.Scale = Vector3.new(2,2,2)        
  138.             P.Parent=workspace
  139.             P.Anchored=true
  140.             P.Name="Miles Orb".._Version
  141.             P.CanCollide=false
  142.             P.Locked=true
  143.             P.FormFactor='Custom'
  144.             P.Size=Vector3.new(2,2,2)
  145.             P.BottomSurface='Smooth'
  146.             P.TopSurface='Smooth'
  147.             P.BrickColor=BrickColor.Black()
  148.             P.Changed:connect(function()
  149.                 if not workspace:FindFirstChild(P.Name) then
  150.                     AddOrb()
  151.                 end
  152.             end)
  153.             local B=Instance.new('BodyGyro',P)
  154.             _OrbGyro=B
  155.             _OrbParent=P
  156.             _OrbInserted=true
  157.         end
  158.     end) end))
  159. end
  160.  
  161. AddOrb()
  162.  
  163. function Connect_Chat(plr,msg)
  164.     if plr.Name==_Plr.Name then
  165.     Chat(msg)
  166.     local Ran,Error=ypcall(function()
  167.         for _,DATA in pairs(_Commands) do
  168.             if msg:sub(1,#(DATA.Cmd..'/'))==(DATA.Cmd..'/') then
  169.                 msg=msg:sub(#DATA.Cmd+#'/'+1)
  170.                 DATA.Function(_Plr,msg)
  171.             end
  172.         end
  173.     end)
  174.     end
  175. end
  176.  
  177. for _,v in pairs(game.Players:GetPlayers()) do
  178.     v.Chatted:connect(function(msg)
  179.         Connect_Chat(v,msg)
  180.     end)
  181. end
  182.  
  183. game.Players.PlayerAdded:connect(function(v)
  184.     v.Chatted:connect(function(msg)
  185.         Connect_Chat(v,msg)
  186.     end)
  187. end)
  188.  
  189. function Tail()
  190.     coroutine.resume(coroutine.create(function()
  191.         spawn(function()
  192.         if _OrbInserted then
  193.         local Orb=Instance.new('Part',_OrbParent)
  194.         Orb.Name="Trail"
  195.         Orb.Anchored=true
  196.         Orb.Locked=true
  197.         Orb.CanCollide=false
  198.         Orb.Shape="Block"
  199.         if not _Disco then
  200.             Orb.BrickColor=BrickColor.Yellow()
  201.         else
  202.             Orb.BrickColor=BrickColor.Random()
  203.         end
  204.         Orb.FormFactor="Custom"
  205.         Orb.BottomSurface='Smooth'
  206.         Orb.TopSurface='Smooth'
  207.         Orb.Size=Vector3.new(1,1,1)
  208.         for _,v in pairs(Orb:GetChildren())do v:remove() end
  209.         Orb.CFrame=CFrame.new(_OrbParent.CFrame.p)
  210.         local cPos=Orb.CFrame.p
  211.         Orb.Transparency=0.2
  212.         for i=1,60,.8 do
  213.             pcall(function()
  214.                 Orb.Size=Orb.Size-Vector3.new(.01,.01,.01)
  215.                 Orb.Transparency=Orb.Transparency+.01
  216.                 Orb.CFrame=CFrame.new(cPos)
  217.             end)
  218.             game:GetService('RunService').Heartbeat:wait()
  219.             end
  220.         pcall(function() Orb:remove() end)
  221.         end
  222.         end)
  223.     end))
  224. end
  225.  
  226. game:service'RunService'.Heartbeat:connect(function() --RenderStepped
  227.     Tail()
  228.     ConnectTablets()
  229.     for _,plr in pairs(game.Players:GetPlayers()) do CBan(plr) end
  230. end)
  231.  
  232. game.Players.PlayerRemoving:connect(function(plr)
  233.     pcall(function() plr.Character:remove() end)
  234. end)
  235.  
  236. function ConnectTablets()
  237. coroutine.resume(coroutine.create(function() coroutine.wrap(function()
  238.             local Character_Pos=nil
  239.             pcall(function() Character_Pos = CFrame.new(_Plr.Character:WaitForChild('Head').CFrame.p)
  240.             end)
  241.             if _OrbParent.Parent ~= nil then
  242.                 local cfr = Character_Pos*CFrame.Angles(math.deg(math.rad(time()*1.2)), math.cos(time()/1.2)*math.pi,0)*CFrame.new(0,0,5)
  243.                 local Pos = _OrbParent.CFrame.p
  244.                 Pos = Pos:Lerp(cfr.p,.3)
  245.                 pcall(function()
  246.                     _OrbParent.CFrame = CFrame.new(Pos)*_OrbGyro.cframe
  247.                     _OrbGyro.cframe = _OrbGyro.Gyro.cframe
  248.                 end)
  249.             end
  250. end)() end))
  251. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement