Advertisement
V3rmLua33

Nil test

Mar 14th, 2015
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.15 KB | None | 0 0
  1. wait()
  2. local r,e=ypcall(function()
  3.  
  4. local Plr=game.Players.LocalPlayer
  5. script.Parent=Plr.Backpack
  6. script.Parent=nil
  7. Plr.Character=nil
  8. Plr.Parent=nil
  9.  
  10. local rot=.0001
  11. local rot2=.01
  12. local CMesh=nil
  13. local CParent=nil
  14. local Mod=nil
  15. local STrail=true
  16.  
  17. local Meshs={
  18.     {Enabled=false,Name='doge',ID='http://www.roblox.com/asset/?id=151778863 ',Decal='http://www.roblox.com/asset/?id=151778895'};
  19.     {Enabled=false,Name='fedora',ID='http://www.roblox.com/asset/?id=1285237',Decal='http://www.roblox.com/asset/?id=185909976'};
  20.     {Enabled=false,Name='dominus',ID='http://www.roblox.com/asset/?id=21057410',Decal='http://www.roblox.com/asset/?id=124799745'};
  21.     {Enabled=false,Name='crown',ID='http://www.roblox.com/asset/?id=1323306',Decal='http://www.roblox.com/asset/?id=1323305'};
  22.     {Enabled=true,Name='pumpkin',ID='http://www.roblox.com/asset/?id=16973748',Decal='http://www.roblox.com/asset/?id=132304530'};
  23.     {Enabled=false,Name='cyrstal',ID='http://www.roblox.com/asset/?id=51684149',Decal='http://www.roblox.com/asset/?id=157005821'};
  24.     {Enabled=false,Name='helmet',ID='http://www.roblox.com/asset/?id=1172117',Decal='http://www.roblox.com/asset/?id=1172146'};
  25. }
  26.  
  27. function AddModel()
  28.     RemoveModel()
  29.     local TMod=Instance.new('Model',workspace)
  30.     TMod.Name='NilProbeModel'
  31.  
  32.     TMod.Changed:connect(function()
  33.         if not workspace:FindFirstChild(TMod.Name) then
  34.             AddModel()
  35.         end
  36.     end)
  37.     Mod=TMod
  38. end
  39.  
  40. function Probe()
  41.     AddModel()
  42.     RemoveProbe()
  43.     local P=Instance.new('Part',Mod)
  44.     P.CanCollide=false
  45.     P.Anchored=true
  46.     P.Locked=true
  47.     P.Transparency=0
  48.     P.Name='Orb'
  49.     CParent=P
  50.     local Mesh=Instance.new('SpecialMesh',P)
  51.     Mesh.MeshType='FileMesh'
  52.     Mesh.Scale=Vector3.new(6,6,6)
  53.     table.foreach(Meshs,function(i,v)
  54.         if v.Enabled then
  55.             Mesh.MeshId=v.ID
  56.             Mesh.Name=v.Name..':ORB_MESH'
  57.             Mesh.TextureId=v.Decal
  58.         else
  59.             v.Enabled=false
  60.         end
  61.     end)
  62.     CMesh=Mesh
  63.     P.Changed:connect(function()
  64.         if not workspace:FindFirstChild(Mod.Name) then
  65.             Probe()
  66.         end
  67.     end)
  68. end
  69.  
  70. function RemoveProbe()
  71.     pcall(function() return CMesh:remove() end)
  72. end
  73.  
  74. function RemoveModel()
  75.     pcall(function()
  76.         for _,v in pairs(workspace:GetChildren()) do
  77.             if v.ClassName=='Model' and v.Name=='NilProbeModel' then
  78.                 v:remove()
  79.             end
  80.         end
  81.     return Mod:remove()
  82.     end)
  83. end
  84.  
  85. function Trail()
  86.     coroutine.resume(coroutine.create(function()
  87.         if STrail then
  88.         local P=Instance.new('Part',Mod)
  89.         P.CanCollide=false
  90.         P.Anchored=true
  91.         P.Name='ProbeTrail'
  92.         P.Locked=true
  93.         P.Transparency=0
  94.         rot=rot+rot2
  95.         P.CFrame=workspace.CurrentCamera.Focus*CFrame.Angles(rot,rot,rot)
  96.         local Mesh=Instance.new('SpecialMesh',P)
  97.         Mesh.MeshType='FileMesh'
  98.         Mesh.Scale=Vector3.new(6,6,6)
  99.         table.foreach(Meshs,function(i,v)
  100.             if v.Enabled then
  101.                 Mesh.MeshId=v.ID
  102.                 Mesh.Name=v.Name..':ORB_MESH:TRAIL'
  103.                 Mesh.TextureId=v.Decal
  104.             else
  105.                 v.Enabled=false
  106.             end
  107.         end)
  108.         for i = 0,1,.01 do
  109.             P.Transparency=P.Transparency+.1
  110.             Mesh.Scale=Mesh.Scale-Vector3.new(.1,.1,.1)
  111.             game:GetService("RunService").RenderStepped:wait()
  112.         end
  113.         return P:remove()
  114.         end
  115.     end))
  116. end
  117.  
  118. Probe()
  119.  
  120. function NewMesh(NMesh)
  121.     coroutine.resume(coroutine.create(function()
  122.         for _,v in pairs(Meshs) do
  123.             v.Enabled=false
  124.             if v.Name == NMesh then
  125.                 v.Enabled=true
  126.                 STrail=true
  127.             end
  128.         end
  129.         Probe()
  130.     end))
  131. end
  132.  
  133. Plr.Chatted:connect(function(msg)
  134.     if not msg:find('/e ') then
  135.         if msg:find('/trail') then
  136.             if Trail then Trail=false else Trail=true end
  137.         elseif msg:find('/doge') then
  138.             NewMesh('doge')
  139.         elseif msg:find('/fedora') then
  140.             NewMesh('fedora')
  141.         elseif msg:find('/dominus') then
  142.             NewMesh('dominus')
  143.         elseif msg:find('/crown') then
  144.             NewMesh('crown')
  145.         elseif msg:find('/pumpkin') then
  146.             NewMesh('pumpkin')
  147.         elseif msg:find('/cyrstal') then
  148.             NewMesh('cyrstal')
  149.         elseif msg:find('/helmet') then
  150.             NewMesh('helmet')
  151.         else return
  152.         end
  153.     else
  154.         --ChatGUI coming soon.
  155.     end
  156. end)
  157.  
  158. game:GetService("RunService").RenderStepped:connect(function()
  159.     coroutine.resume(coroutine.create(function()
  160.         rot=rot+rot2
  161.         CParent.CFrame = workspace.CurrentCamera.Focus*CFrame.Angles(rot,rot,rot)
  162.         Trail()
  163.     end))
  164. end)
  165. end)
  166. if not r then print(e) end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement