Advertisement
Guest User

Untitled

a guest
Oct 20th, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.47 KB | None | 0 0
  1. wait();
  2. local ContentProvider = game:GetService("ContentProvider");
  3. local Preload = ContentProvider.Preload;
  4. local render = game:GetService("RunService").RenderStepped;
  5. local debris = game:GetService("Debris");
  6. local PrivateChecking = {};
  7. local Collisions = {
  8.     ["Regular"] = {
  9.     "http://roblox.com/asset?id=155985920",
  10.     "http://roblox.com/asset?id=155985949",
  11.     "http://roblox.com/asset?id=155985964",
  12.     "http://roblox.com/asset?id=155986003",
  13.     "http://roblox.com/asset?id=155986027",
  14.     "http://roblox.com/asset?id=155986040",
  15.     "http://roblox.com/asset?id=155986061"
  16.     },
  17.     ["Bottle"] = {
  18.     "http://roblox.com/asset?id=155986762",
  19.     "http://roblox.com/asset?id=155986778",
  20.     "http://roblox.com/asset?id=155986960",
  21.     "http://roblox.com/asset?id=155986987",
  22.     "http://roblox.com/asset?id=155987004",
  23.     "http://roblox.com/asset?id=155987128",
  24.     "http://roblox.com/asset?id=155987137"
  25.     }
  26. }
  27. for _,a in pairs(Collisions) do
  28.     for _,v in pairs(a) do
  29.         Preload(ContentProvider,v);
  30.     end
  31. end
  32. local function printf(str,...)
  33.     local args = {...};
  34.     print(string.format(str,unpack(args)));
  35. end
  36. local local_mass = 10;
  37.  
  38. Checking = Workspace.Checking;
  39. Checking.ChildAdded:connect(function(v)
  40.         local mass = v:GetMass();
  41.         printf("%s with mass of %f",v:GetFullName(),mass);
  42.         PrivateChecking[i] = {0,v,mass};
  43.         local self = PrivateChecking[i];
  44.         local part = v;
  45.         part.Touched:connect(function(collider) if collider.Transparency > 0.1 then return end
  46.             local magn = part.Velocity.Magnitude;
  47.             local lastmagn = self[1];  
  48.             if(magn < lastmagn and lastmagn-magn >= local_mass) then
  49.             coroutine.wrap(function()          
  50.                 print("SUDDEN STOP");
  51.                 local smokepart = Instance.new("Part",Workspace);
  52.                 local collision = Instance.new("Sound",smokepart);
  53.                 collision.SoundId = Collisions[part.Name][math.random(1,7)];
  54.                 collision:Play();
  55.                 smokepart.Name = 'Effect_Smoke';
  56.                 smokepart.CanCollide = false;
  57.                 smokepart.Anchored = true;
  58.                 smokepart.Transparency = 1;
  59.                 smokepart.CFrame = part.CFrame;
  60.                 local smoke = Instance.new("Smoke",smokepart);
  61.                 smoke.Size = self[3]/6;
  62.                 smoke.Opacity = .1;
  63.                 smoke.Color = Color3.new(127/255, 91/255, 80/255);
  64.                 smoke.Enabled = true;
  65.                 wait(.5)
  66.                 smoke.Enabled = false; 
  67.                 debris:AddItem(smokepart,10);
  68.             end)();    
  69.             end
  70.         end)
  71.     end
  72. end)
  73.  
  74. local checking = true;
  75.  
  76.  
  77. while checking do
  78.     wait();
  79.     for _,v in pairs(PrivateChecking) do
  80.         local part = v[2];
  81.         local magn = part.Velocity.Magnitude;
  82.         v[1] = magn;
  83.     end
  84. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement