Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait();
- local ContentProvider = game:GetService("ContentProvider");
- local Preload = ContentProvider.Preload;
- local render = game:GetService("RunService").RenderStepped;
- local debris = game:GetService("Debris");
- local PrivateChecking = {};
- local Collisions = {
- ["Regular"] = {
- "http://roblox.com/asset?id=155985920",
- "http://roblox.com/asset?id=155985949",
- "http://roblox.com/asset?id=155985964",
- "http://roblox.com/asset?id=155986003",
- "http://roblox.com/asset?id=155986027",
- "http://roblox.com/asset?id=155986040",
- "http://roblox.com/asset?id=155986061"
- },
- ["Bottle"] = {
- "http://roblox.com/asset?id=155986762",
- "http://roblox.com/asset?id=155986778",
- "http://roblox.com/asset?id=155986960",
- "http://roblox.com/asset?id=155986987",
- "http://roblox.com/asset?id=155987004",
- "http://roblox.com/asset?id=155987128",
- "http://roblox.com/asset?id=155987137"
- }
- }
- for _,a in pairs(Collisions) do
- for _,v in pairs(a) do
- Preload(ContentProvider,v);
- end
- end
- local function printf(str,...)
- local args = {...};
- print(string.format(str,unpack(args)));
- end
- local local_mass = 10;
- Checking = Workspace.Checking;
- Checking.ChildAdded:connect(function(v)
- local mass = v:GetMass();
- printf("%s with mass of %f",v:GetFullName(),mass);
- PrivateChecking[i] = {0,v,mass};
- local self = PrivateChecking[i];
- local part = v;
- part.Touched:connect(function(collider) if collider.Transparency > 0.1 then return end
- local magn = part.Velocity.Magnitude;
- local lastmagn = self[1];
- if(magn < lastmagn and lastmagn-magn >= local_mass) then
- coroutine.wrap(function()
- print("SUDDEN STOP");
- local smokepart = Instance.new("Part",Workspace);
- local collision = Instance.new("Sound",smokepart);
- collision.SoundId = Collisions[part.Name][math.random(1,7)];
- collision:Play();
- smokepart.Name = 'Effect_Smoke';
- smokepart.CanCollide = false;
- smokepart.Anchored = true;
- smokepart.Transparency = 1;
- smokepart.CFrame = part.CFrame;
- local smoke = Instance.new("Smoke",smokepart);
- smoke.Size = self[3]/6;
- smoke.Opacity = .1;
- smoke.Color = Color3.new(127/255, 91/255, 80/255);
- smoke.Enabled = true;
- wait(.5)
- smoke.Enabled = false;
- debris:AddItem(smokepart,10);
- end)();
- end
- end)
- end
- end)
- local checking = true;
- while checking do
- wait();
- for _,v in pairs(PrivateChecking) do
- local part = v[2];
- local magn = part.Velocity.Magnitude;
- v[1] = magn;
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement