SHOW:
|
|
- or go back to the newest paste.
1 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end | |
2 | local Player,game,owner = owner,game | |
3 | local RealPlayer = Player | |
4 | do | |
5 | local rp = RealPlayer | |
6 | script.Parent = rp.Character | |
7 | ||
8 | --RemoteEvent for communicating | |
9 | local Event = Instance.new("RemoteEvent") | |
10 | Event.Name = "UserInput_Event" | |
11 | ||
12 | --Fake event to make stuff like Mouse.KeyDown work | |
13 | local function fakeEvent() | |
14 | local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end} | |
15 | t.connect = t.Connect | |
16 | return t | |
17 | end | |
18 | ||
19 | --Creating fake input objects with fake variables | |
20 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()} | |
21 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} | |
22 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) | |
23 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil | |
24 | end} | |
25 | --Merged 2 functions into one by checking amount of arguments | |
26 | CAS.UnbindAction = CAS.BindAction | |
27 | ||
28 | --This function will trigger the events that have been :Connect()'ed | |
29 | local function te(self,ev,...) | |
30 | local t = m[ev] | |
31 | if t and t._fakeEvent then | |
32 | for _,f in pairs(t.Functions) do | |
33 | f(...) | |
34 | end | |
35 | end | |
36 | end | |
37 | m.TrigEvent = te | |
38 | UIS.TrigEvent = te | |
39 | ||
40 | Event.OnServerEvent:Connect(function(plr,io) | |
41 | if plr~=rp then return end | |
42 | m.Target = io.Target | |
43 | m.Hit = io.Hit | |
44 | if not io.isMouse then | |
45 | local b = io.UserInputState == Enum.UserInputState.Begin | |
46 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
47 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
48 | end | |
49 | for _,t in pairs(CAS.Actions) do | |
50 | for _,k in pairs(t.Keys) do | |
51 | if k==io.KeyCode then | |
52 | t.Function(t.Name,io.UserInputState,io) | |
53 | end | |
54 | end | |
55 | end | |
56 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
57 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
58 | end | |
59 | end) | |
60 | Event.Parent = NLS([==[ | |
61 | local Player = game:GetService("Players").LocalPlayer | |
62 | local Event = script:WaitForChild("UserInput_Event") | |
63 | ||
64 | local Mouse = Player:GetMouse() | |
65 | local UIS = game:GetService("UserInputService") | |
66 | local input = function(io,a) | |
67 | if a then return end | |
68 | --Since InputObject is a client-side instance, we create and pass table instead | |
69 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target}) | |
70 | end | |
71 | UIS.InputBegan:Connect(input) | |
72 | UIS.InputEnded:Connect(input) | |
73 | ||
74 | local h,t | |
75 | --Give the server mouse data 30 times every second, but only if the values changed | |
76 | --If player is not moving their mouse, client won't fire events | |
77 | while wait(1/30) do | |
78 | if h~=Mouse.Hit or t~=Mouse.Target then | |
79 | h,t=Mouse.Hit,Mouse.Target | |
80 | Event:FireServer({isMouse=true,Target=t,Hit=h}) | |
81 | end | |
82 | end]==],Player.Character) | |
83 | ||
84 | ----Sandboxed game object that allows the usage of client-side methods and services | |
85 | --Real game object | |
86 | local _rg = game | |
87 | ||
88 | --Metatable for fake service | |
89 | local fsmt = { | |
90 | __index = function(self,k) | |
91 | local s = rawget(self,"_RealService") | |
92 | if s then return s[k] end | |
93 | end, | |
94 | __newindex = function(self,k,v) | |
95 | local s = rawget(self,"_RealService") | |
96 | if s then s[k]=v end | |
97 | end, | |
98 | __call = function(self,...) | |
99 | local s = rawget(self,"_RealService") | |
100 | if s then return s(...) end | |
101 | end | |
102 | } | |
103 | local function FakeService(t,RealService) | |
104 | t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService | |
105 | return setmetatable(t,fsmt) | |
106 | end | |
107 | ||
108 | --Fake game object | |
109 | local g = { | |
110 | GetService = function(self,s) | |
111 | return self[s] | |
112 | end, | |
113 | Players = FakeService({ | |
114 | LocalPlayer = FakeService({GetMouse=function(self)return m end},Player) | |
115 | },"Players"), | |
116 | UserInputService = FakeService(UIS,"UserInputService"), | |
117 | ContextActionService = FakeService(CAS,"ContextActionService"), | |
118 | } | |
119 | rawset(g.Players,"localPlayer",g.Players.LocalPlayer) | |
120 | g.service = g.GetService | |
121 | ||
122 | g.RunService = FakeService({ | |
123 | RenderStepped = _rg:GetService("RunService").Heartbeat, | |
124 | BindToRenderStep = function(self,name,_,fun) | |
125 | ||
126 | end, | |
127 | UnbindFromRenderStep = function(self,name) | |
128 | self._btrs[name]:Disconnect() | |
129 | end, | |
130 | },"RunService") | |
131 | ||
132 | setmetatable(g,{ | |
133 | __index=function(self,s) | |
134 | return _rg:GetService(s) or typeof(_rg[s])=="function" | |
135 | and function(_,...)return _rg[s](_rg,...)end or _rg[s] | |
136 | end, | |
137 | __newindex = fsmt.__newindex, | |
138 | __call = fsmt.__call | |
139 | }) | |
140 | --Changing owner to fake player object to support owner:GetMouse() | |
141 | game,owner = g,g.Players.LocalPlayer | |
142 | end | |
143 | ||
144 | ||
145 | Player_Size = 1 --Size of the player. | |
146 | ||
147 | wait() | |
148 | local Player = owner | |
149 | local Character = Player.Character | |
150 | local plr = owner | |
151 | local Humanoid = Character.Humanoid | |
152 | local char = plr.Character | |
153 | local hum = char.Humanoid | |
154 | local ra = char["Right Arm"] | |
155 | local la= char["Left Arm"] | |
156 | local rl= char["Right Leg"] | |
157 | local ll = char["Left Leg"] | |
158 | local hed = char.Head | |
159 | local root = char.HumanoidRootPart | |
160 | local rootj = root.RootJoint | |
161 | local tors = char.Torso | |
162 | local LeftArm = Character["Left Arm"] | |
163 | local RightArm = Character["Right Arm"] | |
164 | local LeftLeg = Character["Left Leg"] | |
165 | local RightLeg = Character["Right Leg"] | |
166 | local Head = Character.Head | |
167 | local Torso = Character.Torso | |
168 | local mouse = plr:GetMouse() | |
169 | local RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14) | |
170 | local RHCF = CFrame.fromEulerAnglesXYZ(0, 1.6, 0) | |
171 | local LHCF = CFrame.fromEulerAnglesXYZ(0, -1.6, 0) | |
172 | local cam = game.Workspace.CurrentCamera | |
173 | trazx = Instance.new("ParticleEmitter") | |
174 | c = game.Players.LocalPlayer.Character | |
175 | local sine=0 | |
176 | Character.Head.face.Texture = "rbxassetid://0" | |
177 | ||
178 | hum.MaxHealth = "Inf" | |
179 | hum.Health = "Inf" | |
180 | ||
181 | local forcefield = Instance.new("ForceField",char) | |
182 | forcefield.Visible = false | |
183 | ----------------------------------------------------------- | |
184 | h = char.Head | |
185 | t = char.Torso | |
186 | rs = t["Right Shoulder"] | |
187 | ls = t["Left Shoulder"] | |
188 | rh = t["Right Hip"] | |
189 | lh = t["Left Hip"] | |
190 | nec = t.Neck | |
191 | rut = char.HumanoidRootPart | |
192 | rutj = rut.RootJoint | |
193 | it = Instance.new | |
194 | ||
195 | local txt = Instance.new("BillboardGui", char) | |
196 | txt.Adornee = char.Head | |
197 | txt.Size = UDim2.new(2, 0, 1.2, 0) | |
198 | txt.StudsOffset = Vector3.new(-9, 8, 0) | |
199 | local text = Instance.new("TextLabel", txt) | |
200 | text.Size = UDim2.new(10, 0, 7, 0) | |
201 | text.FontSize = "Size24" | |
202 | text.TextScaled = true | |
203 | text.TextTransparency = 0 | |
204 | text.BackgroundTransparency = 1 | |
205 | text.TextTransparency = 0 | |
206 | text.TextStrokeTransparency = 1 | |
207 | text.Font = "Arcade" | |
208 | text.TextStrokeColor3 = Color3.new(0, 0, 0) | |
209 | v = Instance.new("Part") | |
210 | v.Name = "ColorBrick" | |
211 | v.Parent = Player.Character | |
212 | v.FormFactor = "Symmetric" | |
213 | v.Anchored = true | |
214 | v.CanCollide = false | |
215 | v.BottomSurface = "Smooth" | |
216 | v.TopSurface = "Smooth" | |
217 | v.Size = Vector3.new(10, 5, 3) | |
218 | v.Transparency = 1 | |
219 | v.CFrame = char.Torso.CFrame | |
220 | v.BrickColor = BrickColor.new("Really black") | |
221 | v.Transparency = 1 | |
222 | v.Shape = "Block" | |
223 | spawn(function() | |
224 | Head.BrickColor = BrickColor.new("White") | |
225 | RightArm.BrickColor = BrickColor.new("White") | |
226 | LeftArm.BrickColor = BrickColor.new("White") | |
227 | Torso.BrickColor = BrickColor.new("White") | |
228 | RightLeg.BrickColor = BrickColor.new("White") | |
229 | LeftLeg.BrickColor = BrickColor.new("White") | |
230 | end) | |
231 | local TweenService = game:GetService("TweenService") | |
232 | text.Text = "Neutral" | |
233 | ||
234 | ||
235 | local txtd = Instance.new("BillboardGui", char) | |
236 | txtd.Adornee = char.Head | |
237 | txtd.Size = UDim2.new(2, 0, 1.2, 0) | |
238 | txtd.StudsOffset = Vector3.new(-9, 8, 0) | |
239 | local texth = Instance.new("TextLabel", txtd) | |
240 | texth.Size = UDim2.new(10, 0, 7, 0) | |
241 | texth.FontSize = "Size24" | |
242 | texth.TextScaled = true | |
243 | texth.TextTransparency = 0 | |
244 | texth.BackgroundTransparency = 1 | |
245 | texth.TextTransparency = 0 | |
246 | texth.TextStrokeTransparency = 1 | |
247 | texth.Font = "Cartoon" | |
248 | texth.TextStrokeColor3 = Color3.new(0, 0, 0) | |
249 | v = Instance.new("Part") | |
250 | v.Name = "ColorBrick" | |
251 | v.Parent = Player.Character | |
252 | v.FormFactor = "Symmetric" | |
253 | v.Anchored = true | |
254 | v.CanCollide = false | |
255 | v.BottomSurface = "Smooth" | |
256 | v.TopSurface = "Smooth" | |
257 | v.Size = Vector3.new(10, 5, 3) | |
258 | v.Transparency = 1 | |
259 | v.CFrame = char.Torso.CFrame | |
260 | v.BrickColor = BrickColor.new("Really black") | |
261 | v.Transparency = 1 | |
262 | v.Shape = "Block" | |
263 | spawn(function() | |
264 | local TweenService = game:GetService("TweenService") | |
265 | local Colourss = {Color3.fromRGB(72,99,0),Color3.fromRGB(99,21,2),Color3.fromRGB(6,0,99),Color3.fromRGB(99,35,90),Color3.fromRGB(203,213,0)} | |
266 | local Intt = 0 | |
267 | while wait(0.2) do | |
268 | if Intt == #Colourss then Intt = 0 end | |
269 | Intt = Intt+1 | |
270 | TweenService:Create(texth,TweenInfo.new(1),{TextColor3 = Colourss[Intt]}):Play() | |
271 | end | |
272 | end) | |
273 | texth.Text = "" | |
274 | ||
275 | ||
276 | spawn(function() | |
277 | Head.BrickColor = BrickColor.new("White") | |
278 | RightArm.BrickColor = BrickColor.new("White") | |
279 | LeftArm.BrickColor = BrickColor.new("White") | |
280 | Torso.BrickColor = BrickColor.new("White") | |
281 | RightLeg.BrickColor = BrickColor.new("White") | |
282 | LeftLeg.BrickColor = BrickColor.new("White") | |
283 | end) | |
284 | ||
285 | neutral = true | |
286 | ||
287 | for i,v in pairs(Character:children()) do | |
288 | if v:IsA("Hat") then | |
289 | v:Destroy() | |
290 | end | |
291 | end | |
292 | for i,v in pairs(Character:children()) do | |
293 | if v:IsA("Accessory") then | |
294 | v:Destroy() | |
295 | end | |
296 | end | |
297 | for i,v in pairs(Character:children()) do | |
298 | if v:IsA("Hair") then | |
299 | v:Destroy() | |
300 | end | |
301 | end | |
302 | for i,v in pairs(Character:children()) do | |
303 | if v:IsA("Shirt") then | |
304 | v:Destroy() | |
305 | end | |
306 | end | |
307 | for i,v in pairs(Character:children()) do | |
308 | if v:IsA("Pants") then | |
309 | v:Destroy() | |
310 | end | |
311 | end | |
312 | for i,v in pairs(Character:children()) do | |
313 | if v:IsA("Graphic Shirt") then | |
314 | v:Destroy() | |
315 | end | |
316 | end | |
317 | for i,v in pairs(Character:children()) do | |
318 | if v:IsA("GraphicShirt") then | |
319 | v:Destroy() | |
320 | end | |
321 | end | |
322 | ||
323 | for _,v in pairs(Character:children()) do | |
324 | if v:IsA("Shirt") then | |
325 | v.ShirtTemplate = "rbxassetid://0" | |
326 | elseif v:IsA("Pants") then | |
327 | v.PantsTemplate = "rbxassetid://0" | |
328 | elseif v:IsA("ShirtGraphic") then | |
329 | v:Remove() | |
330 | wait(.1) | |
331 | Torso.roblox:Remove() | |
332 | elseif v:IsA("Accessory") then | |
333 | v:Remove() | |
334 | end | |
335 | end | |
336 | ||
337 | local Hair = Instance.new("Part") | |
338 | Hair.Parent = char | |
339 | Hair.Name = "GreenTopHat" | |
340 | Hair.Size = Vector3.new(0.1, 0.1, 0.1) | |
341 | Hair.CFrame = char.Head.CFrame | |
342 | Hair:BreakJoints() | |
343 | Hair.CanCollide = false | |
344 | Hair.BrickColor = BrickColor.new("White") | |
345 | Hair.TopSurface = "Smooth" | |
346 | Hair.BottomSurface = "Smooth" | |
347 | Weld = Instance.new("Weld") | |
348 | Weld.Name = "Weld" | |
349 | Weld.Part0 = char.Head | |
350 | Weld.Part1 = Hair | |
351 | Weld.Parent = char.Head | |
352 | Weld.C0 = CFrame.new(0, 0.77, 0)*CFrame.fromEulerAnglesXYZ(0.1, 0, 0) | |
353 | Mesh = Instance.new("SpecialMesh") | |
354 | Mesh.Parent = Hair | |
355 | Mesh.MeshId = "http://www.roblox.com/asset/?id=866435059" | |
356 | Mesh.Scale = Vector3.new(1, 1, 1) | |
357 | ------------------------------------------------------- | |
358 | --Start Good Stuff-- | |
359 | ------------------------------------------------------- | |
360 | CF = CFrame.new | |
361 | angles = CFrame.Angles | |
362 | attack = false | |
363 | timetofly = true | |
364 | Euler = CFrame.fromEulerAnglesXYZ | |
365 | Rad = math.rad | |
366 | IT = Instance.new | |
367 | BrickC = BrickColor.new | |
368 | Cos = math.cos | |
369 | Acos = math.acos | |
370 | Sin = math.sin | |
371 | Asin = math.asin | |
372 | Abs = math.abs | |
373 | Mrandom = math.random | |
374 | Floor = math.floor | |
375 | random = math.random | |
376 | radian = math.rad | |
377 | Vec3 = Vector3.new | |
378 | cFrame = CFrame.new | |
379 | Euler = CFrame.fromEulerAnglesXYZ | |
380 | ------------------------------------------------------- | |
381 | --End Good Stuff-- | |
382 | ------------------------------------------------------- | |
383 | necko = CF(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
384 | RSH, LSH = nil, nil | |
385 | RW = Instance.new("Weld") | |
386 | LW = Instance.new("Weld") | |
387 | RH = tors["Right Hip"] | |
388 | LH = tors["Left Hip"] | |
389 | RSH = tors["Right Shoulder"] | |
390 | LSH = tors["Left Shoulder"] | |
391 | RSH.Parent = nil | |
392 | LSH.Parent = nil | |
393 | RW.Name = "RW" | |
394 | RW.Part0 = tors | |
395 | RW.C0 = CF(1.5, 0.5, 0) | |
396 | RW.C1 = CF(0, 0.5, 0) | |
397 | RW.Part1 = ra | |
398 | RW.Parent = tors | |
399 | LW.Name = "LW" | |
400 | LW.Part0 = tors | |
401 | LW.C0 = CF(-1.5, 0.5, 0) | |
402 | LW.C1 = CF(0, 0.5, 0) | |
403 | LW.Part1 = la | |
404 | LW.Parent = tors | |
405 | Effects = {} | |
406 | ||
407 | ||
408 | ||
409 | ------------------------------------------------------- | |
410 | --Start Important Functions-- | |
411 | ------------------------------------------------------- | |
412 | function swait(num) | |
413 | if num == 0 or num == nil then | |
414 | game:service("RunService").Stepped:wait(0) | |
415 | else | |
416 | for i = 0, num do | |
417 | game:service("RunService").Stepped:wait(0) | |
418 | end | |
419 | end | |
420 | end | |
421 | function thread(f) | |
422 | coroutine.resume(coroutine.create(f)) | |
423 | end | |
424 | function clerp(a, b, t) | |
425 | local qa = { | |
426 | QuaternionFromCFrame(a) | |
427 | } | |
428 | local qb = { | |
429 | QuaternionFromCFrame(b) | |
430 | } | |
431 | local ax, ay, az = a.x, a.y, a.z | |
432 | local bx, by, bz = b.x, b.y, b.z | |
433 | local _t = 1 - t | |
434 | return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t)) | |
435 | end | |
436 | function QuaternionFromCFrame(cf) | |
437 | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() | |
438 | local trace = m00 + m11 + m22 | |
439 | if trace > 0 then | |
440 | local s = math.sqrt(1 + trace) | |
441 | local recip = 0.5 / s | |
442 | return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5 | |
443 | else | |
444 | local i = 0 | |
445 | if m00 < m11 then | |
446 | i = 1 | |
447 | end | |
448 | if m22 > (i == 0 and m00 or m11) then | |
449 | i = 2 | |
450 | end | |
451 | if i == 0 then | |
452 | local s = math.sqrt(m00 - m11 - m22 + 1) | |
453 | local recip = 0.5 / s | |
454 | return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip | |
455 | elseif i == 1 then | |
456 | local s = math.sqrt(m11 - m22 - m00 + 1) | |
457 | local recip = 0.5 / s | |
458 | return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip | |
459 | elseif i == 2 then | |
460 | local s = math.sqrt(m22 - m00 - m11 + 1) | |
461 | local recip = 0.5 / s | |
462 | return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip | |
463 | end | |
464 | end | |
465 | end | |
466 | function QuaternionToCFrame(px, py, pz, x, y, z, w) | |
467 | local xs, ys, zs = x + x, y + y, z + z | |
468 | local wx, wy, wz = w * xs, w * ys, w * zs | |
469 | local xx = x * xs | |
470 | local xy = x * ys | |
471 | local xz = x * zs | |
472 | local yy = y * ys | |
473 | local yz = y * zs | |
474 | local zz = z * zs | |
475 | 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)) | |
476 | end | |
477 | function QuaternionSlerp(a, b, t) | |
478 | local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4] | |
479 | local startInterp, finishInterp | |
480 | if cosTheta >= 1.0E-4 then | |
481 | if 1 - cosTheta > 1.0E-4 then | |
482 | local theta = math.acos(cosTheta) | |
483 | local invSinTheta = 1 / Sin(theta) | |
484 | startInterp = Sin((1 - t) * theta) * invSinTheta | |
485 | finishInterp = Sin(t * theta) * invSinTheta | |
486 | else | |
487 | startInterp = 1 - t | |
488 | finishInterp = t | |
489 | end | |
490 | elseif 1 + cosTheta > 1.0E-4 then | |
491 | local theta = math.acos(-cosTheta) | |
492 | local invSinTheta = 1 / Sin(theta) | |
493 | startInterp = Sin((t - 1) * theta) * invSinTheta | |
494 | finishInterp = Sin(t * theta) * invSinTheta | |
495 | else | |
496 | startInterp = t - 1 | |
497 | finishInterp = t | |
498 | end | |
499 | 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 | |
500 | end | |
501 | function rayCast(Position, Direction, Range, Ignore) | |
502 | return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore) | |
503 | end | |
504 | local RbxUtility = LoadLibrary("RbxUtility") | |
505 | local Create = RbxUtility.Create | |
506 | local insta = true | |
507 | ||
508 | angery = false | |
509 | ||
510 | text.TextColor3 = BrickColor.new("White").Color | |
511 | ||
512 | sick = Instance.new("Sound",char.Head) | |
513 | sick.SoundId = "rbxassetid://1117396305" | |
514 | sick.Volume = 10 | |
515 | sick.Playing = true | |
516 | sick.Looped = true | |
517 | ||
518 | neutral = true | |
519 | visualizer = false | |
520 | ||
521 | mouse.KeyDown:connect(function(key) | |
522 | key=key:lower() | |
523 | if key == "p" then | |
524 | visualizer = true | |
525 | neutral = false | |
526 | text.Text = "Visualizer" | |
527 | sick.SoundId = "rbxassetid://158698069" | |
528 | text.TextColor3 = BrickColor.new("Bright blue").Color | |
529 | Head.BrickColor = BrickColor.new("Bright blue") | |
530 | RightArm.BrickColor = BrickColor.new("Bright blue") | |
531 | LeftArm.BrickColor = BrickColor.new("Bright blue") | |
532 | Torso.BrickColor = BrickColor.new("Bright blue") | |
533 | RightLeg.BrickColor = BrickColor.new("Bright blue") | |
534 | LeftLeg.BrickColor = BrickColor.new("Bright blue") | |
535 | Hair.BrickColor = BrickColor.new("Bright blue") | |
536 | end | |
537 | if key == "n" then | |
538 | visualizer = false | |
539 | neutral = true | |
540 | text.Text = "Neutral" | |
541 | text.TextColor3 = BrickColor.new("White").Color | |
542 | sick.SoundId = "rbxassetid://1117396305" | |
543 | Head.BrickColor = BrickColor.new("White") | |
544 | RightArm.BrickColor = BrickColor.new("White") | |
545 | LeftArm.BrickColor = BrickColor.new("White") | |
546 | Torso.BrickColor = BrickColor.new("White") | |
547 | RightLeg.BrickColor = BrickColor.new("White") | |
548 | LeftLeg.BrickColor = BrickColor.new("White") | |
549 | Hair.BrickColor = BrickColor.new("White") | |
550 | end | |
551 | end) | |
552 | ------------------------------------------------------- | |
553 | local PlayerSize = 1 | |
554 | local blocky = Instance.new("SpecialMesh",Torso) | |
555 | blocky.MeshType = "Brick" | |
556 | blocky:Clone().Parent = RightArm | |
557 | blocky:Clone().Parent = LeftArm | |
558 | blocky:Clone().Parent = RightLeg | |
559 | blocky:Clone().Parent = LeftLeg | |
560 | local hedblock = Instance.new("SpecialMesh",hed) | |
561 | hedblock.MeshType = "Brick" | |
562 | hedblock.Scale = Vector3.new(0.5, 1, 1) | |
563 | ||
564 | local FT,RA,LA,RL,LL = Instance.new("SpecialMesh"),Instance.new("SpecialMesh"),Instance.new("SpecialMesh"),Instance.new("SpecialMesh"),Instance.new("SpecialMesh") | |
565 | FT.MeshId,FT.Scale = "rbxasset://fonts/torso.mesh",Vector3.new(PlayerSize,PlayerSize,PlayerSize) | |
566 | RA.MeshId,RA.Scale = "rbxasset://fonts/rightarm.mesh",Vector3.new(PlayerSize,PlayerSize,PlayerSize) | |
567 | LA.MeshId,LA.Scale = "rbxasset://fonts/leftarm.mesh",Vector3.new(PlayerSize,PlayerSize,PlayerSize) | |
568 | RL.MeshId,RL.Scale = "rbxasset://fonts/rightleg.mesh",Vector3.new(PlayerSize,PlayerSize,PlayerSize) | |
569 | LL.MeshId,LL.Scale = "rbxasset://fonts/leftleg.mesh",Vector3.new(PlayerSize,PlayerSize,PlayerSize) | |
570 | ||
571 | LeftLeg.Material = "SmoothPlastic" | |
572 | RightLeg.Material = "SmoothPlastic" | |
573 | LeftArm.Material = "SmoothPlastic" | |
574 | RightArm.Material = "SmoothPlastic" | |
575 | Torso.Material = "SmoothPlastic" | |
576 | hed.Material = "SmoothPlastic" | |
577 | ||
578 | local equipped = false | |
579 | local idle = 0 | |
580 | local change = 1 | |
581 | local val = 0 | |
582 | local toim = 0 | |
583 | local idleanim = 0.4 | |
584 | hum.Animator.Parent = nil | |
585 | while true do | |
586 | swait() | |
587 | sine = sine + change | |
588 | local torvel = (root.Velocity * Vector3.new(1, 0, 1)).magnitude | |
589 | local velderp = root.Velocity.y | |
590 | hitfloor, posfloor = rayCast(root.Position, CFrame.new(root.Position, root.Position - Vector3.new(0, 1, 0)).lookVector, 4, char) | |
591 | if equipped == true or equipped == false then | |
592 | if attack == false then | |
593 | idle = idle + 1 | |
594 | else | |
595 | idle = 0 | |
596 | end | |
597 | if 1 < root.Velocity.y and hitfloor == nil then | |
598 | Anim = "Jump" | |
599 | if attack == false then | |
600 | rootj.C0 = clerp(rootj.C0, RootCF * angles(math.min(math.max(root.Velocity.Y/100,-Rad(65)),Rad(65)),0,0),0.3) | |
601 | tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(-10), Rad(0), Rad(0)), 0.3) | |
602 | RW.C0 = clerp(RW.C0, CF(1.5, 0.5, 0) * angles(math.min(math.max(root.Velocity.Y/100,-Rad(65)),Rad(65)),0,Rad(15)),0.3) | |
603 | LW.C0 = clerp(LW.C0, CF(-1.5, 0.5, 0) * angles(math.min(math.max(root.Velocity.Y/100,-Rad(65)),Rad(65)),0,Rad(-15)),0.3) | |
604 | LH.C0=clerp(LH.C0, CF(-1,-.4-0.1 * Cos(sine / 20), -.6) * LHCF * angles(Rad(-5), Rad(-0), Rad(20)), 0.15) | |
605 | RH.C0=clerp(RH.C0, CF(1,-1-0.1 * Cos(sine / 20), -.3) * angles(Rad(0), Rad(90), Rad(0)), .3) | |
606 | end | |
607 | elseif -1 > root.Velocity.y and hitfloor == nil then | |
608 | Anim = "Fall" | |
609 | if attack == false then | |
610 | rootj.C0 = clerp(rootj.C0, RootCF * angles(math.min(math.max(root.Velocity.Y/100,-Rad(65)),Rad(65)),0,0),0.3) | |
611 | tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(10), Rad(0), Rad(0)), 0.3) | |
612 | RW.C0 = clerp(RW.C0, CF(1.5, 0.5, 0) * angles(math.min(math.max(root.Velocity.Y/100,-Rad(65)),Rad(65)),0,Rad(90)),0.3) | |
613 | LW.C0 = clerp(LW.C0, CF(-1.5, 0.5, 0) * angles(math.min(math.max(root.Velocity.Y/100,-Rad(65)),Rad(65)),0,Rad(-90)),0.3) | |
614 | LH.C0 = clerp(LH.C0, CF(-1,-.4-0.1 * Cos(sine / 20), -.6) * LHCF * angles(Rad(-5), Rad(-0), Rad(20)), 0.15) | |
615 | RH.C0 = clerp(RH.C0, CF(1,-1-0.1 * Cos(sine / 20), -.3) * angles(Rad(0), Rad(90), Rad(0)), .3) | |
616 | end | |
617 | elseif torvel < 1 and hitfloor ~= nil then | |
618 | Anim = "Idle" | |
619 | change = .5 | |
620 | if attack == false then | |
621 | if visualizer == false then | |
622 | VALUE1 = false | |
623 | rootj.C0 = clerp(rootj.C0, RootCF * CF(0, 0, -0.1 + 0.1 * Cos(sine / 20)) * angles(Rad(0), Rad(0), Rad(0)), 0.15) | |
624 | tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(-2.5 * Sin(sine / 20)), Rad(0), Rad(0)), 0.3) | |
625 | RH.C0 = clerp(RH.C0, CF(1, -0.9 - 0.1 * Cos(sine / 20), 0.025 * Cos(sine / 20)) * RHCF * angles(Rad(-4.5), Rad(0), Rad(0)), 0.15) | |
626 | LH.C0 = clerp(LH.C0, CF(-1, -0.9 - 0.1 * Cos(sine / 20), 0.025 * Cos(sine / 20)) * LHCF * angles(Rad(-6.5), Rad(0), Rad(0)), 0.15) | |
627 | RW.C0 = clerp(RW.C0, CF(1.5, 0.5 + 0.05 * Sin(sine / 20), 0.025 * Cos(sine / 20)) * angles(Rad(0), Rad(-10 * Cos(sine / 20)), Rad(5 - 2.5 * Sin(sine / 20))), 0.1) | |
628 | LW.C0 = clerp(LW.C0, CF(-1.5, 0.5 + 0.05 * Sin(sine / 20), 0.025 * Cos(sine / 20)) * angles(Rad(0), Rad(10 * Cos(sine / 20)), Rad(-5 + 2.5 * Sin(sine / 20))), 0.1) | |
629 | if VALUE1 == false and math.random(1,200) == 1 then | |
630 | coroutine.resume(coroutine.create(function() | |
631 | VALUE1 = true | |
632 | for i = 1, 25 do | |
633 | swait() | |
634 | tors.Neck.C0=clerp(tors.Neck.C0,necko*angles(math.rad(-25),math.rad((15+math.random(-15,15)/15)),math.rad(30)),.3) | |
635 | end | |
636 | VALUE1 = false | |
637 | ||
638 | end)) | |
639 | end | |
640 | elseif visualizer == true then | |
641 | rootj.C0 = clerp(rootj.C0, RootCF * CF(0, 0, -0.1 + 0.05 * Cos(sine / 20)) * angles(Rad(0), Rad(0), Rad(0)), 0.15) | |
642 | tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(-4.5 * Sin(sine / 3)), Rad(-4.5 * Sin(sine / 3)), Rad(0)), 0.3) | |
643 | RH.C0 = clerp(RH.C0, CF(1* Player_Size, -0.8 + 0.1 * Cos(sine / 3)* Player_Size, -.3* Player_Size) * angles(Rad(0), Rad(74), Rad(0)) * angles(Rad(-2.5), Rad(0), Rad(-5)), 0.15) | |
644 | LH.C0 = clerp(LH.C0, CF(-1* Player_Size, -0.9 - 0.05 * Cos(sine / 20)* Player_Size, 0* Player_Size) * angles(Rad(0), Rad(-87), Rad(0)) * angles(Rad(-2.5), Rad(0), Rad(0)), 0.15) | |
645 | RW.C0 = clerp(RW.C0, CF(1* Player_Size, 0.3 + 0.05 * Sin(sine / 20)* Player_Size, .6* Player_Size) * angles(Rad(-35), Rad(-25 + 2.5 * Sin(sine / 20)), Rad(-55 + 2.5 * Sin(sine / 20))), 0.12) | |
646 | LW.C0 = clerp(LW.C0, CF(-1.5* Player_Size, 0.5 + 0.05 * Sin(sine / 20* Player_Size), 0* Player_Size) * angles(Rad(-30 * Sin(sine / 10)), Rad(0), Rad(-5 - 4.5 * Sin(sine / 20))), 0.1) | |
647 | if VALUE1 == false and math.random(1,200) == 1 then | |
648 | coroutine.resume(coroutine.create(function() | |
649 | VALUE1 = true | |
650 | for i = 1, 25 do | |
651 | swait() | |
652 | tors.Neck.C0=clerp(tors.Neck.C0,necko*angles(math.rad(-25),math.rad((15+math.random(-15,15)/15)),math.rad(0)),.3) | |
653 | end | |
654 | VALUE1 = false | |
655 | RA.Parent = nil | |
656 | LA.Parent = nil | |
657 | RL.Parent = nil | |
658 | LL.Parent = nil | |
659 | for _,v in next, char:GetDescendants() do | |
660 | if(v:IsA'DataModelMesh')then | |
661 | v.Offset = Vector3.new(0,0,0) | |
662 | end | |
663 | end | |
664 | ||
665 | end)) | |
666 | end | |
667 | end | |
668 | end | |
669 | elseif tors.Velocity.magnitude < 50 and hitfloor ~= nil then | |
670 | Anim = "Walk" | |
671 | change = 1 | |
672 | if attack == false then | |
673 | rootj.C0 = clerp(rootj.C0, RootCF * CF(0, 0, -0.175 + 0.025 * Cos(sine / 3.5) + -Sin(sine / 3.5) / 7) * angles(Rad(4-2.5 * Cos(sine / 3.5)), Rad(0) - root.RotVelocity.Y / 75, Rad(5 * Cos(sine / 7))), 0.15) | |
674 | tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(-2.5 * Sin(sine / 20)), Rad(0), Rad(0) - hed.RotVelocity.Y / 15), 0.3) | |
675 | RH.C0 = clerp(RH.C0, CF(1, -0.925 - sick.PlaybackLoudness / 15 * Cos(sine / 7) / 2, 0.5 * Cos(sine / 7) / 2) * angles(Rad(-15 - 5 * Cos(sine / 7)) - rl.RotVelocity.Y / 75 + -Sin(sine / 7) / 2.5, Rad(90 - 0.1 * Cos(sine / 7)), Rad(0)) * angles(Rad(0 + 0.1 * Cos(sine / 7)), Rad(0), Rad(0)), 0.3) | |
676 | LH.C0 = clerp(LH.C0, CF(-1, -0.925 + 0.5 * Cos(sine / 7) / 2, -0.5 * Cos(sine / 7) / 2) * angles(Rad(-15 + 5 * Cos(sine / 7)) + ll.RotVelocity.Y / 75 + Sin(sine / 7) / 2.5, Rad(-90 - 0.1 * Cos(sine / 7)), Rad(0)) * angles(Rad(0 - 0.1 * Cos(sine / 7)), Rad(0), Rad(0)), 0.3) | |
677 | RW.C0 = clerp(RW.C0, CF(1.5, 0.5 + 0.05 * Sin(sine / 7), 0.15 * Cos(sine / 7)) * angles(Rad(45) * Cos(sine / 7) , Rad(0), Rad(5) - ra.RotVelocity.Y / 75), 0.1) | |
678 | LW.C0 = clerp(LW.C0, CF(-1.5, 0.5 + 0.05 * Sin(sine / 7), -0.15 * Cos(sine / 7)) * angles(Rad(-45) * Cos(sine / 7) , Rad(0) , Rad(-5) + la.RotVelocity.Y / 75), 0.1) | |
679 | end | |
680 | end | |
681 | end | |
682 | if 0 < #Effects then | |
683 | for e = 1, #Effects do | |
684 | if Effects[e] ~= nil then | |
685 | local Thing = Effects[e] | |
686 | if Thing ~= nil then | |
687 | local Part = Thing[1] | |
688 | local Mode = Thing[2] | |
689 | local Delay = Thing[3] | |
690 | local IncX = Thing[4] | |
691 | local IncY = Thing[5] | |
692 | local IncZ = Thing[6] | |
693 | if 1 >= Thing[1].Transparency then | |
694 | if Thing[2] == "Block1" then | |
695 | Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)) | |
696 | local Mesh = Thing[1].Mesh | |
697 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6]) | |
698 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
699 | elseif Thing[2] == "Block2" then | |
700 | Thing[1].CFrame = Thing[1].CFrame + Vector3.new(0, 0, 0) | |
701 | local Mesh = Thing[7] | |
702 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6]) | |
703 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
704 | elseif Thing[2] == "Block3" then | |
705 | Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)) + Vector3.new(0, 0.15, 0) | |
706 | local Mesh = Thing[7] | |
707 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6]) | |
708 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
709 | elseif Thing[2] == "Cylinder" then | |
710 | local Mesh = Thing[1].Mesh | |
711 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6]) | |
712 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
713 | elseif Thing[2] == "Blood" then | |
714 | local Mesh = Thing[7] | |
715 | Thing[1].CFrame = Thing[1].CFrame * Vector3.new(0, 0.5, 0) | |
716 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6]) | |
717 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
718 | elseif Thing[2] == "Elec" then | |
719 | local Mesh = Thing[1].Mesh | |
720 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[7], Thing[8], Thing[9]) | |
721 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
722 | elseif Thing[2] == "Disappear" then | |
723 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
724 | elseif Thing[2] == "Shatter" then | |
725 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
726 | Thing[4] = Thing[4] * CFrame.new(0, Thing[7], 0) | |
727 | Thing[1].CFrame = Thing[4] * CFrame.fromEulerAnglesXYZ(Thing[6], 0, 0) | |
728 | Thing[6] = Thing[6] + Thing[5] | |
729 | end | |
730 | else | |
731 | Part.Parent = nil | |
732 | table.remove(Effects, e) | |
733 | end | |
734 | end | |
735 | end | |
736 | end | |
737 | end | |
738 | end | |
739 | ------------------------------------------------------- | |
740 | --End Animations And Script-- | |
741 | ------------------------------------------------------- |