SHOW:
|
|
- or go back to the newest paste.
1 | -- ShalloKoolAidDerpo script | |
2 | ||
3 | -- Written by yeox769 | |
4 | ||
5 | -- Commissioner: ShallowDerppoo | |
6 | ||
7 | wait(0.5) | |
8 | player = game.Players.LocalPlayer | |
9 | char = player.Character | |
10 | hmnd = char.Humanoid | |
11 | larm = char["Left Arm"] | |
12 | rarm = char["Right Arm"] | |
13 | lleg = char["Left Leg"] | |
14 | rleg = char["Right Leg"] | |
15 | torso = char.Torso | |
16 | mouse = player:GetMouse() | |
17 | lght = game.Lighting | |
18 | bdclr = char["Body Colors"] | |
19 | Neck = torso.Neck | |
20 | ||
21 | cooldownOver = true | |
22 | ||
23 | -- More variables, just in case. | |
24 | Player=game:GetService("Players").LocalPlayer | |
25 | Character=Player.Character | |
26 | PlayerGui=Player.PlayerGui | |
27 | Backpack=Player.Backpack | |
28 | Mouse = Player:GetMouse() | |
29 | Torso=Character.Torso | |
30 | Head=Character.Head | |
31 | Humanoid=Character.Humanoid | |
32 | m=Instance.new('Model',Character) | |
33 | LeftArm=Character["Left Arm"] | |
34 | LeftLeg=Character["Left Leg"] | |
35 | RightArm=Character["Right Arm"] | |
36 | RightLeg=Character["Right Leg"] | |
37 | LS=Torso["Left Shoulder"] | |
38 | LH=Torso["Left Hip"] | |
39 | RS=Torso["Right Shoulder"] | |
40 | RH=Torso["Right Hip"] | |
41 | Face = Head.face | |
42 | Neck=Torso.Neck | |
43 | it=Instance.new | |
44 | attacktype=1 | |
45 | vt=Vector3.new | |
46 | cf=CFrame.new | |
47 | euler=CFrame.fromEulerAnglesXYZ | |
48 | angles=CFrame.Angles | |
49 | cloaked=false | |
50 | necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
51 | necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
52 | LHC0=cf(-1,-1,0,-0,-0,-1,0,1,0,1,0,0) | |
53 | LHC1=cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0) | |
54 | RHC0=cf(1,-1,0,0,0,1,0,1,0,-1,-0,-0) | |
55 | RHC1=cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0) | |
56 | RootPart=Character.HumanoidRootPart | |
57 | RootJoint=RootPart.RootJoint | |
58 | RootCF=euler(-1.57,0,3.14) | |
59 | attack = false | |
60 | attackdebounce = false | |
61 | deb=false | |
62 | equipped=true | |
63 | hand=false | |
64 | MMouse=nil | |
65 | combo=0 | |
66 | mana=0 | |
67 | trispeed=.2 | |
68 | attackmode='none' | |
69 | local idle=0 | |
70 | local Anim="Idle" | |
71 | local Effects={} | |
72 | local gun=false | |
73 | local shoot=false | |
74 | player=nil | |
75 | mana=0 | |
76 | ||
77 | Humanoid.JumpPower, Humanoid.WalkSpeed = 123.4, 56.789 | |
78 | it = Instance.new | |
79 | ||
80 | -- Music -- | |
81 | z = it("Sound",char) | |
82 | z.Looped = true | |
83 | - | z.SoundId = "rbxassetid://261563227" |
83 | + | z.SoundId = "rbxassetid://291394633" |
84 | z.Volume = 1 | |
85 | z:Play() | |
86 | themeBegan = false | |
87 | ||
88 | -- Functions -- | |
89 | ||
90 | local inv = function() | |
91 | while true do | |
92 | wait() | |
93 | hmnd.MaxHealth = math.huge | |
94 | hmnd.Health = math.huge | |
95 | if char:FindFirstChild("ForceField") == nil then | |
96 | ff = it("ForceField",char) | |
97 | ff.Visible = false | |
98 | end | |
99 | end | |
100 | end | |
101 | ||
102 | delay(0,inv) | |
103 | ||
104 | local part = function(name,parent,brkclr,mtrl,rfl,trns,sz) | |
105 | prt = it("Part",parent) | |
106 | prt.Name = name | |
107 | prt.CanCollide = false | |
108 | prt.BrickColor = BrickColor.new(brkclr) | |
109 | prt.Material = mtrl | |
110 | prt.Reflectance = rfl | |
111 | prt.Transparency = trns | |
112 | prt.Size = sz | |
113 | prt.Anchored = true | |
114 | return prt | |
115 | end | |
116 | local part2 = function(name,parent,brkclr,mtrl,rfl,trns,sz) | |
117 | prt2 = it("Part",parent) | |
118 | prt2.Name = name | |
119 | prt2.CanCollide = false | |
120 | prt2.BrickColor = BrickColor.new(brkclr) | |
121 | prt2.Material = mtrl | |
122 | prt2.Reflectance = rfl | |
123 | prt2.Transparency = trns | |
124 | prt2.Size = sz | |
125 | prt2.Anchored = false | |
126 | game.Debris:AddItem(prt2, 10) | |
127 | return prt2 | |
128 | end | |
129 | local mesh = function(meshtype,parent,meshid,textureid,scale) | |
130 | msh = it("SpecialMesh",parent) | |
131 | if meshtype == "FileMesh" then | |
132 | msh.MeshId = meshid | |
133 | msh.TextureId = textureid | |
134 | end | |
135 | msh.MeshType = meshtype | |
136 | msh.Scale = scale | |
137 | return(msh) | |
138 | end | |
139 | local weld = function(part1,part2,x1,y1,z1,x2,y2,z2) | |
140 | w = it("Weld",part1) | |
141 | w.Part0 = part1 | |
142 | w.Part1 = part2 | |
143 | if part1.Anchored or part2.Anchored then | |
144 | part1.Anchored = false | |
145 | part2.Anchored = false | |
146 | end | |
147 | w.C0 = (CFrame.new(x1,y1,z1)*CFrame.Angles(math.rad(z2),math.rad(y2),math.rad(x2))) | |
148 | return(w) | |
149 | end | |
150 | local emit = function(parent,tex,startcolor, endcolor, startsize,endsize,lightem,emdir,lif,rate,speed,rotspeed,sprdang) | |
151 | emm = it("ParticleEmitter",parent) | |
152 | emm.Texture = tex | |
153 | emm.Color = ColorSequence.new({ColorSequenceKeypoint.new(0,startcolor),ColorSequenceKeypoint.new(1,endcolor)}) | |
154 | emm.Size = NumberSequence.new({NumberSequenceKeypoint.new(0,startsize),NumberSequenceKeypoint.new(1,endsize)}) | |
155 | emm.LightEmission = lightem | |
156 | emm.EmissionDirection = emdir | |
157 | emm.Lifetime = NumberRange.new(lif) | |
158 | emm.Rate = rate | |
159 | emm.Speed = NumberRange.new(speed) | |
160 | emm.RotSpeed = NumberRange.new(rotspeed) | |
161 | emm.SpreadAngle = Vector2.new(sprdang,sprdang) | |
162 | end | |
163 | function cooldown() | |
164 | wait(5) | |
165 | cooldownOver = true | |
166 | end | |
167 | ||
168 | function clerp(a,b,t) | |
169 | local qa = {QuaternionFromCFrame(a)} | |
170 | local qb = {QuaternionFromCFrame(b)} | |
171 | local ax, ay, az = a.x, a.y, a.z | |
172 | local bx, by, bz = b.x, b.y, b.z | |
173 | local _t = 1-t | |
174 | return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t)) | |
175 | end | |
176 | ||
177 | function QuaternionFromCFrame(cf) | |
178 | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() | |
179 | local trace = m00 + m11 + m22 | |
180 | if trace > 0 then | |
181 | local s = math.sqrt(1 + trace) | |
182 | local recip = 0.5/s | |
183 | return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5 | |
184 | else | |
185 | local i = 0 | |
186 | if m11 > m00 then | |
187 | i = 1 | |
188 | end | |
189 | if m22 > (i == 0 and m00 or m11) then | |
190 | i = 2 | |
191 | end | |
192 | if i == 0 then | |
193 | local s = math.sqrt(m00-m11-m22+1) | |
194 | local recip = 0.5/s | |
195 | return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip | |
196 | elseif i == 1 then | |
197 | local s = math.sqrt(m11-m22-m00+1) | |
198 | local recip = 0.5/s | |
199 | return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip | |
200 | elseif i == 2 then | |
201 | local s = math.sqrt(m22-m00-m11+1) | |
202 | local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip | |
203 | end | |
204 | end | |
205 | end | |
206 | ||
207 | function QuaternionToCFrame(px, py, pz, x, y, z, w) | |
208 | local xs, ys, zs = x + x, y + y, z + z | |
209 | local wx, wy, wz = w*xs, w*ys, w*zs | |
210 | local xx = x*xs | |
211 | local xy = x*ys | |
212 | local xz = x*zs | |
213 | local yy = y*ys | |
214 | local yz = y*zs | |
215 | local zz = z*zs | |
216 | 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)) | |
217 | end | |
218 | ||
219 | function QuaternionSlerp(a, b, t) | |
220 | local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4] | |
221 | local startInterp, finishInterp; | |
222 | if cosTheta >= 0.0001 then | |
223 | if (1 - cosTheta) > 0.0001 then | |
224 | local theta = math.acos(cosTheta) | |
225 | local invSinTheta = 1/math.sin(theta) | |
226 | startInterp = math.sin((1-t)*theta)*invSinTheta | |
227 | finishInterp = math.sin(t*theta)*invSinTheta | |
228 | else | |
229 | startInterp = 1-t | |
230 | finishInterp = t | |
231 | end | |
232 | else | |
233 | if (1+cosTheta) > 0.0001 then | |
234 | local theta = math.acos(-cosTheta) | |
235 | local invSinTheta = 1/math.sin(theta) | |
236 | startInterp = math.sin((t-1)*theta)*invSinTheta | |
237 | finishInterp = math.sin(t*theta)*invSinTheta | |
238 | else | |
239 | startInterp = t-1 | |
240 | finishInterp = t | |
241 | end | |
242 | end | |
243 | 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 | |
244 | end | |
245 | ||
246 | local sine = 0 | |
247 | local change = 1 | |
248 | local val = 0 | |
249 | ||
250 | mouse=Player:GetMouse() | |
251 | RSH, LSH=nil, nil | |
252 | --welds | |
253 | RW, LW=Instance.new("Weld"), Instance.new("Weld") | |
254 | RW.Name="Right Shoulder" LW.Name="Left Shoulder" | |
255 | LH=Torso["Left Hip"] | |
256 | RH=Torso["Right Hip"] | |
257 | TorsoColor=Torso.BrickColor | |
258 | function NoOutline(Part) | |
259 | Part.TopSurface,Part.BottomSurface,Part.LeftSurface,Part.RightSurface,Part.FrontSurface,Part.BackSurface = 10,10,10,10,10,10 | |
260 | end | |
261 | player=Player | |
262 | ch=Character | |
263 | RSH=ch.Torso["Right Shoulder"] | |
264 | LSH=ch.Torso["Left Shoulder"] | |
265 | -- | |
266 | RSH.Parent=nil | |
267 | LSH.Parent=nil | |
268 | -- | |
269 | RW.Name="Right Shoulder" | |
270 | RW.Part0=ch.Torso | |
271 | RW.C0=cf(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5) | |
272 | RW.C1=cf(0, 0.5, 0) | |
273 | RW.Part1=ch["Right Arm"] | |
274 | RW.Parent=ch.Torso | |
275 | -- | |
276 | LW.Name="Left Shoulder" | |
277 | LW.Part0=ch.Torso | |
278 | LW.C0=cf(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8) | |
279 | LW.C1=cf(0, 0.5, 0) | |
280 | LW.Part1=ch["Left Arm"] | |
281 | LW.Parent=ch.Torso | |
282 | ||
283 | function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants | |
284 | return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore) | |
285 | end | |
286 | ||
287 | -- Character Model -- | |
288 | ||
289 | for i,v in pairs(Character:children()) do | |
290 | if v:IsA("Accessory") or v:IsA("Shirt") or v:IsA("Pants") then | |
291 | v:Destroy() | |
292 | end | |
293 | end | |
294 | Head.face:Destroy() | |
295 | faic = it("Decal", Torso) | |
296 | faic.Texture = "rbxassetid://296092023" | |
297 | char["Body Colors"].HeadColor, char["Body Colors"].LeftArmColor, char["Body Colors"].LeftLegColor, char["Body Colors"].RightArmColor, char["Body Colors"].RightLegColor, char["Body Colors"].TorsoColor = BrickColor.new("Really red"), BrickColor.new("Really red"), BrickColor.new("Really red"), BrickColor.new("Really red"), BrickColor.new("Really red"), BrickColor.new("Really red") | |
298 | Head.Transparency = 99999/100000 | |
299 | ||
300 | -- Animations -- | |
301 | ||
302 | function Animate() | |
303 | while true do | |
304 | wait() | |
305 | sine = sine + change | |
306 | local torvel=(RootPart.Velocity*Vector3.new(1,0,1)).magnitude | |
307 | local velderp=RootPart.Velocity.y | |
308 | hitfloor,posfloor=rayCast(RootPart.Position,(CFrame.new(RootPart.Position,RootPart.Position - Vector3.new(0,1,0))).lookVector,4,Character) | |
309 | if equipped==true or equipped==false then | |
310 | if attack==false then | |
311 | idle=idle+1 | |
312 | else | |
313 | idle=0 | |
314 | end | |
315 | if idle>=500 then | |
316 | if attack==false then | |
317 | --Sheath() | |
318 | end | |
319 | end | |
320 | if RootPart.Velocity.y > 1 and hitfloor==nil then | |
321 | Anim="Jump" | |
322 | if attack==false then | |
323 | RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(-10),math.rad(0),math.rad(0)),.3) | |
324 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(10),math.rad(0),math.rad(0)),.3) | |
325 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(math.rad(50),math.rad(0),math.rad(15)),.3) | |
326 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(math.rad(50),math.rad(0),math.rad(-15)),.3) | |
327 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0)),.3) | |
328 | end | |
329 | elseif RootPart.Velocity.y < -1 and hitfloor==nil then | |
330 | Anim="Fall" | |
331 | if attack==false then | |
332 | RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(180),math.rad(0),math.rad(0)),.3) | |
333 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(-10),math.rad(0),math.rad(0)),.3) | |
334 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(math.rad(-150),math.rad(0),math.rad(10)),.3) | |
335 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(math.rad(-150),math.rad(0),math.rad(-10)),.3) | |
336 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0)),.3) | |
337 | end | |
338 | elseif torvel<1 and hitfloor~=nil then | |
339 | Anim="Idle" | |
340 | if attack==false then | |
341 | RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(0),math.rad(90),math.rad(0)),.3) | |
342 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(10),math.rad(0),math.rad(0)),.3) | |
343 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(math.rad(-10),math.rad(0),math.rad(10)),.3) | |
344 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(math.rad(10),math.rad(10),math.rad(-10)),.3) | |
345 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-60),math.rad(-10)),.3) | |
346 | end | |
347 | elseif torvel>2 and torvel<22 and hitfloor~=nil then | |
348 | Anim="Walk" | |
349 | if attack==false then | |
350 | change=3 | |
351 | RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(90),math.rad(0),math.rad(0)),.3) | |
352 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(-90),math.rad(0),math.rad(0)),.3) | |
353 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(math.rad(-20),math.rad(0),math.rad(15)),.3) | |
354 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(math.rad(-20),math.rad(0),math.rad(-15)),.3) | |
355 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0)),.3) | |
356 | end | |
357 | elseif torvel>=22 and hitfloor~=nil then | |
358 | Anim="Run" | |
359 | if attack==false then | |
360 | change=3 | |
361 | RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(90),math.rad(0),math.rad(0)),.3) | |
362 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(-90),math.rad(0),math.rad(0)),.3) | |
363 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(math.rad(-20),math.rad(0),math.rad(15)),.3) | |
364 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(math.rad(-20),math.rad(0),math.rad(-15)),.3) | |
365 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0)),.3) | |
366 | end | |
367 | end | |
368 | end | |
369 | end | |
370 | end | |
371 | ||
372 | delay(0,Animate) | |
373 | ||
374 | function KoolAid() | |
375 | attack = true | |
376 | cooldownOver = false | |
377 | Humanoid.JumpPower = 0 | |
378 | Humanoid.WalkSpeed = 0 | |
379 | port = part("KoolAid Portal",char,"Really red","Neon",0,0,Vector3.new(0,0,0)) | |
380 | mesh("Sphere",port,"","",Vector3.new(1,1,1)) | |
381 | port.Position = Torso.Position + Vector3.new(0,45,0) | |
382 | for i = 0, 1, 0.05 do | |
383 | wait() | |
384 | RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(0),math.rad(0),math.rad(0)),.3) | |
385 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(-90),math.rad(0),math.rad(0)),.3) | |
386 | RW.C0=clerp(RW.C0,cf(1.75,1.5,-0.5)*euler(math.rad(-20),math.rad(0),math.rad(-15)),.3) | |
387 | LW.C0=clerp(LW.C0,cf(-1.75,1.5,-0.5)*euler(math.rad(-20),math.rad(0),math.rad(15)),.3) | |
388 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0)),.3) | |
389 | port.Size = port.Size + Vector3.new(i*5,0,i*5) | |
390 | end | |
391 | for i = 0, 10, 0.05 do | |
392 | print(i) | |
393 | kool = part2("KoolAid",char,"Bright red","Plastic",0,0,Vector3.new(1,1,1)) | |
394 | NoOutline(kool) | |
395 | kool.Position = Torso.Position + Vector3.new(math.random(-15,15), 44.5, math.random(-15,15)) | |
396 | RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(0),math.rad(0),math.rad(i*500)),.3) | |
397 | wait() | |
398 | end | |
399 | wait() | |
400 | for i = 0, 1, 0.05 do | |
401 | wait() | |
402 | RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(0),math.rad(90),math.rad(0)),.3) | |
403 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(10),math.rad(0),math.rad(0)),.3) | |
404 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(math.rad(-10),math.rad(0),math.rad(10)),.3) | |
405 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(math.rad(10),math.rad(10),math.rad(-10)),.3) | |
406 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-60),math.rad(-10)),.3) | |
407 | port.Size = port.Size - Vector3.new(i*5,0,i*5) | |
408 | end | |
409 | port:Destroy() | |
410 | Humanoid.JumpPower, Humanoid.WalkSpeed = 123.4, 56.789 | |
411 | delay(0,cooldown) | |
412 | attack = false | |
413 | end | |
414 | ||
415 | -- Attacks | |
416 | ||
417 | Mouse.KeyDown:connect(function(k) | |
418 | k = k:lower() | |
419 | if attack == false and cooldownOver == true and k == 'z' then | |
420 | KoolAid() | |
421 | end | |
422 | end) | |
423 | ||
424 | function onTouch(part) | |
425 | local humanoid = part.Parent:findFirstChild("Humanoid") | |
426 | sound1 = Instance.new('Sound') | |
427 | sound1.SoundId = 'http://www.roblox.com/asset/?id=634710465' | |
428 | sound1.Looped = false | |
429 | sound1.Parent = Torso | |
430 | sound1:Play() | |
431 | ||
432 | sound2 = Instance.new('Sound') | |
433 | sound2.SoundId = 'http://www.roblox.com/asset/?id=634710465' | |
434 | sound2.Looped = false | |
435 | sound2.Parent = Torso | |
436 | sound2:Play() | |
437 | if (humanoid ~=nil) and humanoid.Parent.Name ~= Character.Name then | |
438 | humanoid.Health = 0 | |
439 | end | |
440 | end | |
441 | ||
442 | Torso.Touched:connect(onTouch) |