Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Made by Vlatkovski (I was really bored)
- -- It has effects like slight sparkles and the hat 'blowing up'
- local removeAfter = 3 -- Seconds to wait after removing hat
- --------------------------------------------------------------------------
- --------------------------------------------------------------------------
- --don't touch the following
- create, gp, gp2, c3, v3, ins, bc, cf, c255, v2 = LoadLibrary("RbxUtility").Create, UDim.new, UDim2.new, Color3.new, Vector3.new, Instance.new, BrickColor, CFrame, function(r,g,b) return Color3.new(r/255, g/255, b/255) end, Vector2.new
- --http://pastebin.com/hPuLMsVZ
- function findFirstChild(object, property, want, recursive) local property, recursive, found = property or "Name", recursive or false, nil; local function find(obj, prop, want) for i,v in next, obj:GetChildren() do local success, bool = pcall(function() return tostring(v[prop]) == tostring(want); end); if (success and bool) then found = v; break; elseif (recursive) then find(v, prop, want); end; end; end; find(object, property, want); return found; end;
- function randomC3()
- return c255(math.random(255), math.random(255), math.random(255));
- end;
- --main
- function removeHat(hat)
- if (not hat:IsA("Hat")) or (not hat:IsA("Accoutrement")) then return; end;
- spawn(function()
- delay(removeAfter, function()
- if (not workspace:FindFirstChild(tostring(hat))) then return; end;
- local handle = findFirstChild(hat, "Name", "Handle");
- local mesh = handle and findFirstChild(handle, "ClassName", "SpecialMesh");
- if (handle) and (mesh) then
- local function scale(n)
- mesh.Scale = v3(mesh.Scale.X+n, mesh.Scale.Y+n, mesh.Scale.Z+n);
- end;
- ins("BodyGyro", handle);
- local f = create "Fire" {
- Parent = handle;
- Heat = 1;
- Size = 2;
- };
- for i=1,5 do
- scale(0.075);
- f.Color = randomC3();
- f.SecondaryColor = randomC3();
- wait(0.025);
- end;
- repeat
- scale(-0.075);
- f.Color = randomC3();
- f.SecondaryColor = randomC3();
- wait(0.05);
- until (mesh.Scale.X<=0 and mesh.Scale.Y<=0 and mesh.Scale.Z<=0);
- hat:Destroy();
- end;
- end);
- end);
- end;
- --final
- workspace.ChildAdded:connect(removeHat);
- for i,v in next, workspace:GetChildren() do
- removeHat(v);
- end;
Advertisement
Add Comment
Please, Sign In to add comment