Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local p = game:GetService("Players").LocalPlayer
- local char = p.Character
- local mouse = p:GetMouse()
- local larm = char:WaitForChild("Left Arm")
- local rarm = char:WaitForChild("Right Arm")
- local lleg = char:WaitForChild("Left Leg")
- local rleg = char:WaitForChild("Right Leg")
- local hed = char:WaitForChild("Head")
- local torso = char:WaitForChild("Torso")
- local root = char:WaitForChild("HumanoidRootPart")
- local hum = char:FindFirstChildOfClass("Humanoid")
- local debris = game:GetService("Debris")
- local input = game:GetService("UserInputService")
- local run = game:GetService("RunService")
- local rs = run.RenderStepped
- local wingpose = "Idle"
- local DebrisModel = Instance.new("Model",char)
- DebrisModel.Name = "Debris"
- repeat rs:wait() until p.CharacterAppearanceLoaded
- noidle = false
- shift = false
- control = false
- no_nosound_able = false
- kills = 0
- function rswait(value)
- if value ~= nil and value ~= 0 then
- for i=1,value do
- rs:wait()
- end
- else
- rs:wait()
- end
- end
- local timeposition = 0
- function music(id)
- if not torso:FindFirstChild("MusicRuin") then
- soundz = Instance.new("Sound",torso)
- end
- soundz.Volume = 10
- soundz.Name = "MusicRuin"
- soundz.Looped = true
- soundz.PlaybackSpeed = 1
- soundz.SoundId = "rbxassetid://"..id
- soundz:Stop()
- soundz:Play()
- if no_nosound_able == true then
- soundz.TimePosition = timeposition
- end
- end
- function lerp(a, b, t)
- return a + (b - a)*t
- end
- ----------------------------------------------------------------------------
- function Lerp(c1,c2,al)
- local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
- local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
- for i,v in pairs(com1) do
- com1[i] = v+(com2[i]-v)*al
- end
- return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
- end
- function slerp(a, b, t)
- dot = a:Dot(b)
- if dot > 0.99999 or dot < -0.99999 then
- return t <= 0.5 and a or b
- else
- r = math.acos(dot)
- return (a*math.sin((1 - t)*r) + b*math.sin(t*r)) / math.sin(r)
- end
- end
- ----------------------------------------------------------------------------
- function clerp(c1,c2,al)
- local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
- local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
- for i,v in pairs(com1) do
- com1[i] = lerp(v,com2[i],al)
- end
- return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
- end
- function findAllNearestTorso(pos,dist)
- local list = workspace:children()
- local torso = {}
- local temp = nil
- local human = nil
- local temp2 = nil
- for x = 1, #list do
- temp2 = list[x]
- if (temp2.className == "Model") and (temp2 ~= char) then
- temp = temp2:findFirstChild("Torso")
- human = temp2:findFirstChildOfClass("Humanoid")
- if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
- if (temp.Position - pos).magnitude < dist then
- table.insert(torso,temp)
- dist = (temp.Position - pos).magnitude
- end
- end
- end
- end
- return torso
- end
- ----------------------------------------------------------------------------
- function checkIfNotPlayer(model)
- if model.CanCollide == true and model ~= char and model.Parent ~= char and model.Parent.Parent ~= char and model.Parent.Parent ~= char and model.Parent ~= DebrisModel and model.Parent.Parent ~= DebrisModel and model.Parent.Parent.Parent ~= DebrisModel and model ~= wings and model.Parent ~= wings and model.Parent.Parent ~= wings then
- return true
- else
- return false
- end
- end
- ----------------------------------------------------------------------------
- function newWeld(wp0, wp1, wc0x, wc0y, wc0z)
- local wld = Instance.new("Weld", wp1)
- wld.Part0 = wp0
- wld.Part1 = wp1
- wld.C0 = CFrame.new(wc0x, wc0y, wc0z)
- return wld
- end
- function weld(model)
- local parts,last = {}
- local function scan(parent)
- for _,v in pairs(parent:GetChildren()) do
- if (v:IsA("BasePart")) then
- if (last) then
- local w = Instance.new("Weld")
- w.Name = ("%s_Weld"):format(v.Name)
- w.Part0,w.Part1 = last,v
- w.C0 = last.CFrame:inverse()
- w.C1 = v.CFrame:inverse()
- w.Parent = last
- end
- last = v
- table.insert(parts,v)
- end
- scan(v)
- end
- end
- scan(model)
- for _,v in pairs(parts) do
- v.Anchored = false
- v.Locked = true
- v.Anchored = false
- v.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- v.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- v.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- v.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- v.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- v.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- v.CustomPhysicalProperties = PhysicalProperties.new(0,0,0)
- end
- end
- ----------------------------------------------------------------------------
- function calculate(part,asd)
- local Head = hed
- local RightShoulder = asd
- local RightArm = part
- local MousePosition = mouse.Hit.p
- local ToMouse = (MousePosition - Head.Position).unit
- local Angle = math.acos(ToMouse:Dot(Vector3.new(0, 1, 0)))
- local FromRightArmPos = (Head.Position + Head.CFrame:vectorToWorldSpace(Vector3.new(((Head.Size.X / 2) + (RightArm.Size.X / 2)), ((Head.Size.Y / 2) - (RightArm.Size.Z / 2)), 0)))
- local ToMouseRightArm = ((MousePosition - FromRightArmPos) * Vector3.new(1 ,0, 1)).unit
- local Look = (Head.CFrame.lookVector * Vector3.new(1, 0, 1)).unit
- local LateralAngle = math.acos(ToMouseRightArm:Dot(Look))
- if tostring(LateralAngle) == "-1.#IND" then
- LateralAngle = 0
- end
- local Cross = Head.CFrame.lookVector:Cross(ToMouseRightArm)
- if LateralAngle > (math.pi / 2) then
- LateralAngle = (math.pi / 2)
- local Torso = root
- local Point = Torso.CFrame:vectorToObjectSpace(mouse.Hit.p-Torso.CFrame.p)
- if Point.Z > 0 then
- if Point.X > -0 and RightArm == rarm then
- Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mouse.Hit.X,Torso.Position.Y,mouse.Hit.Z))*CFrame.Angles(0,math.rad(110),0)
- elseif Point.X < 0 and RightArm == rarm then
- Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mouse.Hit.X,Torso.Position.Y,mouse.Hit.Z))*CFrame.Angles(0,math.rad(-110),0)
- end
- end
- end
- if Cross.Y < 0 then
- LateralAngle = -LateralAngle
- end
- return(CFrame.Angles(((math.pi / 2) - Angle), ((math.pi / 2) + LateralAngle), math.pi/2))
- end
- ----------------------------------------------------------------------------
- function sound(id,position,vol,pitch,start,finish)
- coroutine.resume(coroutine.create(function()
- local part = Instance.new("Part",workspace)
- part.Position = position
- part.Size = Vector3.new(0,0,0)
- part.CanCollide = false
- part.Transparency = 1
- local sound = Instance.new("Sound",part)
- sound.SoundId = "rbxassetid://"..id
- repeat rs:wait() until sound.IsLoaded
- if vol ~= nil then
- sound.Volume = vol
- end
- if pitch ~= nil then
- sound.PlaybackSpeed = pitch
- end
- if start ~= nil then
- sound.TimePosition = start
- end
- if finish ~= nil then
- debris:AddItem(part,finish-start)
- else
- debris:AddItem(part,sound.TimeLength)
- end
- sound:Play()
- return sound
- end))
- end
- ----------------------------------------------------------------------------
- function computeDirection(vec)
- local lenSquared = vec.magnitude * vec.magnitude
- local invSqrt = 1 / math.sqrt(lenSquared)
- return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
- end
- ----------------------------------------------------------------------------
- local shaking = 0
- function shake(num) if num > shaking then shaking = num end end
- game:GetService("RunService").RenderStepped:connect(function()
- hum.CameraOffset = Vector3.new(math.random(-1,1),math.random(-1,1),math.random(-1,1))*(shaking/100)
- if shaking > 0 then shaking = shaking - 1 else shaking = 0 end
- end)
- plr = game:GetService("Players").LocalPlayer
- DebrisModel = Instance.new("Model",plr.Character)
- DebrisModel.Name = "DebrisModel"
- function Effect(mesh,size,transparency,material,color,position,rotation,sizechange,rotationchange,transparencychange,acceleration)
- local part = Instance.new("Part",DebrisModel)
- part.Anchored = true
- part.CanCollide = false
- part.Size = Vector3.new(1,1,1)
- part.Transparency = transparency
- part.Material = material
- part.Color = color
- part.CFrame = CFrame.new(position)*CFrame.Angles(math.rad(rotation.X),math.rad(rotation.Y),math.rad(rotation.Z))
- local partmesh = Instance.new("SpecialMesh",part)
- if tonumber(mesh) == nil then partmesh.MeshType = mesh else partmesh.MeshId = "rbxassetid://"..mesh end
- partmesh.Scale = size
- local pvalue = Instance.new("Vector3Value",part)
- pvalue.Name = "Position"
- pvalue.Value = part.Position
- local svalue = Instance.new("Vector3Value",part)
- svalue.Name = "Size"
- svalue.Value = sizechange
- local rvalue = Instance.new("Vector3Value",part)
- rvalue.Name = "Rotation"
- rvalue.Value = rotationchange
- local tvalue = Instance.new("NumberValue",part)
- tvalue.Name = "Transparency"
- tvalue.Value = transparencychange
- local avalue = Instance.new("NumberValue",part)
- avalue.Name = "Acceleration"
- avalue.Value = acceleration
- part.Name = "EFFECT"
- return part
- end
- game:GetService("RunService").RenderStepped:connect(function()
- if not plr.Character:FindFirstChild("DebrisModel") then
- DebrisModel = Instance.new("Model",plr.Character)
- DebrisModel.Name = "DebrisModel"
- end
- for i,v in pairs(DebrisModel:GetChildren()) do
- if v:IsA("BasePart") and v.Name == "EFFECT" then
- local pvalue = v:FindFirstChild("Position").Value
- local svalue = v:FindFirstChild("Size").Value
- local rvalue = v:FindFirstChild("Rotation").Value
- local tvalue = v:FindFirstChild("Transparency").Value
- local avalue = v:FindFirstChild("Acceleration").Value
- local mesh = v:FindFirstChild("Mesh")
- mesh.Scale = mesh.Scale + svalue
- v:FindFirstChild("Size").Value = v:FindFirstChild("Size").Value + (Vector3.new(1,1,1)*avalue)
- v.Transparency = v.Transparency + tvalue
- v.CFrame = v.CFrame*CFrame.Angles(math.rad(rvalue.X),math.rad(rvalue.Y),math.rad(rvalue.Z))
- if v.Transparency >= 1 or mesh.Scale.X < 0 or mesh.Scale.Y < 0 or mesh.Scale.Z < 0 then
- v:Destroy()
- end
- end
- end
- end)
- ----------------------------------------------------------------------------
- skin_color = BrickColor.new("Light orange")
- p:ClearCharacterAppearance()
- --hed:WaitForChild("face"):Destroy()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement