Advertisement
sin3715

Untitled

Apr 21st, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -------------
  2. --Can Drank--
  3. -------------
  4. --By --
  5. --CKbackup-
  6. -----------
  7.  
  8. player = game.Players.LocalPlayer
  9. chara = player.Character
  10. debby = game.Debris
  11. Mouse = player:GetMouse()
  12. rs = game:GetService("RunService").RenderStepped
  13.  
  14. --Outfit--
  15. New = function(Object, Parent, Name, Data)
  16. local Object = Instance.new(Object)
  17. for Index, Value in pairs(Data or {}) do
  18. Object[Index] = Value
  19. end
  20. Object.Parent = Parent
  21. Object.Name = Name
  22. return Object
  23. end
  24.  
  25. Can = New("Part",chara,"Can",{Size = Vector3.new(0.800000012, 1.20000005, 0.800000012),CFrame = CFrame.new(-30.8000011, 1.60000002, -33, 0.707107842, 0, -0.70710814, 0, 1, 0, 0.70710814, 0, 0.707107842),})
  26. CanMesh = New("SpecialMesh",Can,"CanMesh",{Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005),MeshId = "http://www.roblox.com/asset/?id=10470609",TextureId = "rbxassetid://24970256",MeshType = Enum.MeshType.FileMesh,})
  27. Weld = New("ManualWeld",Can,"Weld",{Part0 = Can,Part1 = chara["Right Arm"],C0 = CFrame.new(0, 0, 0, 0.707107842, 0, 0.70710814, 0, 1, 0, -0.70710814, 0, 0.707107842),C1 = CFrame.new(-0.300001144, -1, -0.100000024, 1, 0, 0, 0, 0, 1, -0, -1, -0),})
  28.  
  29. --Sounds--
  30. function LoadSnd(id,loop,vol,pit)
  31. local snd = New("Sound",chara,"Sound",{SoundId = "rbxassetid://"..id,Looped = loop,Volume = vol,Pitch = pit})
  32. return snd
  33. end
  34. DrinkSnd = LoadSnd(491214142,true,1,1)
  35. StartUpSnd = LoadSnd(10721950,false,1,1)
  36. SwingSnd = LoadSnd(158037267,false,1,1)
  37.  
  38. function CreateTrailObj(parent,color1,color2,ofsx,ofsz)
  39. local Att1 = New("Attachment",parent,"Att1",{Position = Vector3.new(ofsx,parent.Size.Y/2,ofsz)})
  40. local Att2 = New("Attachment",parent,"Att2",{Position = Vector3.new(ofsx,-(parent.Size.Y/2),ofsz)})
  41. local TEff = New("Trail",parent,"TrailEff",{Color = ColorSequence.new({ColorSequenceKeypoint.new(0,BrickColor.new(color1).Color),ColorSequenceKeypoint.new(1,BrickColor.new(color2).Color)}),Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,.5),NumberSequenceKeypoint.new(1,1)}),Attachment0 = Att1,Attachment1 = Att2,Enabled = false,Lifetime = .5,MinLength = .001})
  42. return TEff
  43. end
  44.  
  45. --Clerp Animations--
  46. TC = chara.HumanoidRootPart.RootJoint
  47. HC = chara.Torso.Neck
  48. RAC = chara.Torso["Right Shoulder"]
  49. LAC = chara.Torso["Left Shoulder"]
  50. RLC = chara.Torso["Right Hip"]
  51. LLC = chara.Torso["Left Hip"]
  52. TCF = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  53. HCF = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  54. RACF = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  55. LACF = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  56. RLCF = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  57. LLCF = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  58. RWF = CFrame.new(-1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  59. LWF = CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  60. RLWF = CFrame.new(-.5, 2, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  61. LLWF = CFrame.new(.5, 2, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
  62. RW = Instance.new("Weld",HC.Parent)
  63. RW.Part1 = HC.Parent
  64. RW.Part0 = chara["Right Arm"]
  65. RW.C0 = RWF
  66.  
  67. function clerp(a,b,c)
  68. return a:lerp(b,c)
  69. end
  70.  
  71. --TC.C0 = TCF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(90))
  72. --HC.C0 = HCF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-50))
  73. --RW.C0 = (RWF + Vector3.new(1,2,0)) * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-90))
  74. --LW.C0 = LWF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(2))
  75.  
  76. RW.C0 = RWF
  77.  
  78. --Idle Clerp--
  79. IRWF = (RWF - Vector3.new(-.2,0,-.5)) * CFrame.fromEulerAnglesXYZ(math.rad(-90),math.rad(-20),0)
  80.  
  81. function res()
  82. RW.C0 = IRWF
  83. end
  84. res()
  85. del = false
  86. normalwel = Weld.C0
  87. function onButton1Down()
  88. if del == false then
  89. del = true
  90. for i = 0,1,.2 do
  91. rs:wait()
  92. RW.C0 = clerp(IRWF,(RWF - Vector3.new(-.3,.1,-.7)) * CFrame.fromEulerAnglesXYZ(math.rad(-110),math.rad(-70),math.rad(20)),i)
  93. HC.C0 = clerp(HCF,HCF * CFrame.fromEulerAnglesXYZ(math.rad(-10),0,0),i)
  94. end
  95. Weld.C0 = CFrame.new(0, 0, 0, -0.122617364, -0.0738587826, 0.989701807, -0.81083709, 0.582491338, -0.0569874756, -0.572283864, -0.809474528, -0.13131094)
  96. DrinkSnd:Play()
  97. wait(2)
  98. DrinkSnd:Stop()
  99. Weld.C0 = normalwel
  100. for i = 0,1,.2 do
  101. rs:wait()
  102. RW.C0 = clerp(IRWF,(RWF - Vector3.new(-.3,.1,-.7)) * CFrame.fromEulerAnglesXYZ(math.rad(-110),math.rad(-70),math.rad(20)),1-i)
  103. HC.C0 = clerp(HCF,HCF * CFrame.fromEulerAnglesXYZ(math.rad(-10),0,0),1-i)
  104. end
  105. SwingSnd:Play()
  106. for i = 0,1,.25 do
  107. rs:wait()
  108. RW.C0 = clerp(IRWF,(RWF - Vector3.new(0,-1,0)) * CFrame.fromEulerAnglesXYZ(math.rad(-190),0,0),i)
  109. end
  110. local fcan = Can:Clone()
  111. fcan.Weld:Destroy()
  112. fcan.Parent = workspace
  113. fcan.Position = Can.Position
  114. local bfos = Instance.new("BodyVelocity",fcan)
  115. bfos.P = 1000
  116. bfos.MaxForce = Vector3.new(1000,1000,1000)
  117. bfos.Velocity = Vector3.new(0,10,0) + chara.Head.CFrame.lookVector*-30
  118. debby:AddItem(bfos,.1)
  119. coroutine.resume(coroutine.create(function()
  120. wait(10)
  121. for i = 0,1,.1 do
  122. wait(.1)
  123. fcan.Transparency = i
  124. end
  125. fcan:Destroy()
  126. end))
  127. Can.Transparency = 1
  128. wait(1)
  129. for i = 0,1,.2 do
  130. rs:wait()
  131. RW.C0 = clerp(RWF,(RWF - Vector3.new(0,-1,0)) * CFrame.fromEulerAnglesXYZ(math.rad(-190),0,0),1-i)
  132. end
  133. wait(1)
  134. StartUpSnd:Play()
  135. for i = 0,1,.1 do
  136. wait(.1)
  137. Can.Transparency = 1-i
  138. end
  139. for i = 0,1,.2 do
  140. rs:wait()
  141. RW.C0 = clerp(RWF,IRWF,i)
  142. end
  143. del = false
  144. end
  145. end
  146.  
  147. --Mouse Activation--
  148. if Mouse then
  149. Mouse.Button1Down:connect(onButton1Down)
  150. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement