View difference between Paste ID: NWXvbfp8 and awfGzdCM
SHOW: | | - or go back to the newest paste.
1
-------------
2
--Can Drank--
3
-------------
4
--By	 --
5
--CKbackup-
6
-----------
7
8-
player = game.Players.LocalPlayer
8+
player = owner
9
chara = player.Character
10
debby = game.Debris
11-
Mouse = player:GetMouse()
11+
rs = game:GetService("RunService").Stepped
12-
rs = game:GetService("RunService").RenderStepped
12+
13
--Outfit--
14
New = function(Object, Parent, Name, Data)
15
	local Object = Instance.new(Object)
16
	for Index, Value in pairs(Data or {}) do
17
		Object[Index] = Value
18
	end
19
	Object.Parent = Parent
20
	Object.Name = Name
21
	return Object
22
end
23
24
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),})
25
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,})
26
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),})
27
28
--Sounds--
29
function LoadSnd(id,loop,vol,pit)
30
local snd = New("Sound",chara,"Sound",{SoundId = "rbxassetid://"..id,Looped = loop,Volume = vol,Pitch = pit})
31
return snd
32
end
33
DrinkSnd = LoadSnd(491214142,true,1,1)
34
StartUpSnd = LoadSnd(10721950,false,1,1)
35
SwingSnd = LoadSnd(158037267,false,1,1)
36
37
function CreateTrailObj(parent,color1,color2,ofsx,ofsz)
38
local Att1 =  New("Attachment",parent,"Att1",{Position = Vector3.new(ofsx,parent.Size.Y/2,ofsz)})
39
local Att2 =  New("Attachment",parent,"Att2",{Position = Vector3.new(ofsx,-(parent.Size.Y/2),ofsz)})
40
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})
41
return TEff
42
end
43
44
--Clerp Animations--
45
TC = chara.HumanoidRootPart.RootJoint
46
HC = chara.Torso.Neck
47
RAC = chara.Torso["Right Shoulder"]
48
LAC = chara.Torso["Left Shoulder"]
49
RLC = chara.Torso["Right Hip"]
50
LLC = chara.Torso["Left Hip"]
51
TCF = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
52
HCF = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
53
RACF = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
54
LACF = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
55
RLCF = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
56
LLCF = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
57
RWF = CFrame.new(-1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
58
LWF = CFrame.new(1.5, 0, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
59
RLWF = CFrame.new(-.5, 2, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
60
LLWF = CFrame.new(.5, 2, 0) * CFrame.fromEulerAnglesXYZ(0,0,0)
61
RW = Instance.new("Weld",HC.Parent)
62
RW.Part1 = HC.Parent
63
RW.Part0 = chara["Right Arm"]
64
RW.C0 = RWF
65
66
function clerp(a,b,c)
67
return a:lerp(b,c)
68
end
69
70
--TC.C0 = TCF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(90))
71
--HC.C0 = HCF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-50))
72
--RW.C0 = (RWF + Vector3.new(1,2,0)) * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-90))
73
--LW.C0 = LWF * CFrame.fromEulerAnglesXYZ(0,0,math.rad(2))
74
75
RW.C0 = RWF
76
77
--Idle Clerp--
78
IRWF = (RWF - Vector3.new(-.2,0,-.5)) * CFrame.fromEulerAnglesXYZ(math.rad(-90),math.rad(-20),0)
79
80
function res()
81
RW.C0 = IRWF
82
end
83
res()
84
85
--Mouse Functions--
86
dif = 0
87
function onKeyDown(key)
88
if key == "q" then
89
if dif == 0 then
90
CanMesh.TextureId = "http://www.roblox.com/asset/?id=25323705"
91
dif = 1
92
elseif dif == 1 then
93
CanMesh.TextureId = "http://www.roblox.com/asset/?id=11126634"
94
dif = 2
95
elseif dif == 2 then
96
CanMesh.TextureId = "http://www.roblox.com/asset/?id=25323909"
97
dif = 3
98
elseif dif == 3 then
99
CanMesh.TextureId = "http://www.roblox.com/asset/?id=24970071"
100
dif = 4
101
elseif dif == 4 then
102
CanMesh.TextureId = "http://www.roblox.com/asset/?id=16574454"
103
dif = 5
104
elseif dif == 5 then
105
CanMesh.TextureId = "http://www.roblox.com/asset/?id=24970256"
106
dif = 6
107
elseif dif == 6 then
108
CanMesh.TextureId = "http://www.roblox.com/asset/?id=10549894"
109
dif = 7
110
elseif dif == 7 then
111
CanMesh.TextureId = "http://www.roblox.com/asset/?id=15218018"
112
dif = 8
113
elseif dif == 8 then
114
CanMesh.TextureId = "http://www.roblox.com/asset/?id=28121842"
115
dif = 9
116
elseif dif == 9 then
117
CanMesh.TextureId = "http://www.roblox.com/asset/?id=24878483"
118
dif = 10
119
elseif dif == 10 then
120
CanMesh.TextureId = "http://www.roblox.com/asset/?id=10470600"
121
dif = 0
122
end
123
end
124
end
125
del = false
126
normalwel = Weld.C0
127
function onButton1Down()
128
if del == false then
129
del = true
130
for i = 0,1,.2 do
131
rs:wait()
132
RW.C0 = clerp(IRWF,(RWF - Vector3.new(-.3,.1,-.7)) * CFrame.fromEulerAnglesXYZ(math.rad(-110),math.rad(-70),math.rad(20)),i)
133
HC.C0 = clerp(HCF,HCF * CFrame.fromEulerAnglesXYZ(math.rad(-10),0,0),i)
134
end
135
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)
136
DrinkSnd:Play()
137
wait(2)
138
DrinkSnd:Stop()
139
Weld.C0 = normalwel
140
for i = 0,1,.2 do
141
rs:wait()
142
RW.C0 = clerp(IRWF,(RWF - Vector3.new(-.3,.1,-.7)) * CFrame.fromEulerAnglesXYZ(math.rad(-110),math.rad(-70),math.rad(20)),1-i)
143
HC.C0 = clerp(HCF,HCF * CFrame.fromEulerAnglesXYZ(math.rad(-10),0,0),1-i)
144
end
145
SwingSnd:Play()
146
for i = 0,1,.25 do
147
rs:wait()
148
RW.C0 = clerp(IRWF,(RWF - Vector3.new(0,-1,0)) * CFrame.fromEulerAnglesXYZ(math.rad(-190),0,0),i)
149
end
150
local fcan = Can:Clone()
151
fcan.Weld:Destroy()
152
fcan.Parent = workspace
153
fcan.Position = Can.Position
154
local bfos = Instance.new("BodyVelocity",fcan)
155
bfos.P = 1000
156
bfos.MaxForce = Vector3.new(1000,1000,1000)
157
bfos.Velocity = Vector3.new(0,10,0) + chara.Head.CFrame.lookVector*-30
158
debby:AddItem(bfos,.1)
159
coroutine.resume(coroutine.create(function()
160
wait(10)
161
for i = 0,1,.1 do
162
wait(.1)
163
fcan.Transparency = i
164
end
165
fcan:Destroy()
166
end))
167
Can.Transparency = 1
168
wait(1)
169
for i = 0,1,.2 do
170
rs:wait()
171
RW.C0 = clerp(RWF,(RWF - Vector3.new(0,-1,0)) * CFrame.fromEulerAnglesXYZ(math.rad(-190),0,0),1-i)
172
end
173
wait(1)
174
StartUpSnd:Play()
175
for i = 0,1,.1 do
176
wait(.1)
177
Can.Transparency = 1-i
178
end
179
for i = 0,1,.2 do
180
rs:wait()
181
RW.C0 = clerp(RWF,IRWF,i)
182
end
183
del = false
184
end
185
end
186
187
--Mouse Activation--
188
if Mouse then
189
Mouse.KeyDown:connect(onKeyDown)
190
Mouse.Button1Down:connect(onButton1Down)
191
end