Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --asd Emitter--
- if script.ClassName == "LocalScript" then
- repeat wait() until game.Players.LocalPlayer.Character
- game.Players.LocalPlayer.Character:WaitForChild("Head")
- Mouse = game.Players.LocalPlayer:GetMouse()
- Workspace.CurrentCamera:ClearAllChildren()
- end
- local Particles = {}
- local Emitters = {}
- FPS = 30
- function random(a,b)
- seed = tick()
- rick = rick and rick+1 or 1
- return a+(b-a)*(seed*rick%1)
- end
- function ray(p1,p2)
- local n = Ray.new(p1,p2)
- local hit,pos = Workspace:findPartOnRay(n)
- return hit,pos
- end
- function lerp(a,b,c)
- return a+(b-a)*c
- end
- function NewParticleEmitter(Adornee)
- local P = {}
- P.LastEmit = tick()
- P.EmitSpeed = 1
- P.Adornee = Adornee
- P.Image = 169845936
- P.LifeTime = 2
- P.Offset = Vector3.new(0,0,0)
- P.Speed = CFrame.new(0,0,0)
- P.OffVelocity = Vector3.new(0,0,0)
- P.OnVelocity = Vector3.new(0,0,0)
- P.Spread = Vector3.new(0,0,0)
- P.Growth = Vector2.new(0,0)
- P.ParticleSize = Vector2.new(1,1)
- P.EmitSize = Vector3.new(0,0,0)
- P.Rotation = 5
- P.ConnectPower = 0
- P.Dampen = 0
- P.Velocity = Vector3.new(0,0,0)
- P.LinearMultiplication = Vector3.new(0,0,0)
- P.VerletMultiplication = false
- P.Color = Color3.new(1,1,1)
- P.ToColor = P.Color
- P.PowerToMouse = 0
- P.Replication = 0
- function P:Emit(prop,pprop,gprop)
- if P.Adornee then
- local N = Instance.new("Part",script.ClassName == "LocalScript" and Workspace.CurrentCamera or P.Adornee)
- N.FormFactor = "Custom"
- N.Transparency = 1
- N.Size = Vector3.new(0,0,0)
- N.CFrame = P.Adornee.CFrame*CFrame.new(P.Offset)*CFrame.new(math.random(-P.EmitSize.X,P.EmitSize.X),math.random(-P.EmitSize.X,P.EmitSize.X),math.random(-P.EmitSize.X,P.EmitSize.X))
- N.CanCollide = false
- N.Anchored = true
- local C = Instance.new("BillboardGui",N)
- C.Size = UDim2.new(P.ParticleSize.X,0,P.ParticleSize.X,0)
- local I = Instance.new("ImageLabel",C)
- I.Rotation = math.random(0,360)
- I.Size = UDim2.new(1,0,1,0)
- I.Image = "http://www.roblox.com/asset/?id="..P.Image-1
- I.BackgroundTransparency = 1
- I.ImageColor3 = Color3.new(0,0,0)
- local S = {}
- S.Part = N
- S.Board = C
- S.Gui = I
- S.Last = S.Part.CFrame.p
- S.Direction = math.random(1,2)
- S.Velocity = Vector3.new()
- S.LifeTime =P.LifeTime
- local H = N.CFrame*CFrame.new(P.Velocity)
- local D = H.p-N.CFrame.p
- ypcall(function()
- table.foreach(prop or {},function(a,b) S[a]=b end)
- end)
- S.Velocity = S.Velocity+D+Vector3.new(
- P.Spread.X > 0 and random(-P.Spread.X,P.Spread.X)/50 or 0,
- P.Spread.Y > 0 and random(-P.Spread.Y,P.Spread.Y)/50 or 0,
- P.Spread.Z > 0 and random(-P.Spread.Z,P.Spread.Z)/50 or 0
- )
- S.CreationDate = tick()
- table.foreach(pprop or {},function(a,b) N[a]=b end)
- table.foreach(gprop or {},function(a,b) S.Board[a]=b end)
- function S:Update()
- local T = tick()-S.CreationDate
- local Age = (T/S.LifeTime)
- if T < S.LifeTime then
- S.Gui.Rotation = S.Gui.Rotation +(S.Direction == 1 and P.Rotation or -P.Rotation)
- local ic3 = S.Gui.ImageColor3
- S.Gui.ImageColor3 = Color3.new(lerp(P.Color.r,P.ToColor.r,Age),lerp(P.Color.g,P.ToColor.g,Age),lerp(P.Color.b,P.ToColor.b,Age))--Color3.new(ic3.r+0.02,ic3.g+0.02,ic3.b+0.02)
- S.Gui.ImageTransparency = (T/P.LifeTime)
- S.Part.CFrame = S.Part.CFrame*CFrame.new(P.Speed.X/(1/FPS),P.Speed.Y/(1/FPS),P.Speed.Z/(1/FPS))
- S.Velocity = S.Velocity +(((P.Adornee.CFrame.p+P.Offset)-(S.Part.CFrame.p))*P.ConnectPower)
- S.Velocity = S.Velocity +(P.OffVelocity/(1/FPS))
- S.Velocity = S.Velocity +(P.OnVelocity/(1/FPS))
- S.Velocity = S.Velocity-(S.Velocity*P.Dampen)
- S.Velocity = S.Velocity+(S.Velocity*P.LinearMultiplication)
- S.Velocity = S.Velocity+(-(S.Part.CFrame.p-(Mouse.Hit.p or S.Part.CFrame.p)).unit*(P.PowerToMouse/(1/FPS)))
- FakeVel = S.Velocity
- -- FakeVel = Vector3.new(unpack(FakeVel))
- S.Part.CFrame = S.Part.CFrame+FakeVel
- if P.VerletMultiplication then
- S.Velocity = S.Velocity+(S.Part.CFrame.p-S.Last)
- end
- S.Board.Size = S.Board.Size +UDim2.new(P.Growth.X/(1/FPS),0,P.Growth.Y/(1/FPS),0)
- --S.Gui.Position = UDim2.new(-(S.Gui.Size.X.Scale-1)/4,0,-(S.Gui.Size.Y.Scale-1)/4,0)
- S.Last = S.Part.CFrame.p
- if (tick()-S.CreationDate)%P.Replication<0.01 then
- --print'hax'
- wait(1)
- P:Emit({Velocity = S.Velocty,LifeTime=S.LifeTime*0.2},{CFrame=S.Part.CFrame},{Size = S.Board.Size-UDim2.new(0.5,0,0.5,0)})
- for i,v in pairs(Particles) do
- if v == S then
- table.remove(Particles,i)
- end
- end
- N:Destroy()
- end
- else
- for i,v in pairs(Particles) do
- if v == S then
- table.remove(Particles,i)
- end
- end
- N:Destroy()
- end
- end
- table.insert(Particles,S)
- return S
- end
- end
- function P:Update()
- if tick()-P.LastEmit > 1/P.EmitSpeed then
- P.LastEmit = tick()
- P:Emit()
- end
- end
- table.insert(Emitters,P)
- return P
- end
- local C = NewParticleEmitter(game.Players.LocalPlayer.Character:WaitForChild("Torso"))
- local Types = {}
- Types.Default = function()
- C.EmitSpeed = 10
- C.ParticleSize = Vector2.new(2,2)
- C.Offset = Vector3.new(0,5,0)
- C.Speed = CFrame.new(0,0,0)
- C.Velocity = Vector3.new(0,0.6,0)
- C.Spread = Vector3.new(10,0,10)
- C.OnVelocity = Vector3.new(0,-0.4,0)
- C.OffVelocity = Vector3.new(0,0,0)
- --C.Growth = Vector2.new(-0.02,-0.02)
- C.EmitSize = Vector3.new(0,0,0)
- C.Rotation = 5
- C.ConnectPower = 0
- C.Dampen = 0.02
- C.LifeTime = 8
- C.Image = 169845936
- C.Growth = Vector2.new(0,0)
- end
- Types.Smoke = function()
- C.OnVelocity = Vector3.new(0,-0.01,0)
- C.Image = 122434486
- C.Spread = Vector3.new(1,1,1)
- C.Growth = Vector2.new(5,5)
- C.Velocity = Vector3.new(0,0.2,0)
- C.LifeTime = 8
- C.Dampen = 0
- end
- Types.Default()
- function gt(s,m,b)
- local n = {}
- local curr = ""
- for i = 1,#s do
- local t = string.sub(s,i,i)
- if t:match(m) then
- n[#n+1]=curr
- curr = ""
- else
- if not t:match(b) then
- curr = curr..t
- end
- if i == #s then
- n[#n+1]=curr
- end
- end
- end
- return n
- end
- local Player = game.Players.LocalPlayer
- local Mouse = Player:GetMouse()
- local PlayerGui = Player:WaitForChild("PlayerGui")
- local Screen = Instance.new("ScreenGui",PlayerGui)
- local Count = 0
- local Allow = {
- ["Vector3"]=true;
- ["CFrame"]=true;
- ["tick"]=true;
- ["Vector2"]=true;
- }
- local MX = 0
- local UI = {}
- local PBX = Instance.new("Frame",Screen)
- PBX.Size = UDim2.new(0,500,0,0)
- PBX.Position = UDim2.new(0,0.5,0,0)
- PBX.Active = true
- PBX.Draggable = true
- PBX.ClipsDescendants = false
- PBX.BackgroundColor3 = Color3.new(0.3,0.3,0.3)
- PBX.BorderColor3 = Color3.new(0.2,0.2,0.2)
- PBX.BorderSizePixel = 5
- for i,v in pairs(C) do
- if type(v) ~= "function" and type(v) ~= "table" then
- local IsPart = pcall(function() return v.Position end)
- local T = Instance.new("TextLabel",PBX)
- T.Text = i ~= 1 and tostring(i) or "Info"
- T.Size = UDim2.new(0,T.TextBounds.X,0,20)
- T.Position = UDim2.new(0,0,0,Count*20)
- T.BorderColor3 = PBX.BorderColor3
- T.BorderSizePixel = 2
- T.BackgroundColor3 = Color3.new(0.3,0.3,0.3)
- T.TextColor3 = IsPart and Color3.new(0.5,0.5,0.5) or Color3.new(1,1,1)
- if MX-10 < T.TextBounds.X then
- MX = T.TextBounds.X+10
- else
- T.Size = UDim2.new(0,MX,0,20)
- end
- local N = Instance.new(i ~= 1 and (not IsPart) and "TextBox" or "TextLabel",PBX)
- N.Text = not pcall(function() return v.r end) and " "..tostring(v) or " "..(math.floor(255*v.r)..", "..math.floor(255*v.g)..", "..math.floor(255*v.b))
- N.Size = UDim2.new(1,-MX,0,20)
- N.Position = UDim2.new(0,MX,0,Count*20)
- N.BorderColor3 = PBX.BorderColor3
- N.BorderSizePixel = T.BorderSizePixel
- N.BackgroundColor3 = T.BackgroundColor3
- N.TextColor3 = T.TextColor3
- N.TextXAlignment = "Left"
- N.ClipsDescendants = true
- --[[if v.X and v.Y and v.Z then
- N.FocusLost:connect(function()
- if S
- end)
- end]]
- if N.ClassName == "TextBox" then
- N.FocusLost:connect(function()
- --[[local test,er = loadstring("return "..N.Text)
- local asd
- if test then
- setfenv(test,setmetatable({},{__index = function(a,b) if Allow[b] then return getfenv()[b] end end,
- __newindex = function(a,b,c) if Allow[b] then getfenv()[b]=c return getfenv()[b] end end}))
- p,d = ypcall(function()
- asd = test()
- end)
- if p and asd and type(asd) == type(C[i]) then
- C[i]=asd
- else
- if not p then
- --print(d)
- end
- end
- end]]
- local STR
- local EQ = C[i]
- u,h = ypcall(function()
- local v = EQ
- local T = gt(N.Text,","," ")
- local tn = tonumber
- --print(unpack(T))
- if type(v) ~= "number" and pcall(function() return v.X end) and pcall(function() return v.Y end) and pcall(function() return v.Z end) and pcall(function() return v.toEulerAnglesXYZ end) then
- EQ = CFrame.new(unpack(T))
- elseif type(v) ~= "number" and pcall(function() return v.X end) and pcall(function() return v.Y end) and pcall(function() return v.Z end) then
- EQ = Vector3.new(tn(T[1]),tn(T[2]),tn(T[3]))
- elseif type(v) ~= "number" and pcall(function() return v.X end) and pcall(function() return v.Y end) and not pcall(function() return v.Z end) then
- EQ = Vector2.new(tn(T[1]),tn(T[2]))
- elseif pcall(function() return v.r end) and pcall(function() return v.g end) and pcall(function() return v.b end) then
- EQ = Color3.new(tn(T[1])/255,tn(T[2])/255,tn(T[3])/255)
- STR = (math.floor(255*EQ.r)..", "..math.floor(255*EQ.g)..", "..math.floor(255*EQ.b))
- elseif type(v) == "number" and T[1] and tonumber(T[1]) and #T == 1 then
- EQ = tonumber(T[1])
- elseif type(v) == "boolean"and T[1] then
- EQ = (string.lower(T[1]) == "true" and true) or (string.lower(T[1]) == "false" and false)
- end
- C[i]= EQ
- end)
- if not u then print(h) end
- if not pcall(function() return v.r end) then
- N.Text = " "..(STR or tostring(C[i]))
- else
- if not u then
- N.Text = " "..(math.floor(255*EQ.r)..", "..math.floor(255*EQ.g)..", "..math.floor(255*EQ.b))
- else
- N.Text = " "..(STR or tostring(C[i]))
- end
- end
- end)
- end
- local HX = {}
- HX.NM = T
- HX.BX = N
- HX.TP = i
- HX.OB = v
- for _,p in pairs(UI) do
- p.NM.Size = T.Size
- p.BX.Size = N.Size
- p.BX.Position = UDim2.new(0,MX,p.BX.Position.Y.Scale,p.BX.Position.Y.Offset)
- end
- table.insert(UI,HX)
- Count = Count+1
- PBX.Size = UDim2.new(0,500,0,(Count*20))
- PBX.Position = UDim2.new(1,-500,1,-Count*20)
- end
- end
- local Minimized = false
- --print("making min gui")
- local Min = Instance.new("TextButton",PBX)
- Min.Position = UDim2.new(0,0,0,-(20+PBX.BorderSizePixel))
- Min.Size = UDim2.new(0,50,0,20)
- Min.ZIndex = 3
- Min.BackgroundTransparency = PBX.BackgroundTransparency
- Min.TextColor3 = Color3.new(1,1,1)
- Min.BackgroundColor3 = PBX.BackgroundColor3
- Min.BorderSizePixel = PBX.BorderSizePixel
- Min.BorderColor3 = PBX.BorderColor3
- Min.Text = "Minimize"
- local Max = Min:clone()
- Max.Parent = Screen
- Max.Position = UDim2.new(1,0,1,0)-(Min.Size+UDim2.new(0,10,0,10))
- Max.Text = "Maximize"
- Max.Visible = false
- function Set()
- if not Minimized then
- Minimized = true
- Max.Visible = true
- PBX.Visible = false
- else
- Minimized = false
- Max.Visible = false
- PBX.Visible = true
- end
- end
- Min.MouseButton1Click:connect(Set)
- Max.MouseButton1Click:connect(Set)
- local NMB = 0
- for i,v in pairs(Types) do
- local NEW = Min:clone()
- NEW.Parent = PBX
- NEW.Text = i
- NEW.Size = UDim2.new(0,MX-2,0,20)
- NEW.Position = UDim2.new(0,Min.Position.X.Offset+5+(Min.Size.X.Offset+(MX-2+5)*NMB),0,Min.Position.Y.Offset)
- NEW.MouseButton1Click:connect(function()
- v()
- for i,v in pairs(UI) do
- if not pcall(function() return v.OB.r end) then
- v.BX.Text = " "..tostring(C[v.TP])
- else
- v.BX.Text = " "..(math.floor(255*C[v.TP].r)..", "..math.floor(255*C[v.TP].g)..", "..math.floor(255*C[v.TP].b))
- end
- end
- end)
- NMB = NMB+1
- end
- local Last = tick()
- game:GetService("RunService").Stepped:connect(function()
- FPS = tick()-Last
- for i,v in pairs(Emitters) do
- v:Update()
- end
- for i,v in pairs(Particles) do
- v:Update()
- end
- --[[for i,v in pairs(UI) do
- v.BX.Size = UDim2.new(0,v.BX.TextBounds.X+20,0,20)
- end]]
- Last = tick()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement