Advertisement
SheeityArtist

Can Drink

Aug 13th, 2017
4,404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.36 KB | None | 0 0
  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://10470600",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.  
  86. --Mouse Functions--
  87. dif = 0
  88. function onKeyDown(key)
  89. if key == "q" then
  90. if dif == 0 then
  91. CanMesh.TextureId = "http://www.roblox.com/asset/?id=25323705"
  92. dif = 1
  93. elseif dif == 1 then
  94. CanMesh.TextureId = "http://www.roblox.com/asset/?id=11126634"
  95. dif = 2
  96. elseif dif == 2 then
  97. CanMesh.TextureId = "http://www.roblox.com/asset/?id=25323909"
  98. dif = 3
  99. elseif dif == 3 then
  100. CanMesh.TextureId = "http://www.roblox.com/asset/?id=24970071"
  101. dif = 4
  102. elseif dif == 4 then
  103. CanMesh.TextureId = "http://www.roblox.com/asset/?id=16574454"
  104. dif = 5
  105. elseif dif == 5 then
  106. CanMesh.TextureId = "http://www.roblox.com/asset/?id=24970256"
  107. dif = 6
  108. elseif dif == 6 then
  109. CanMesh.TextureId = "http://www.roblox.com/asset/?id=10549894"
  110. dif = 7
  111. elseif dif == 7 then
  112. CanMesh.TextureId = "http://www.roblox.com/asset/?id=15218018"
  113. dif = 8
  114. elseif dif == 8 then
  115. CanMesh.TextureId = "http://www.roblox.com/asset/?id=28121842"
  116. dif = 9
  117. elseif dif == 9 then
  118. CanMesh.TextureId = "http://www.roblox.com/asset/?id=24878483"
  119. dif = 10
  120. elseif dif == 10 then
  121. CanMesh.TextureId = "http://www.roblox.com/asset/?id=10470600"
  122. dif = 0
  123. end
  124. end
  125. end
  126. del = false
  127. normalwel = Weld.C0
  128. function onButton1Down()
  129. if del == false then
  130. del = true
  131. for i = 0,1,.2 do
  132. rs:wait()
  133. RW.C0 = clerp(IRWF,(RWF - Vector3.new(-.3,.1,-.7)) * CFrame.fromEulerAnglesXYZ(math.rad(-110),math.rad(-70),math.rad(20)),i)
  134. HC.C0 = clerp(HCF,HCF * CFrame.fromEulerAnglesXYZ(math.rad(-10),0,0),i)
  135. end
  136. 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)
  137. DrinkSnd:Play()
  138. wait(2)
  139. DrinkSnd:Stop()
  140. Weld.C0 = normalwel
  141. for i = 0,1,.2 do
  142. rs:wait()
  143. RW.C0 = clerp(IRWF,(RWF - Vector3.new(-.3,.1,-.7)) * CFrame.fromEulerAnglesXYZ(math.rad(-110),math.rad(-70),math.rad(20)),1-i)
  144. HC.C0 = clerp(HCF,HCF * CFrame.fromEulerAnglesXYZ(math.rad(-10),0,0),1-i)
  145. end
  146. SwingSnd:Play()
  147. for i = 0,1,.25 do
  148. rs:wait()
  149. RW.C0 = clerp(IRWF,(RWF - Vector3.new(0,-1,0)) * CFrame.fromEulerAnglesXYZ(math.rad(-190),0,0),i)
  150. end
  151. local fcan = Can:Clone()
  152. fcan.Weld:Destroy()
  153. fcan.Parent = workspace
  154. fcan.Position = Can.Position
  155. local bfos = Instance.new("BodyVelocity",fcan)
  156. bfos.P = 1000
  157. bfos.MaxForce = Vector3.new(1000,1000,1000)
  158. bfos.Velocity = Vector3.new(0,10,0) + chara.Head.CFrame.lookVector*-30
  159. debby:AddItem(bfos,.1)
  160. coroutine.resume(coroutine.create(function()
  161. wait(10)
  162. for i = 0,1,.1 do
  163. wait(.1)
  164. fcan.Transparency = i
  165. end
  166. fcan:Destroy()
  167. end))
  168. Can.Transparency = 1
  169. wait(1)
  170. for i = 0,1,.2 do
  171. rs:wait()
  172. RW.C0 = clerp(RWF,(RWF - Vector3.new(0,-1,0)) * CFrame.fromEulerAnglesXYZ(math.rad(-190),0,0),1-i)
  173. end
  174. wait(1)
  175. StartUpSnd:Play()
  176. for i = 0,1,.1 do
  177. wait(.1)
  178. Can.Transparency = 1-i
  179. end
  180. for i = 0,1,.2 do
  181. rs:wait()
  182. RW.C0 = clerp(RWF,IRWF,i)
  183. end
  184. del = false
  185. end
  186. end
  187.  
  188. --Mouse Activation--
  189. if Mouse then
  190. Mouse.KeyDown:connect(onKeyDown)
  191. Mouse.Button1Down:connect(onButton1Down)
  192. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement