Advertisement
ClockworkHorror

ORB

Jul 2nd, 2015
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.37 KB | None | 0 0
  1. wait()
  2.  
  3. _Plr=game:GetService('Players').FinestHours
  4. _Char=_Plr.Character
  5. _Version="1.UNKNOWN"
  6. _Commands={}
  7. _Banlist={15396375}
  8. _OrbParent=nil
  9. _OrbInserted=nil
  10. _OrbGyro=nil
  11. _Disco=true
  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(0/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.             P.Parent=workspace
  127.             P.Anchored=true
  128.             P.Name="Miles Orb".._Version
  129.             P.CanCollide=false
  130.             P.Locked=true
  131.             P.FormFactor='Custom'
  132.             P.Size=Vector3.new(2,2,2)
  133.             P.BottomSurface='Smooth'
  134.             P.TopSurface='Smooth'
  135.             P.BrickColor=BrickColor.Black()
  136.             P.Changed:connect(function()
  137.                 if not workspace:FindFirstChild(P.Name) then
  138.                     AddOrb()
  139.                 end
  140.             end)
  141.             local B=Instance.new('BodyGyro',P)
  142.             _OrbGyro=B
  143.             _OrbParent=P
  144.             _OrbInserted=true
  145.         end
  146.     end) end))
  147. end
  148.  
  149. AddOrb()
  150.  
  151. function Connect_Chat(plr,msg)
  152.     if plr.Name==_Plr.Name then
  153.     Chat(msg)
  154.     local Ran,Error=ypcall(function()
  155.         for _,DATA in pairs(_Commands) do
  156.             if msg:sub(1,#(DATA.Cmd..'/'))==(DATA.Cmd..'/') then
  157.                 msg=msg:sub(#DATA.Cmd+#'/'+1)
  158.                 DATA.Function(_Plr,msg)
  159.             end
  160.         end
  161.     end)
  162.     end
  163. end
  164.  
  165. for _,v in pairs(game.Players:GetPlayers()) do
  166.     v.Chatted:connect(function(msg)
  167.         Connect_Chat(v,msg)
  168.     end)
  169. end
  170.  
  171. game.Players.PlayerAdded:connect(function(v)
  172.     v.Chatted:connect(function(msg)
  173.         Connect_Chat(v,msg)
  174.     end)
  175. end)
  176.  
  177. function Tail()
  178.     coroutine.resume(coroutine.create(function()
  179.         spawn(function()
  180.         if _OrbInserted then
  181.         local Orb=Instance.new('Part',_OrbParent)
  182.         Orb.Name="Trail"
  183.         Orb.Anchored=true
  184.         Orb.Locked=true
  185.         Orb.CanCollide=false
  186.         Orb.Shape="Block"
  187.         if not _Disco then
  188.             Orb.BrickColor=BrickColor.White()
  189.         else
  190.             Orb.BrickColor=BrickColor.Random()
  191.         end
  192.         Orb.FormFactor="Custom"
  193.         Orb.BottomSurface='Smooth'
  194.         Orb.TopSurface='Smooth'
  195.         Orb.Size=Vector3.new(1.9,1.9,1.9)
  196.         for _,v in pairs(Orb:GetChildren())do v:remove() end
  197.         Orb.CFrame=CFrame.new(_OrbParent.CFrame.p)
  198.         local cPos=Orb.CFrame.p
  199.         Orb.Transparency=0.2
  200.         for i=1,10,.5 do
  201.             pcall(function()
  202.                 Orb.Size=Orb.Size-Vector3.new(.1,.1,.1)
  203.                 Orb.Transparency=Orb.Transparency+.01
  204.                 Orb.CFrame=CFrame.new(cPos)
  205.             end)
  206.             game:GetService('RunService').Heartbeat:wait()
  207.             end
  208.         pcall(function() Orb:remove() end)
  209.         end
  210.         end)
  211.     end))
  212. end
  213.  
  214. game:service'RunService'.Heartbeat:connect(function() --RenderStepped
  215.     Tail()
  216.     ConnectTablets()
  217.     for _,plr in pairs(game.Players:GetPlayers()) do CBan(plr) end
  218. end)
  219.  
  220. game.Players.PlayerRemoving:connect(function(plr)
  221.     pcall(function() plr.Character:remove() end)
  222. end)
  223.  
  224. function ConnectTablets()
  225. coroutine.resume(coroutine.create(function() coroutine.wrap(function()
  226.             local Character_Pos=nil
  227.             pcall(function() Character_Pos = CFrame.new(_Plr.Character:WaitForChild('Head').CFrame.p)
  228.             end)
  229.             if _OrbParent.Parent ~= nil then
  230.                 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)
  231.                 local Pos = _OrbParent.CFrame.p
  232.                 Pos = Pos:Lerp(cfr.p,.3)
  233.                 pcall(function()
  234.                     _OrbParent.CFrame = CFrame.new(Pos)*_OrbGyro.cframe
  235.                     _OrbGyro.cframe = _OrbGyro.Gyro.cframe
  236.                 end)
  237.             end
  238. end)() end))
  239. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement