View difference between Paste ID: Au0dUi8a and JbNw9Hb8
SHOW: | | - or go back to the newest paste.
1-
print("Do ya need a bleach?")
1+
--[[
2-
STOP = Instance.new("Sound", game.Players.LocalPlayer.Character.Head)
2+
3-
STOP.SoundId = "http://roblox.com/asset?id=356970690"
3+
preview ;)
4-
STOP.Looped = true
4+
5-
STOP:Play()
5+
]]
6-
STOP.Volume = 2
6+
7-
plr = game.Players.LocalPlayer
7+
CN, CA, V3, U2, C3, BN = CFrame.new, CFrame.Angles, Vector3.new, UDim2.new, Color3.new, BrickColor.new
8-
char = plr.Character
8+
function new(instanceType, parent)
9-
mouse = plr:GetMouse()
9+
        return function(configuration)
10-
local cough = Instance.new("Sound", workspace)
10+
                local newInstance = Instance.new(instanceType, parent)
11-
cough.SoundId = "http://roblox.com/asset?id=178522287"
11+
                if newInstance:IsA("BasePart") then
12-
Bleach = Instance.new("Part", char["Left Arm"])
12+
                        newInstance.TopSurface = 0
13-
Bleach.CanCollide = false
13+
                        newInstance.BottomSurface = 0
14-
Mesh = Instance.new("SpecialMesh", Bleach)
14+
                        if not newInstance:IsA("CornerWedgePart") then
15-
Mesh.MeshId = "http://roblox.com/asset?id=483388971"
15+
                                newInstance.FormFactor = 3
16-
Mesh.Scale = Vector3.new(0.005, 0.005, 0.005)
16+
                        end
17-
Mesh.TextureId = "http://roblox.com/asset?id=520016684"
17+
                        newInstance.Material = "Granite"
18-
Handy = Instance.new("Weld", Bleach)
18+
                        newInstance.BrickColor = BN("Medium stone grey")
19-
Handy.Part0 = Bleach
19+
                        newInstance.Locked = true
20-
Handy.Part1 = char["Left Arm"]
20+
                end
21-
Handy.C0 = CFrame.new(0.5,1.8,0)
21+
                for property, value in pairs(configuration) do
22-
Handy.C1 = CFrame.Angles(0,4,1)
22+
                        if type(value) == "function" then
23-
drink = Instance.new("Sound", char.Head)
23+
                                newInstance[property]:connect(value)
24-
drink.SoundId = "http://roblox.com/asset?id=10722059"
24+
                        else
25-
function cringe(key)
25+
                                newInstance[property] = value
26-
	key = key:lower()
26+
                        end
27-
	if key == "q" then
27+
                end
28-
		game.Chat:Chat(char.Head,"This is too cringe","Blue")
28+
                if configuration["CFrame"] then
29-
		wait(2)
29+
                        newInstance.CFrame = configuration["CFrame"]
30-
		game.Chat:Chat(char.Head,"This needs to stop, now","Red")
30+
                end
31-
		wait(2)
31+
                return newInstance
32-
		game.Chat:Chat(char.Head,"This is cancer.","Red")
32+
        end
33-
		wait(2)
33+
34-
		game.Chat:Chat(char.Head,"This is too strong","Red")
34+
function QuaternionFromCFrame(cf)
35-
		wait(2)
35+
        local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() 
36-
		game.Chat:Chat(char.Head,"I need to die","Red")
36+
        local trace = m00+m11+m22 
37-
		for i = 1,10 do
37+
        if trace > 0 then 
38-
			wait()
38+
                local s = math.sqrt(1+trace) 
39-
			char.HumanoidRootPart.RootJoint.C0 = char.HumanoidRootPart.RootJoint.C0 * CFrame.Angles(-0.018,0,0)
39+
                local recip = 0.5/s 
40-
			Handy.C0 = Handy.C0 * CFrame.new(-0.05,-0.07,0.09)
40+
                return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5 
41-
			Handy.C0 = Handy.C0 * CFrame.Angles(0.12,0,0)
41+
        else 
42-
			char.Torso["Left Shoulder"].C0 = char.Torso["Left Shoulder"].C0 * CFrame.Angles(0.2,0,-0.1)
42+
                local i = 0 
43-
		end
43+
                if m11 > m00 then 
44-
                STOP.Volume = 0
44+
                        i = 1 
45-
		drink:Play()
45+
                end 
46-
		for i = 1,50 do
46+
                if m22 > (i == 0 and m00 or m11) then 
47-
			wait()
47+
                        i = 2 
48-
			char.Humanoid.Health = char.Humanoid.Health - 1
48+
                end 
49-
		end
49+
                if i == 0 then 
50-
		char.Humanoid.WalkSpeed = 0
50+
                        local s = math.sqrt(m00-m11-m22+1) 
51-
		wait(2)
51+
                        local recip = 0.5/s 
52-
		for i = 1,10 do
52+
                        return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip 
53-
			wait()
53+
                elseif i == 1 then 
54-
			char.HumanoidRootPart.RootJoint.C0 = char.HumanoidRootPart.RootJoint.C0 * CFrame.Angles(0.018,0,0)
54+
                        local s = math.sqrt(m11-m22-m00+1) 
55-
			Handy.C0 = Handy.C0 * CFrame.new(0.05,0.07,-0.09)
55+
                        local recip = 0.5/s 
56-
			Handy.C0 = Handy.C0 * CFrame.Angles(-0.12,0,0)
56+
                        return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip 
57-
			char.Torso["Left Shoulder"].C0 = char.Torso["Left Shoulder"].C0 * CFrame.Angles(-0.2,0,0.1)
57+
                elseif i == 2 then 
58-
		end
58+
                        local s = math.sqrt(m22-m00-m11+1) 
59-
		char.Humanoid.WalkSpeed = 6
59+
                        local recip = 0.5/s 
60-
		cough:Play()
60+
                        return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip 
61-
		for i = 1,100 do
61+
                end 
62-
			wait(0.05)
62+
        end 
63-
			char.Humanoid.Health = char.Humanoid.Health - 1
63+
64-
		end
64+
function QuaternionToCFrame(px, py, pz, x, y, z, w)
65-
		end
65+
        local xs, ys, zs = x+x, y+y, z+z
66
        local wx, wy, wz = w*xs, w*ys, w*zs
67-
function kys()
67+
        local xx = x*xs
68-
	        cough:destroy()
68+
        local xy = x*ys
69-
			local ded = Instance.new("Sound", char.Head)
69+
        local xz = x*zs
70-
			ded.SoundId = "http://roblox.com/asset?id=393884633"
70+
        local yy = y*ys
71-
			ded:Play()
71+
        local yz = y*zs
72-
			end
72+
        local zz = z*zs
73-
mouse.KeyDown:connect(cringe)
73+
        return CFrame.new(px, py, pz, 1-(yy+zz), xy-wz, xz+wy, xy+wz, 1-(xx+zz), yz-wx, xz-wy, yz+wx, 1-(xx+yy))
74-
char.Humanoid.Died:connect(kys)
74+
75
function QuaternionSlerp(a, b, t)
76
        local cosTheta = a[1]*b[1]+a[2]*b[2]+a[3]*b[3]+a[4]*b[4]
77
        local startInterp, finishInterp;
78
        if cosTheta >= 0.0001 then
79
                if (1-cosTheta) > 0.0001 then
80
                        local theta = math.acos(cosTheta)
81
                        local invSinTheta = 1/math.sin(theta)
82
                        startInterp = math.sin((1-t)*theta)*invSinTheta
83
                        finishInterp = math.sin(t*theta)*invSinTheta
84
                else
85
                        startInterp = 1-t
86
                        finishInterp = t
87
                end
88
        else
89
                if (1+cosTheta) > 0.0001 then
90
                        local theta = math.acos(-cosTheta)
91
                        local invSinTheta = 1/math.sin(theta)
92
                        startInterp = math.sin((t-1)*theta)*invSinTheta
93
                        finishInterp = math.sin(t*theta)*invSinTheta
94
                else
95
                        startInterp = t-1
96
                        finishInterp = t
97
                end
98
        end
99
        return a[1]*startInterp+b[1]*finishInterp, a[2]*startInterp+b[2]*finishInterp, a[3]*startInterp+b[3]*finishInterp, a[4]*startInterp+b[4]*finishInterp
100
end
101
function Lerp(a, b, t)
102
        local qa = {QuaternionFromCFrame(a)}
103
        local qb = {QuaternionFromCFrame(b)}
104
        local ax, ay, az = a.x, a.y, a.z
105
        local bx, by, bz = b.x, b.y, b.z
106
        local _t = 1-t
107
        return QuaternionToCFrame(_t*ax+t*bx, _t*ay+t*by, _t*az+t*bz, QuaternionSlerp(qa, qb, t))
108
end
109
 
110
for _, Obj in pairs(Workspace:GetChildren()) do
111
        if Obj.Name == "Awesome scary spider" then
112
                Obj:Destroy()
113
        end
114
end
115
 
116
Offset = V3(25, -0.9, 25)
117
SpiderColor = "Maroon"
118
 
119
Spider = new("Model", game.Players.LocalPlayer.Character){Name = "Awesome scary spider"}
120
Platform = new("Part", Spider){Size = V3(30, 1, 30), BrickColor = BN("Really red"), Transparency = 1, CanCollide = true}
121
 
122
Torso = new("Part", Spider){Size = V3(4, 4, 6), Name = "Torso", BrickColor = BN(SpiderColor), Transparency = 1}
123
new("BlockMesh", Torso){Scale = V3(1, 1, 1)}
124
new("Motor6D", Platform){Part0 = Platform, Part1 = Torso, C0 = CN(0, 5, 0)}
125
TorsoA = new("Part", Spider){Size = V3(4, 5, 3), BrickColor = BN(SpiderColor)}
126
new("SpecialMesh", TorsoA){MeshType = "Sphere", Scale = V3(1.5, 1.5, 1.5)}
127
new("Motor6D", Torso){Part0 = Torso, Part1 = TorsoA, C0 = CA(math.rad(90), 0, 0)}
128
 
129
Head = new("Part", Spider){Size = V3(2, 2, 2), Name = "Head", BrickColor = BN(SpiderColor), Transparency = 1}
130
new("SpecialMesh", Head){MeshType = "Sphere", Scale = V3(1.5, 1.5, 1.5)}
131
Neck = new("Motor6D", Torso){Part0 = Torso, Part1 = Head, C0 = CN(0, 0, -4), Name = "Neck"}
132
 
133
FakeHead = new("Part", Spider){Size = V3(2, 2, 2), BrickColor = BN(SpiderColor)}
134
new("SpecialMesh", FakeHead){MeshType = "Sphere", Scale = V3(1.5, 1.5, 1.5)}
135
new("Motor6D", Head){Part0 = Head, Part1 = FakeHead, C0 = CN()}
136
 
137
RightEye = new("Part", Spider){Size = V3(0.5, 0.5, 0.5), BrickColor = BN("White")}
138
new("SpecialMesh", RightEye){MeshType = "Sphere", Scale = V3(1, 1, 1)}
139
new("Motor6D", Head){Part0 = Head, Part1 = RightEye, C0 = CN(0.5, 0.25, -1.25)}
140
 
141
LeftEye = new("Part", Spider){Size = V3(0.5, 0.5, 0.5), BrickColor = BN("White")}
142
new("SpecialMesh", LeftEye){MeshType = "Sphere", Scale = V3(1, 1, 1)}
143
new("Motor6D", Head){Part0 = Head, Part1 = LeftEye, C0 = CN(-0.5, 0.25, -1.25)}
144
 
145
Torso2 = new("Part", Spider){Size = V3(5.5, 4.3, 7), BrickColor = BN(SpiderColor)}
146
new("Motor6D", Torso){Part0 = Torso, Part1 = Torso2, C0 = CN(0, 0, 7)}
147
new("SpecialMesh", Torso2){MeshType = "Sphere", Scale = V3(1.5, 1.5, 1.5)}
148
 
149
RightLegs = {}
150
LeftLegs = {}
151
 
152
for L = 1, 4 do
153
        local RightLeg = new("Part", Spider){Size = V3(1, 5, 1), BrickColor = BN(SpiderColor)}
154
        new("CylinderMesh", RightLeg){Scale = V3(1, 1, 1)}
155
        new("Motor6D", RightLeg){Part0 = Torso, Part1 = RightLeg, C0 = CN(1.5, -1.5, -2+L)*CA(0, math.rad(45-L*15), math.rad(-60))*CN(0, 2.5, 0)}
156
        local RightLeg2 = new("Part", Spider){Size = V3(0.8, 5, 0.8), BrickColor = BN(SpiderColor)}
157
        new("CylinderMesh", RightLeg2){Scale = V3(1, 1, 1)}
158
        new("Motor6D", RightLeg2){Part0 = RightLeg, Part1 = RightLeg2, C0 = CN(0, 2.1, 0)*CA(0, 0, math.rad(-45))*CN(0, 2.5, 0)}
159
        local RightLeg3 = new("Part", Spider){Size = V3(0.6, 5, 0.6), BrickColor = BN(SpiderColor)}
160
        new("CylinderMesh", RightLeg3){Scale = V3(1, 1, 1)}
161
        new("Motor6D", RightLeg3){Part0 = RightLeg2, Part1 = RightLeg3, C0 = CN(0, 2.2, 0)*CA(0, 0, math.rad(-75))*CN(0, 2.5, 0)}
162
        table.insert(RightLegs, {RightLeg, RightLeg2, RightLeg3})
163
        
164
        local LeftLeg = new("Part", Spider){Size = V3(1, 5, 1), BrickColor = BN(SpiderColor)}
165
        new("CylinderMesh", LeftLeg){Scale = V3(1, 1, 1)}
166
        new("Motor6D", LeftLeg){Part0 = Torso, Part1 = LeftLeg, C0 = CN(-1.5, -1.5, -2+L)*CA(0, math.rad(-45+L*15), math.rad(60))*CN(0, 2.5, 0)}
167
        local LeftLeg2 = new("Part", Spider){Size = V3(0.8, 5, 0.8), BrickColor = BN(SpiderColor)}
168
        new("CylinderMesh", LeftLeg2){Scale = V3(1, 1, 1)}
169
        new("Motor6D", LeftLeg2){Part0 = LeftLeg, Part1 = LeftLeg2, C0 = CN(0, 2.1, 0)*CA(0, 0, math.rad(45))*CN(0, 2.5, 0)}
170
        local LeftLeg3 = new("Part", Spider){Size = V3(0.6, 5, 0.6), BrickColor = BN(SpiderColor)}
171
        new("CylinderMesh", LeftLeg3){Scale = V3(1, 1, 1)}
172
        new("Motor6D", LeftLeg3){Part0 = LeftLeg2, Part1 = LeftLeg3, C0 = CN(0, 2.2, 0)*CA(0, 0, math.rad(75))*CN(0, 2.5, 0)}
173
        table.insert(LeftLegs, {LeftLeg, LeftLeg2, LeftLeg3})
174
end
175
 
176
SpiderHumanoid = new("Humanoid", Spider){WalkSpeed = 30}
177
Spider:MakeJoints()
178
Platform.CFrame = CN(Offset)
179
 
180
SpiderVelocity = new("BodyVelocity", Platform){maxForce = V3(1/0, 1/0, 1/0)}
181
SpiderGyro = new("BodyGyro", Platform){maxTorque = V3(1/0, 1/0, 1/0), P = 1000, D = 100}
182
 
183
--Now, on to the fun stuffs..
184
 
185
Player = Game:GetService("Players").LocalPlayer
186
Mouse = Player:GetMouse()
187
UserInputService = Game:GetService("UserInputService")
188
Camera = Workspace.CurrentCamera
189
 
190
--Camera.CameraType = "Scriptable"
191
 
192
Character = Player.Character
193
Character:WaitForChild("Animate"):Destroy()
194
CharacterHumanoid, CharacterTorso = Character:WaitForChild("Humanoid"), Character:WaitForChild("Torso")
195
CharacterHumanoid.PlatformStand = true
196
CharacterHumanoid.Changed:connect(function()
197
        CharacterHumanoid.PlatformStand = true
198
        CharacterHumanoid.Jump = false
199
end)
200
new("Motor6D", Torso){Part0 = Torso, Part1 = CharacterTorso, C0 = CN(0, 5, 0)}
201
 
202
Chatting = false
203
Moving = false
204
MaxSpeed = 30
205
Acceleration = 1
206
Deceleration = 1
207
SpeedW = 0
208
SpeedA = 0
209
SpeedS = 0
210
SpeedD = 0
211
Velocity = V3()
212
CameraAngleX, CameraAngleY = 45, 45
213
Dragging = false
214
Keys = {}
215
 
216
UserInputService.InputBegan:connect(function(Input)
217
        local Key, InputType, Delta = Input.KeyCode.Name, Input.UserInputType.Name, Input.Delta
218
        if Key == "Slash" and not Chatting then
219
                Chatting = true
220
                Keys = {}
221
        elseif Key == "Return" and Chatting then
222
                Chatting = false
223
        elseif (Key == "W" or Key == "A" or Key == "S" or Key == "D") and not Chatting then
224
                Keys[Key] = true
225
        end
226
       --[[ if InputType == "MouseButton2" then
227
                Dragging = true
228
                UserInputService.MouseBehavior = "LockCurrentPosition"
229
        end]]
230
end)
231
 
232
--[[UserInputService.InputChanged:connect(function(Input)
233
        local Key, InputType, Delta, Position = Input.KeyCode.Name, Input.UserInputType.Name, Input.Delta, Input.Position
234
        if InputType == "MouseMovement" and Dragging then
235
                CameraAngleX = CameraAngleX+Delta.Y*0.2
236
                if CameraAngleX > 80 then
237
                        CameraAngleX = 80
238
                elseif CameraAngleX < -80 then
239
                        CameraAngleX = -80
240
                end
241
                CameraAngleY = CameraAngleY-Delta.X*0.2
242
        end
243
end)]]
244
 
245
UserInputService.InputEnded:connect(function(Input)
246
        local Key, InputType, Delta = Input.KeyCode.Name, Input.UserInputType.Name, Input.Delta
247
        if (Key == "W" or Key == "A" or Key == "S" or Key == "D") and not Chatting then
248
                Keys[Key] = nil
249
        end
250
        if InputType == "MouseButton2" then
251
                Dragging = false
252
                UserInputService.MouseBehavior = "Default"
253
        end
254
end)
255
 
256
function UpdateVelocity()
257
        if Keys["W"] then
258
                if SpeedW < MaxSpeed then
259
                        SpeedW = SpeedW+Acceleration
260
                else
261
                        SpeedW = MaxSpeed
262
                end
263
        else
264
                if SpeedW > 0 then
265
                        SpeedW = SpeedW-Deceleration
266
                else
267
                        SpeedW = 0
268
                end
269
        end
270
        if Keys["A"] then
271
                if SpeedA < MaxSpeed then
272
                        SpeedA = SpeedA+Acceleration
273
                else
274
                        SpeedA = MaxSpeed
275
                end
276
        else
277
                if SpeedA > 0 then
278
                        SpeedA = SpeedA-Deceleration
279
                else
280
                        SpeedA = 0
281
                end
282
        end
283
        if Keys["S"] then
284
                if SpeedS < MaxSpeed then
285
                        SpeedS = SpeedS+Acceleration
286
                else
287
                        SpeedS = MaxSpeed
288
                end
289
        else
290
                if SpeedS > 0 then
291
                        SpeedS = SpeedS-Deceleration
292
                else
293
                        SpeedS = 0
294
                end
295
        end
296
        if Keys["D"] then
297
                if SpeedD < MaxSpeed then
298
                        SpeedD = SpeedD+Acceleration
299
                else
300
                        SpeedD = MaxSpeed
301
                end
302
        else
303
                if SpeedD > 0 then
304
                        SpeedD = SpeedD-Deceleration
305
                else
306
                        SpeedD = 0
307
                end
308
        end
309
        Velocity = V3(SpeedD-SpeedA, 0, SpeedS-SpeedW)
310
end
311
 
312
Game:GetService("RunService").Stepped:connect(function(Time)
313
        --Animation
314
        if Moving then
315
                for L, Leg in pairs(RightLegs) do
316
                        local RightLeg1 = Leg[1]
317
                        local RightLeg2 = Leg[2]
318
                        local RightLeg3 = Leg[3]
319
                        
320
                        local LeftLeg1 = LeftLegs[L][1]
321
                        local LeftLeg2 = LeftLegs[L][2]
322
                        local LeftLeg3 = LeftLegs[L][3]
323
                        
324
                        local Mult = 1-L%2*2
325
                        
326
                        --C0 = CN(-1.5, -1.5, -2+L)*CA(0, math.rad(-45+L*15), math.rad(45))*CN(0, 2.5, 0)
327
                        --C0 = CN(0, 2.1, 0)*CA(0, 0, math.rad(60))*CN(0, 2.5, 0)
328
                        --C0 = CN(0, 2.2, 0)*CA(0, 0, math.rad(60))*CN(0, 2.5, 0)
329
                        
330
                        RightLeg1.Motor6D.C0 = Lerp(RightLeg1.Motor6D.C0, CN(1.5, -1.5, -2+L)*CA(0, math.rad(45-L*15+math.sin(Time*20)*Mult*30), math.rad(-45+math.sin(Time*20)*Mult*30))*CN(0, 2.5, 0), 0.1)
331
                        LeftLeg1.Motor6D.C0 = Lerp(LeftLeg1.Motor6D.C0, CN(-1.5, -1.5, -2+L)*CA(0, math.rad(-45+L*15+math.sin(Time*20)*Mult*-30), math.rad(45+math.sin(Time*20)*Mult*-30))*CN(0, 2.5, 0), 0.1)
332
                end
333
        else
334
                for L, Leg in pairs(RightLegs) do
335
                        local RightLeg1 = Leg[1]
336
                        local RightLeg2 = Leg[2]
337
                        local RightLeg3 = Leg[3]
338
                        
339
                        local LeftLeg1 = LeftLegs[L][1]
340
                        local LeftLeg2 = LeftLegs[L][2]
341
                        local LeftLeg3 = LeftLegs[L][3]
342
                        
343
                        local Mult = 1-L%2*2
344
                        
345
                        --C0 = CN(-1.5, -1.5, -2+L)*CA(0, math.rad(-45+L*15), math.rad(45))*CN(0, 2.5, 0)
346
                        --C0 = CN(0, 2.1, 0)*CA(0, 0, math.rad(60))*CN(0, 2.5, 0)
347
                        --C0 = CN(0, 2.2, 0)*CA(0, 0, math.rad(60))*CN(0, 2.5, 0)
348
                        
349
                        RightLeg1.Motor6D.C0 = Lerp(RightLeg1.Motor6D.C0, CN(1.5, -1.5, -2+L)*CA(0, math.rad(45-L*15), math.rad(-45))*CN(0, 2.5, 0), 0.25)
350
                        LeftLeg1.Motor6D.C0 = Lerp(LeftLeg1.Motor6D.C0, CN(-1.5, -1.5, -2+L)*CA(0, math.rad(-45+L*15), math.rad(45))*CN(0, 2.5, 0), 0.25)
351
                end
352
        end
353
end)
354
Game:GetService("RunService").RenderStepped:connect(function()
355
        UpdateVelocity()
356
        if math.abs(SpiderVelocity.velocity.X) > 0 or math.abs(SpiderVelocity.velocity.Z) > 0 then
357
                Moving = true
358
        else
359
                Moving = false
360
        end
361
        local CoordinateFrame2D = CN(V3(Camera.CoordinateFrame.X, Platform.CFrame.Y, Camera.CoordinateFrame.Z), Platform.Position)
362
        local RelativeVelocity = CoordinateFrame2D*Velocity-CoordinateFrame2D.p
363
        SpiderVelocity.velocity = RelativeVelocity
364
        SpiderGyro.cframe = CN(CoordinateFrame2D.p, Platform.Position)
365
        
366
       --Camera:Interpolate(CN(Torso.Position)*CA(0, math.rad(CameraAngleY), 0)*CA(math.rad(CameraAngleX), 0, 0)*CN(0, 0, -20), Torso.CFrame, 0.01)
367
end)