Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- that's right get no scoped ^^
- p = game.Players.LocalPlayer
- char = p.Character
- des = false
- fling = true
- dot = false
- falling = false
- jump = true
- char.Shirt:Remove()
- for i,v in pairs(char:GetChildren()) do if v:IsA("Pants") then v:Remove() end end
- for i,v in pairs(char:GetChildren()) do if v:IsA("Hat") then v.Handle:Remove() end end
- wait()shirt = Instance.new("Shirt", char)
- shirt.Name = "Shirt"
- pants = Instance.new("Pants", char)
- pants.Name = "Pants"
- char.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=335466631"
- char.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=400416371"
- tp = true
- shoot = true
- hum = char.Humanoid
- punch = true
- neckp = char.Torso.Neck.C0
- neck = char.Torso.Neck
- hum.MaxHealth = 9e999
- wait()
- hum.Health =hum.MaxHealth
- des = false
- root=char.HumanoidRootPart
- torso = char.Torso
- char.Head.face.Texture = "rbxassetid://332768867"
- local ChatService = game:GetService("Chat")
- local player = game.Players.LocalPlayer
- lig = Instance.new("PointLight",player.Character.Torso)
- lig.Color=Color3.new(255,0,0)
- m=player:GetMouse()
- bb = Instance.new("BillboardGui",player.Character.Head)
- bb.Enabled = true
- function newRay(start,face,range,wat)
- local rey=Ray.new(start.p,(face.p-start.p).Unit*range)
- hit,pos=Workspace:FindPartOnRayWithIgnoreList(rey,wat)
- return rey,hit,pos
- end
- aa1={}
- torso=game.Players.LocalPlayer.Character.Torso
- local WorldUp = Vector3.new(0,1,0)
- function look2(Vec1,Vec2)
- local Orig = Vec1
- Vec1 = Vec1+Vector3.new(0,1,0)
- Vec2 = Vec2+Vector3.new(0,1,0)
- local Forward = (Vec2-Vec1).unit
- local Up = (WorldUp-WorldUp:Dot(Forward)*Forward).unit
- local Right = Up:Cross(Forward).unit
- Forward = -Forward
- Right = -Right
- return CFrame.new(Orig.X,Orig.Y,Orig.Z,Right.X,Up.X,Forward.X,Right.Y,Up.Y,Forward.Y,Right.Z,Up.Z,Forward.Z)
- end
- function look(CFr,Vec2)
- local A = Vector3.new(0,0,0)
- local B = CFr:inverse()*Vec2
- local CF = look2(A,Vector3.new(A.X,B.Y,B.Z))
- if B.Z > 0 then
- CF = CFr*(CF*CFrame.Angles(0,0,math.pi))
- elseif B.Z == 0 then
- if B.Y > 0 then
- CF = CFr*CFrame.Angles(math.pi/2,0,0)
- elseif B.Y < 0 then
- CF = CFr*CFrame.Angles(-math.pi/2,0,0)
- else
- CF = CFr
- end
- end
- local _,_,_,_,X,_,_,Y,_,_,Z,_ = CF:components()
- local Up = Vector3.new(X,Y,Z)
- local Forward = (Vec2-CFr.p).unit
- local Right = Up:Cross(Forward)
- Forward = -Forward
- Right = -Right
- return CFrame.new(CFr.X,CFr.Y,CFr.Z,Right.X,Up.X,Forward.X,Right.Y,Up.Y,Forward.Y,Right.Z,Up.Z,Forward.Z)
- end
- function simulate(j,d,m,r,t)
- local joint = j
- for i,v in ipairs(t) do
- if v[1]:FindFirstChild("Weld") then
- local stiff = m.CFrame.lookVector*0.03
- if i > 1 then joint = t[i-1][1].CFrame*CFrame.new(0,0,d*.5) end
- local dir = (v[2].p-(joint.p+Vector3.new(0,0.2,0)+stiff)).unit
- local dis = (v[2].p-(joint.p+Vector3.new(0,0.2,0)+stiff)).magnitude
- local pos = joint.p+(dir*(d*0.5))
- --if v[1].CFrame.y<=workspace.Base.CFrame.y then pos = joint.p+(dir*(d*.5)) end
- local inv = v[1].Weld.Part0.CFrame
- local rel1 = inv:inverse()*pos
- local rel2 = inv:inverse()*(pos-(dir*dis))
- local cf = look(CFrame.new(rel1),rel2)--CFrame.new(pos,pos-(dir*dis))*CFrame.fromEulerAnglesXYZ(r.x,r.y,r.z)
- v[1].Weld.C0 = cf
- v[2] = inv*cf
- --v[1].CFrame = cf
- end
- end
- end
- game:service"RunService".Stepped:connect(function()
- simulate(torso.CFrame*CFrame.new(0,0.9,.5),.6,torso,Vector3.new(),aa1)
- end)
- bb.AlwaysOnTop = true
- bb.Size = UDim2.new(0,200,0,50)
- bb.StudsOffset = Vector3.new(0,1,0)
- gui=Instance.new("TextBox",bb)
- gui.Text = "* "
- gui.Size = UDim2.new(0,133,0,45)
- gui.Position=UDim2.new(0,57,0,-40)
- gui.TextColor3 = Color3.new(255,255,255)
- gui.BackgroundColor3=Color3.new(0,0,0)
- gui.TextWrapped = true
- gui.TextScaled = true
- gui.TextXAlignment = "Left"
- gui.TextYAlignment = "Top"
- gui.Visible = false
- gui.BorderColor3 = Color3.new(0,0,0)
- punch2 = true
- gui1=Instance.new("TextButton",bb)
- gui1.Position=UDim2.new(0,5,0,-43)
- gui1.Size = UDim2.new(0,190,0,51)
- gui1.TextColor3 = Color3.new(255,255,255)
- gui1.BackgroundColor3=Color3.new(255,255,255)
- jump2 = true
- gui1.Visible = false
- img = Instance.new("ImageLabel",bb)
- img.Size = UDim2.new(0,46,0,47)
- img.Position = UDim2.new(0,10,0,-41)
- img.Image = "rbxassetid://447301252"
- img.BorderColor3 = Color3.new(0,0,0)
- img.Visible = false
- soka = Instance.new("Sound",char)
- soka.SoundId = "http://www.roblox.com/asset/?id = 447199232"
- soka.Volume = 1
- boom = Instance.new("Sound",char)
- boom.SoundId = "http://www.roblox.com/asset/?id = 447041606"
- boom.Volume = 1
- boom2 = Instance.new("Sound",char)
- boom2.SoundId = "http://www.roblox.com/asset/?id = 449025737"
- boom2.Volume = 1
- boom3 = Instance.new("Sound",char)
- boom3.SoundId = "http://www.roblox.com/asset/?id = 450719019"
- boom3.Volume = 1
- tps = Instance.new("Sound",char)
- tps.SoundId = "http://www.roblox.com/asset/?id = 449860746"
- tps.Volume = 1
- asd = Instance.new("Sound",char)
- asd.SoundId = "http://www.roblox.com/asset/?id = 447310433"
- asd.Volume =1
- asd1 = Instance.new("Sound",char)
- asd1.SoundId = "http://www.roblox.com/asset/?id = 358280695"
- asd2 = Instance.new("Sound",char)
- asd2.SoundId = "http://www.roblox.com/asset/?id = 386713054"
- asd2.Looped = true
- asd2.Volume = 5
- asd3 = Instance.new("Sound",char)
- asd3.SoundId = "http://www.roblox.com/asset/?id = 339250412"
- asd3.Looped = true
- asd4 = Instance.new("Sound",char)
- asd4.SoundId = "http://www.roblox.com/asset/?id = 401258325"
- asd4.Looped = true
- asd5 = Instance.new("Sound",char)
- asd5.SoundId = "http://www.roblox.com/asset/?id = 362252261"
- asd5.Looped = true
- gas = Instance.new("Sound",char)
- gas.SoundId = "http://www.roblox.com/asset/?id = 345052019"
- asd6 = Instance.new("Sound",char)
- asd6.SoundId = "http://www.roblox.com/asset/?id = 401258325"
- asd6.Looped = true
- function play(play)
- asd:Play()
- wait(0.05)
- --asd1:Play()
- end
- ------------
- -------------------------
- function stream(origin,dir,length,size)
- local parts = {}
- for i = 1,length do
- local p = Instance.new("Part",char)
- p.Anchored = true
- p.Transparency = 0.5
- p.TopSurface = 0
- p.BottomSurface = 0
- p.CanCollide = false
- p.BrickColor = BrickColor.new("Institutional white")
- p.Size = Vector3.new(10,30,10) -- for now
- p.CFrame = CFrame.new(origin+dir*i*size)*CFrame.Angles(math.random()*math.pi,math.random()*math.pi,math.random()*math.pi)
- parts[i] = {p,CFrame.Angles(math.random()*math.pi/5,math.random()*math.pi/5,math.random()*math.pi/5)}
- game:GetService("Debris"):AddItem(p,3)
- end
- Spawn(function()
- while parts do
- for i,v in pairs(parts) do
- if v[1].Parent == char then
- v[1].CFrame = v[1].CFrame*v[2]
- else
- parts = nil
- break
- end
- end
- wait(0.02)
- end
- end)
- end
- --[[-- listen for their chatting
- player.Chatted:connect(function(message)
- a = string.len(message)
- gui.Text = ""
- gui.Visible = true
- gui1.Visible = true
- des = false
- img.Visible = true
- print(a)
- if dot == false then
- gui.Text = ""
- for i = 1,string.len(message) do
- gui.Text =gui.Text..message:sub(i,i)
- play()
- end
- end
- des = true
- end)]]--
- m.KeyDown:connect(function(k)
- if k == "g" then
- asd2:Play()
- end
- end)
- m.KeyDown:connect(function(k)
- if k == "r" then
- asd4:Play()
- end
- end)
- m.KeyDown:connect(function(k)
- if k == "q" then
- asd3:Play()
- end
- end)
- m.KeyDown:connect(function(k)
- if k == "z" then
- img.Image = "rbxassetid://332766052"
- end
- end)
- m.KeyDown:connect(function(k)
- if k == "c" then
- img.Image = "rbxassetid://447301252"
- end
- end)
- m.KeyDown:connect(function(k)
- if k == "b" then
- asd6:Play()
- end
- end)
- mouse = p:GetMouse()
- m.KeyDown:connect(function(k)
- if k:byte() == 48 then
- hum.WalkSpeed = 100
- end
- end)
- m.KeyDown:connect(function(k)
- if k:byte() == 50 then
- soka:Play()
- end
- end)
- m.KeyDown:connect(function(k)
- if k:byte() == 52 then
- char.Head.face.Texture = "rbxassetid://444037452"
- end
- end)
- m.KeyDown:connect(function(k)
- if k:byte() == 51 then
- char.Head.face.Texture = "rbxassetid://332768867"
- end
- end)
- m.KeyUp:connect(function(k)
- if k:byte() == 48 then
- hum.WalkSpeed = 16
- end
- end)
- p.Chatted:connect(function(m)
- if m == "Okay." then
- soka:Play()
- end
- end)
- m.KeyDown:connect(function(k)
- if k == "x" then
- if des == true then
- gui.Visible = false
- gui.Text = "* "
- gui1.Visible = false
- img.Visible = false
- end
- end
- end)
- m.KeyDown:connect(function(key)
- if key == "j" then
- if tp == true then
- tp = false
- tps:Play()
- char.Head.face.Parent = game.Lighting
- for i,v in pairs(char:GetChildren()) do if v:IsA("Part") then v.Transparency = 1
- end
- end
- wait(0.5)
- for i,v in pairs(char:GetChildren()) do if v:IsA("Part") then v.Transparency = 0
- end
- end
- char.HumanoidRootPart.CFrame = mouse.Hit * CFrame.new(0, 3, 0)
- char.HumanoidRootPart.Transparency = 1
- game.Lighting.face.Parent = char.Head
- wait(0.2)
- tp = true
- end
- end
- end)
- m.KeyDown:connect(function(key)
- if key == "t" then
- if punch2 == true then
- punch2 = false
- punch = false
- local ChatService = game:GetService("Chat")
- neck.C0 = neck.C0 * CFrame.Angles(0.3,0,0)
- ChatService:Chat(char.Head, "Mind if I get Serious?")
- wait(1)
- local ChatService = game:GetService("Chat")
- ChatService:Chat(char.Head ,"Killer Move: Serious Series...")
- wait(1)
- local ChatService = game:GetService("Chat")
- ChatService:Chat(char.Head, "SERIOUS PUNCH.")
- neck.C0 = neckp
- wait(0.6)
- org = char.Torso["Left Shoulder"].C0
- char.Torso["Left Shoulder"].C0 = char.Torso["Left Shoulder"].C0 * CFrame.new(-0.3,0,0) * CFrame.Angles(0,0,math.rad(-90))
- wait()
- killbrick2 = Instance.new("Part",char)
- killbrick2.Size = Vector3.new(150,80,9000)
- killbrick2.Transparency = 1
- killbrick2.CanCollide = true
- wait(0.1)
- killbrick2.CanCollide = false
- killbrick2.Anchored = true
- killbrick2.CFrame = char.Torso.CFrame * CFrame.new(0,0,-1005)
- killbrick2.Touched:connect(function(h)
- local x = h.Parent:FindFirstChild("Humanoid")
- if x then
- if x.Parent.Name == game.Players.LocalPlayer.Name then
- safe = true
- else safe = false
- end
- if x then
- if safe == false then
- h.Parent.Torso.Velocity = CFrame.new(char.Torso.Position,h.Parent.Torso.Position).lookVector * 900
- local bodyforc = Instance.new("BodyForce", h.Parent.Torso)
- boom:Play()
- bodyforc.force = Vector3.new(0, h.Parent.Torso:GetMass() * 196.1, 0)
- wait(0.2)
- x.Parent:BreakJoints()
- wait()
- safe = true
- end
- end
- end
- end)
- local rng = Instance.new("Part", char)
- rng.Anchored = true
- rng.BrickColor = BrickColor.new("Institutional white")
- rng.CanCollide = false
- rng.FormFactor = 3
- rng.Name = "Ring"
- rng.Size = Vector3.new(1, 1, 1)
- rng.Transparency = 0.8
- rng.TopSurface = 0
- rng.BottomSurface = 0
- rng.CFrame = char["Left Arm"].CFrame * CFrame.new(0,-2,0)
- --rng.Rotation = Vector3.new(math.pi/2,0,0)
- rng.CFrame = rng.CFrame * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0))
- local rngm = Instance.new("SpecialMesh", rng)
- rngm.MeshId = "http://www.roblox.com/asset/?id=3270017"
- rngm.Scale = Vector3.new(1, 1.3, 2)
- local rng1 = Instance.new("Part", char)
- rng1.Anchored = true
- rng1.BrickColor = BrickColor.new("Institutional white")
- rng1.CanCollide = false
- rng1.FormFactor = 3
- rng1.Name = "Ring"
- rng1.Size = Vector3.new(1, 1, 1)
- rng1.Transparency = 0.8
- rng1.TopSurface = 0
- rng1.BottomSurface = 0
- rng1.CFrame = char["Left Arm"].CFrame * CFrame.new(0,-2,0)
- --rng1.Rotation = Vector3.new(math.pi/2,0,0)
- rng1.CFrame = rng1.CFrame * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0))
- local rngm1 = Instance.new("SpecialMesh", rng1)
- rngm1.MeshId = "http://www.roblox.com/asset/?id=3270017"
- rngm1.Scale = Vector3.new(1, 1.3, 2)
- local p = (torso.CFrame*CFrame.new(-20,0,3))
- stream(p.p,((p*Vector3.new(-0.7,0,1))-p.p).unit,90,5) -- 20 is number of parts, 6 is distance between each one
- local p = (torso.CFrame*CFrame.new(20,0,3))
- stream(p.p,((p*Vector3.new(0.7,0,1))-p.p).unit,90,5) -- same here
- local rng2 = Instance.new("Part", char)
- rng2.Anchored = true
- rng2.BrickColor = BrickColor.new("Institutional white")
- rng2.CanCollide = false
- rng2.FormFactor = 3
- rng2.Name = "Ring"
- rng2.Size = Vector3.new(1, 1, 1)
- rng2.Transparency = 0.8
- rng2.TopSurface = 0
- rng2.BottomSurface = 0
- rng2.CFrame = char["Left Arm"].CFrame * CFrame.new(0,-2,0)
- --rng1.Rotation = Vector3.new(math.pi/2,0,0)
- rng2.CFrame = rng2.CFrame * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0))
- local rngm2 = Instance.new("SpecialMesh", rng2)
- rngm2.MeshId = "http://www.roblox.com/asset/?id=3270017"
- rngm2.Scale = Vector3.new(1, 1.3, 2)
- wait(0.1)
- boom3:Play()
- coroutine.wrap(function()
- for i = 1, 35, 0.5 do
- rngm.Scale = Vector3.new(50 + i*2, 10 + i*2, 2.5+ i*4)
- rngm1.Scale = Vector3.new(50 + i*2, 1.4 + i*2, 1.4+ i*4)
- rngm2.Scale = Vector3.new(50 + i*2, 10 + i*2, 1.2+ i*4)
- wait()
- end
- wait()
- rng:Destroy()
- rng1:Destroy()
- rng2:Destroy()
- killbrick2:Remove()
- wait(0.5)
- char.Torso["Left Shoulder"].C0 = org
- wait(1)
- punch2 = true
- punch = true
- wait()
- end)()
- end
- wait(.1)
- end
- end)
- m.KeyDown:connect(function(key)
- if key == "k" then
- if punch == true then
- punch = false
- local ChatService = game:GetService("Chat")
- ChatService:Chat(char.Head ,"Normal Punch")
- wait(1)
- org = char.Torso["Left Shoulder"].C0
- char.Torso["Left Shoulder"].C0 = char.Torso["Left Shoulder"].C0 * CFrame.new(-0.3,0,0) * CFrame.Angles(0,0,math.rad(-90))
- killbrick = Instance.new("Part",char)
- killbrick.Size = Vector3.new(5,1,5)
- killbrick.Transparency = 1
- killbrick:BreakJoints()
- killbrick.CanCollide = false
- local wel = Instance.new("Weld",killbrick)
- wel.Part0 = killbrick
- wel.Part1 = char["Left Arm"]
- wel.C0 = CFrame.new(0,1,0)
- force = 90
- killbrick.Touched:connect(function(h)
- local x = h.Parent.Humanoid
- if x.Health >= 6000 then
- fling = false
- end
- if x.Health < 6000 then
- fling = true
- end
- local stop = h.Parent.Torso.Velocity
- if x.Parent.Name == game.Players.LocalPlayer.Name then
- safe = true
- else safe = false
- end
- if x then
- if safe == false then
- if fling == true then
- force = 900
- end
- if fling == false then
- force = 200
- end
- h.Parent.Torso.Velocity = CFrame.new(char.Torso.Position,h.Parent.Torso.Position).lookVector * force
- local bodyforc = Instance.new("BodyForce", h.Parent.Torso)
- boom:Play()
- bodyforc.force = Vector3.new(0, h.Parent.Torso:GetMass() * 196.1, 0)
- wait(0.2)
- x:TakeDamage(500)
- wait()
- safe = true
- bodyforc:Remove()
- h.Parent.Torso.Velocity = stop
- end
- end
- end)
- local rng = Instance.new("Part", char)
- rng.Anchored = true
- rng.BrickColor = BrickColor.new("Institutional white")
- rng.CanCollide = false
- rng.FormFactor = 3
- rng.Name = "Ring"
- rng.Size = Vector3.new(1, 1, 1)
- rng.Transparency = 0.8
- rng.TopSurface = 0
- rng.BottomSurface = 0
- rng.CFrame = char["Left Arm"].CFrame * CFrame.new(0,-2,0)
- --rng.Rotation = Vector3.new(math.pi/2,0,0)
- rng.CFrame = rng.CFrame * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0))
- local rngm = Instance.new("SpecialMesh", rng)
- rngm.MeshId = "http://www.roblox.com/asset/?id=3270017"
- rngm.Scale = Vector3.new(1, 1.3, 2)
- wait(0.1)
- boom2:Play()
- coroutine.wrap(function()
- for i = 1, 10, .4 do
- rngm.Scale = Vector3.new(2 + i*2, 2 + i*2, 1)
- wait()
- end
- wait()
- rng:Destroy()
- killbrick:Remove()
- wait(0.5)
- char.Torso["Left Shoulder"].C0 = org
- wait(1)
- punch = true
- wait()
- end)()
- end
- wait(.1)
- end
- end)
- m.KeyDown:connect(function(key)
- if key == "m" then
- if jump == true then
- jump = false
- local rng = Instance.new("Part", char)
- rng.Anchored = true
- rng.BrickColor = BrickColor.new("Institutional white")
- rng.CanCollide = false
- rng.FormFactor = 3
- rng.Name = "Ring"
- rng.Size = Vector3.new(1, 1, 1)
- rng.Transparency = 0.35
- rng.TopSurface = 0
- rng.BottomSurface = 0
- rng.Position = torso.Position - Vector3.new(0,2,0)
- rng.CFrame = rng.CFrame * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0))
- local rngm = Instance.new("SpecialMesh", rng)
- rngm.MeshId = "http://www.roblox.com/asset/?id=3270017"
- rngm.Scale = Vector3.new(1, 1.3, 2)
- wait(0.1)
- BV = Instance.new("BodyVelocity", torso)
- BV.maxForce = Vector3.new(0,20000,0)
- BV.P = 1000
- BV.velocity = Vector3.new(0,100,0)
- boom:Play()
- coroutine.wrap(function()
- for i = 1, 60, 2 do
- rngm.Scale = Vector3.new(2 + i*2, 2 + i*2, 1)
- rng.Transparency = i/60
- wait()
- end
- wait()
- rng:Destroy()
- hum.WalkSpeed = 50
- wait(1)
- for i,v in pairs(torso:GetChildren()) do if v:IsA("BodyVelocity") then
- v:Destroy() jumping2 = true falling = true wait(0.3) jumping2 = false falling = false wait(1.7) jump = true hum.WalkSpeed = 16 falling = false
- end end
- wait()
- end)()
- end
- wait(.1)
- end
- end)
- m.KeyDown:connect(function(key)
- if key == "n" then
- if falling == true then
- falling = false
- if jumping2 == true then
- jumping2 = false
- jump = false
- BV = Instance.new("BodyVelocity", torso)
- BV.maxForce = Vector3.new(0,-20000,0)
- BV.P = -1000
- BV.velocity = Vector3.new(0,-70,0)
- wait(0.6)
- local rng = Instance.new("Part", char)
- rng.Anchored = true
- rng.BrickColor = BrickColor.new("Institutional white")
- rng.CanCollide = false
- rng.FormFactor = 3
- rng.Name = "Ring"
- rng.Size = Vector3.new(1, 1, 1)
- rng.Transparency = 0.35
- rng.TopSurface = 0
- rng.BottomSurface = 0
- rng.Position = torso.Position - Vector3.new(0,2,0)
- rng.CFrame = rng.CFrame * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0))
- local rngm = Instance.new("SpecialMesh", rng)
- rngm.MeshId = "http://www.roblox.com/asset/?id=3270017"
- rngm.Scale = Vector3.new(1, 1.3, 2)
- boom:Play()
- coroutine.wrap(function()
- for i = 1, 60, 2 do
- rngm.Scale = Vector3.new(2 + i*2, 2 + i*2, 1)
- rng.Transparency = i/60
- wait()
- end
- wait()
- rng:Destroy()
- for i,v in pairs(torso:GetChildren()) do if v:IsA("BodyVelocity") then
- v:Destroy() wait(2) jumping2 = true hum.WalkSpeed = 16
- end end
- wait()
- end)()
- end
- wait(.1)
- end
- end
- end)
- m.KeyDown:connect(function(k)
- if k == "f" then
- asd3:Stop()
- asd2:Stop()
- asd4:Stop()
- asd6:Stop()
- asd5:Stop()
- end
- end)
- ------------
- local verlet = {}
- verlet.step_time = 1 / 50
- verlet.gravity = Vector3.new(0, -10, 0)
- local char = game.Players.LocalPlayer.Character
- local torso = char:WaitForChild("Torso")
- local parts = {}
- local render = game:GetService("RunService").RenderStepped
- wait(2)
- local point = {}
- local link = {}
- local rope = {}
- local function ccw(A,B,C)
- return (C.y-A.y) * (B.x-A.x) > (B.y-A.y) * (C.x-A.x)
- end
- local function intersect(A,B,C,D)
- return ccw(A,C,D) ~= ccw(B,C,D) and ccw(A,B,C) ~= ccw(A,B,D)
- end
- local function vec2(v)
- return Vector2.new(v.x, v.z)
- end
- function point:step()
- if not self.fixed then
- local derivative = (self.position - self.last_position) * 0.95
- self.last_position = self.position
- self.position = self.position + derivative + (self.velocity * verlet.step_time ^ 2)
- --[[local torsoP = torso.CFrame * CFrame.new(-1, 0, 0.5)
- local torsoE = torso.CFrame * CFrame.new(1, 0, 0.5)
- local pointE = self.position + torso.CFrame.lookVector * 100
- local doIntersect = intersect(vec2(torsoP.p), vec2(torsoE.p), vec2(self.position), vec2(pointE))
- if not doIntersect then
- self.postition = self.position - torso.CFrame.lookVector * 10
- end]]
- end
- end
- function link:step()
- for i = 1, 1 do
- local distance = self.point1.position - self.point2.position
- local magnitude = distance.magnitude
- local differance = (self.length - magnitude) / magnitude
- local translation = ((self.point1.fixed or self.point2.fixed) and 1 or 0.6) * distance * differance
- if not self.point1.fixed then
- self.point1.position = self.point1.position + translation
- end
- if not self.point2.fixed then
- self.point2.position = self.point2.position - translation
- end
- end
- end
- function verlet.new(class, a, b, c)
- if class == "Point" then
- local new = {}
- setmetatable(new, {__index = point})
- new.class = class
- new.position = a or Vector3.new()
- new.last_position = new.position
- new.velocity = verlet.gravity
- new.fixed = false
- return new
- elseif class == "Link" then
- local new = {}
- setmetatable(new, {__index = link})
- new.class = class
- new.point1 = a
- new.point2 = b
- new.length = c or (a.position - b.position).magnitude
- return new
- elseif class == "Rope" then
- local new = {}
- setmetatable(new, {__index = link})
- new.class = class
- new.start_point = a
- new.finish_point = b
- new.points = {}
- new.links = {}
- local inc = (b - a) / 10
- for i = 0, 10 do
- table.insert(new.points, verlet.new("Point", a + (i * inc)))
- end
- for i = 2, #new.points do
- table.insert(new.links, verlet.new("Link", new.points[i - 1], new.points[i]))
- end
- return new
- end
- end
- local tris = {}
- local triParts = {}
- local function GetDiscoColor(hue)
- local section = hue % 1 * 3
- local secondary = 0.5 * math.pi * (section % 1)
- if section < 1 then
- return Color3.new(255, 255, 255)
- elseif section < 2 then
- return Color3.new(255, 255, 255)
- else
- return Color3.new(255, 255, 255)
- end
- end
- local function setupPart(part)
- part.Anchored = true
- part.FormFactor = 3
- part.CanCollide = false
- part.TopSurface = 10
- part.BottomSurface = 10
- part.LeftSurface = 10
- part.RightSurface = 10
- part.FrontSurface = 10
- part.BackSurface = 10
- part.Material = "Plastic"
- local m = Instance.new("SpecialMesh", part)
- m.MeshType = "Wedge"
- m.Scale = Vector3.new(0.2, 1, 1)
- return part
- end
- local function CFrameFromTopBack(at, top, back)
- local right = top:Cross(back)
- return CFrame.new(at.x, at.y, at.z, right.x, top.x, back.x, right.y, top.y, back.y, right.z, top.z, back.z)
- end
- local function drawTri(parent, a, b, c)
- local this = {}
- local mPart1 = table.remove(triParts, 1) or setupPart(Instance.new("Part"))
- local mPart2 = table.remove(triParts, 1) or setupPart(Instance.new("Part"))
- function this:Set(a, b, c)
- local ab, bc, ca = b-a, c-b, a-c
- local abm, bcm, cam = ab.magnitude, bc.magnitude, ca.magnitude
- local edg1 = math.abs(0.5 + ca:Dot(ab)/(abm*abm))
- local edg2 = math.abs(0.5 + ab:Dot(bc)/(bcm*bcm))
- local edg3 = math.abs(0.5 + bc:Dot(ca)/(cam*cam))
- if edg1 < edg2 then
- if edg1 >= edg3 then
- a, b, c = c, a, b
- ab, bc, ca = ca, ab, bc
- abm = cam
- end
- else
- if edg2 < edg3 then
- a, b, c = b, c, a
- ab, bc, ca = bc, ca, ab
- abm = bcm
- else
- a, b, c = c, a, b
- ab, bc, ca = ca, ab, bc
- abm = cam
- end
- end
- local len1 = -ca:Dot(ab)/abm
- local len2 = abm - len1
- local width = (ca + ab.unit*len1).magnitude
- local maincf = CFrameFromTopBack(a, ab:Cross(bc).unit, -ab.unit)
- if len1 > 0.2 then
- mPart1.Parent = parent
- mPart1.Size = Vector3.new(0.2, width, len1)
- mPart1.CFrame = maincf*CFrame.Angles(math.pi,0,math.pi/2)*CFrame.new(0,width/2,len1/2)
- else
- mPart1.Parent = nil
- end
- if len2 > 0.2 then
- mPart2.Parent = parent
- mPart2.Size = Vector3.new(0.2, width, len2)
- mPart2.CFrame = maincf*CFrame.Angles(math.pi,math.pi,-math.pi/2)*CFrame.new(0,width/2,-len1 - len2/2)
- else
- mPart2.Parent = nil
- end
- end
- function this:SetProperty(prop, value)
- mPart1[prop] = value
- mPart2[prop] = value
- end
- this:Set(a, b, c)
- function this:Destroy()
- mPart1:Destroy()
- mPart2:Destroy()
- end
- this.p1 = mPart1
- this.p2 = mPart2
- this.p1.BrickColor = BrickColor.new(GetDiscoColor(math.noise(0.5, 0.5, this.p1.CFrame.Y * 0.5 + time())))
- this.p2.BrickColor = BrickColor.new(GetDiscoColor(math.noise(0.5, 0.5, this.p2.CFrame.Y * 0.5 + time())))
- return this
- end
- function verlet.draw(object, id)
- if object.class == "Point" then
- local part = parts[id]
- part.BrickColor = BrickColor.new(255, 0, 0)
- part.Transparency = 0
- part.formFactor = 3
- part.Anchored = true
- part.CanCollide = false
- part.TopSurface = 0
- part.BottomSurface = 0
- part.Size = Vector3.new(0.35, 0.35, 0.35)
- part.Material = "Plastic"
- part.CFrame = CFrame.new(object.position)
- part.Parent = torso
- return part
- elseif object.class == "Link" then
- local part = parts[id]
- local dist = (object.point1.position - object.point2.position).magnitude
- part.Size = Vector3.new(0.2, 0.2, dist)
- part.CFrame = CFrame.new(object.point1.position, object.point2.position) * CFrame.new(0, 0, dist * -0.5)
- part.Parent = torso
- return part
- end
- end
- function verlet.clear()
- for _, v in pairs(workspace:GetChildren()) do
- if v.Name == "Part" then
- v:Destroy()
- end
- end
- end
- local points = {}
- local links = {}
- for x = 0, 2 do
- points[x] = {}
- for y = 0, 3 do
- points[x][y] = verlet.new("Point", torso.Position + Vector3.new(x * 0.8 - 2, 2 - y * 0.8, 5 + y * 0.4))
- points[x][y].fixed = y == 0
- end
- end
- for x = 1, 2 do
- for y = 0, 3 do
- links[#links + 1] = verlet.new("Link", points[x][y], points[x - 1][y], 1 + y * 0.08)
- end
- end
- for x = 0, 2 do
- for y = 1, 3 do
- links[#links + 1] = verlet.new("Link", points[x][y], points[x][y - 1], 1.2 + y * 0.03)
- end
- end
- render:connect(function()
- for x = 0, 2 do
- for y = 0, 3 do
- if y == 0 then
- points[x][y].position = (torso.CFrame * CFrame.new(x * 1 - 1, 1, 0.5)).p
- else
- points[x][y]:step()
- end
- end
- end
- for i = 1, #links do
- links[i]:step()
- end
- for i = 1, #tris do
- triParts[#triParts + 1] = tris[i].p1
- triParts[#triParts + 1] = tris[i].p2
- end
- tris = {}
- for x = 1, 2 do
- for y = 1, 3 do
- tris[#tris + 1] = drawTri(torso, points[x - 1][y - 1].position, points[x - 1][y].position, points[x][y - 1].position)
- tris[#tris + 1] = drawTri(torso, points[x][y].position, points[x - 1][y].position, points[x][y - 1].position)
- end
- end
- end)
- --/ edited by the cancerous rocky2u
- local plr = game.Players.LocalPlayer
- local chr = plr.Character
- local mouse = plr:GetMouse()
- _G.hotkey = 'e'
- mouse.KeyDown:connect(function(key)
- if key == _G.hotkey then
- local chr = game.Players.LocalPlayer.Character
- stopAnimations()
- chr.Animate.Disabled = true
- chr.Torso["Left Shoulder"].C1 = CFrame.new(0, 0.699999988, 0, 0.939692616, 0, -0.342020124, -0.330366075, -0.258819044, -0.907673359, -0.0885213241, 0.965925813, -0.243210346)
- chr.Torso["Right Shoulder"].C1 = CFrame.new(-0.600000024, 0.5, -0.200000003, 0.664462984, 0.241844743, 0.707106769, -0.664462984, -0.241844788, 0.707106769, 0.342020154, -0.939692616, -3.09086197e-008)
- chr.Torso["Neck"].C1 = CFrame.new(0, -0.600000024, 0, -0.866025388, 0.5, 0, -0.171010137, -0.29619807, 0.939692616, 0.469846278, 0.813797653, 0.342020124)
- end
- end)
- mouse.KeyUp:connect(function(key)
- if key == _G.hotkey then
- local chr = game.Players.LocalPlayer.Character
- chr.Animate.Disabled = false
- chr.Torso["Left Shoulder"].C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- chr.Torso["Right Shoulder"].C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- chr.Torso["Neck"].C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
- end
- end)
- function stopAnimations()
- for _,v in pairs(game.Players.LocalPlayer.Character.Humanoid:GetPlayingAnimationTracks()) do
- v:Stop()
- end
- end
Add Comment
Please, Sign In to add comment