Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- for i=1,8 do
- local p = Instance.new("Part",char)
- p.Anchored = false
- p.BrickColor = BrickColor.new("Institutional white")
- p.CanCollide = false
- p.FormFactor="Custom"
- p.Material = "SmoothPlastic"
- p.TopSurface = "SmoothNoOutlines"
- p.BottomSurface = "SmoothNoOutlines"
- p.RightSurface = "SmoothNoOutlines"
- p.LeftSurface = "SmoothNoOutlines"
- p.FrontSurface = "SmoothNoOutlines"
- p.BackSurface = "SmoothNoOutlines"
- p.Size=Vector3.new(2,.2,0.2)
- p:BreakJoints() -- sometimes the parts are stuck to something so you have to breakjoints them
- mesh = Instance.new("BlockMesh",p)
- mesh.Scale = Vector3.new(1,1,4)
- local w = Instance.new("Motor6D",p)
- w.Part0 = aa1[i-1] and aa1[i-1][1] or torso
- w.Part1 = p
- w.Name = "Weld"
- --table.insert(aa1,p)
- aa1[i] = {p,p.CFrame}
- 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 = 378387996"
- 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
- ------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement