SHOW:
|
|
- or go back to the newest paste.
1 | ||
2 | if game:GetService("RunService"):IsClient() then error("Please run as a server script. Use h/ instead of hl/.") end | |
3 | - | --[[ |
3 | + | print("FE Compatibility: by WaverlyCole & Mokiros") |
4 | - | Tf2 Engineer Class |
4 | + | InternalData = {} |
5 | - | -------------------- |
5 | + | do |
6 | - | Script by: 123jl123 |
6 | + | script.Parent = owner.Character |
7 | - | --------------------- |
7 | + | local Event = Instance.new("RemoteEvent") |
8 | Event.Name = "UserInput" | |
9 | - | -- ]] |
9 | + | local function NewFakeEvent() |
10 | local Fake = {fakeEvent=true,Connect=function(self,Func)self.Function=Func end}Fake.connect = Fake.Connect | |
11 | return Fake | |
12 | end | |
13 | local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()} | |
14 | local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()} | |
15 | local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...) | |
16 | self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil | |
17 | end};ContextActionService.UnBindAction = ContextActionService.BindAction | |
18 | local function TriggerEvent(self,Event,...) | |
19 | local Trigger = Mouse[Event] | |
20 | if Trigger and Trigger.fakeEvent and Trigger.Function then | |
21 | Trigger.Function(...) | |
22 | end | |
23 | end | |
24 | Mouse.TrigEvent = TriggerEvent | |
25 | UserInputService.TrigEvent = TriggerEvent | |
26 | Event.OnServerEvent:Connect(function(FiredBy,Input) | |
27 | if FiredBy.Name ~= owner.Name then end | |
28 | if Input.MouseEvent then | |
29 | Mouse.Target = Input.Target | |
30 | Mouse.Hit = Input.Hit | |
31 | else | |
32 | local Begin = Input.UserInputState == Enum.UserInputState.Begin | |
33 | if Input.UserInputType == Enum.UserInputType.MouseButton1 then | |
34 | return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") | |
35 | end | |
36 | for _,Action in pairs(ContextActionService.Actions) do | |
37 | for _,Key in pairs(Action.Keys) do | |
38 | if Key==Input.KeyCode then | |
39 | Action.Function(Action.Name,Input.UserInputState,Input) | |
40 | end | |
41 | end | |
42 | end | |
43 | Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower()) | |
44 | UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false) | |
45 | end | |
46 | end) | |
47 | InternalData["Mouse"] = Mouse | |
48 | InternalData["ContextActionService"] = ContextActionService | |
49 | InternalData["UserInputService"] = UserInputService | |
50 | Event.Parent = NLS([[ | |
51 | local Player = owner | |
52 | local Event = script:WaitForChild("UserInput") | |
53 | local UserInputService = game:GetService("UserInputService") | |
54 | local Mouse = Player:GetMouse() | |
55 | local Input = function(Input,gameProcessedEvent) | |
56 | if gameProcessedEvent then return end | |
57 | Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState}) | |
58 | end | |
59 | UserInputService.InputBegan:Connect(Input) | |
60 | UserInputService.InputEnded:Connect(Input) | |
61 | local Hit,Target | |
62 | while wait(1/30) do | |
63 | if Hit ~= Mouse.Hit or Target ~= Mouse.Target then | |
64 | Hit,Target = Mouse.Hit,Mouse.Target | |
65 | Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit}) | |
66 | end | |
67 | end | |
68 | ]],owner.Character) | |
69 | end | |
70 | RealGame = game;game = setmetatable({},{ | |
71 | __index = function (self,Index) | |
72 | local Sandbox = function (Thing) | |
73 | if Thing:IsA("Player") then | |
74 | local RealPlayer = Thing | |
75 | return setmetatable({},{ | |
76 | __index = function (self,Index) | |
77 | local Type = type(RealPlayer[Index]) | |
78 | if Type == "function" then | |
79 | if Index:lower() == "getmouse" or Index:lower() == "mouse" then | |
80 | return function (self) | |
81 | return InternalData["Mouse"] | |
82 | end | |
83 | end | |
84 | return function (self,...) | |
85 | return RealPlayer[Index](RealPlayer,...) | |
86 | end | |
87 | else | |
88 | if Index == "PlrObj" then | |
89 | return RealPlayer | |
90 | end | |
91 | return RealPlayer[Index] | |
92 | end | |
93 | end; | |
94 | __tostring = function(self) | |
95 | return RealPlayer.Name | |
96 | end | |
97 | }) | |
98 | end | |
99 | end | |
100 | if RealGame[Index] then | |
101 | local Type = type(RealGame[Index]) | |
102 | if Type == "function" then | |
103 | if Index:lower() == "getservice" or Index:lower() == "service" then | |
104 | return function (self,Service) | |
105 | if Service:lower() == "players" then | |
106 | return setmetatable({},{ | |
107 | __index = function (self2,Index2) | |
108 | local RealService = RealGame:GetService(Service) | |
109 | local Type2 = type(Index2) | |
110 | if Type2 == "function" then | |
111 | return function (self,...) | |
112 | return RealService[Index2](RealService,...) | |
113 | end | |
114 | else | |
115 | if Index2:lower() == "localplayer" then | |
116 | return Sandbox(owner) | |
117 | end | |
118 | return RealService[Index2] | |
119 | end | |
120 | end; | |
121 | __tostring = function(self) | |
122 | return RealGame:GetService(Service).Name | |
123 | end | |
124 | }) | |
125 | elseif Service:lower() == "contextactionservice" then | |
126 | return InternalData["ContextActionService"] | |
127 | elseif Service:lower() == "contextactionservice" then | |
128 | return InternalData["UserInputService"] | |
129 | elseif Service:lower() == "runservice" then | |
130 | return setmetatable({},{ | |
131 | __index = function(self2,Index2) | |
132 | local RealService = RealGame:GetService(Service) | |
133 | local Type2 = type(Index2) | |
134 | if Type2 == "function" then | |
135 | return function (self,...) | |
136 | return RealService[Index2](RealService,...) | |
137 | end | |
138 | else | |
139 | if Index2:lower() == "bindtorenderstep" then | |
140 | return function (self,Name,Priority,Function) | |
141 | return RealGame:GetService("RunService").Stepped:Connect(Function) | |
142 | end | |
143 | end | |
144 | if Index2:lower() == "renderstepped" then | |
145 | return RealService["Stepped"] | |
146 | end | |
147 | return RealService[Index2] | |
148 | end | |
149 | end | |
150 | }) | |
151 | else | |
152 | return RealGame:GetService(Service) | |
153 | end | |
154 | end | |
155 | end | |
156 | return function (self,...) | |
157 | return RealGame[Index](RealGame,...) | |
158 | end | |
159 | else | |
160 | if game:GetService(Index) then | |
161 | return game:GetService(Index) | |
162 | end | |
163 | return RealGame[Index] | |
164 | end | |
165 | else | |
166 | return nil | |
167 | end | |
168 | end | |
169 | });Game = game;owner = game:GetService("Players").LocalPlayer;script = {} | |
170 | print("Complete! Running...") | |
171 | ||
172 | local plr = game:service'Players'.LocalPlayer | |
173 | local char = plr.Character | |
174 | local mouse = plr:GetMouse() | |
175 | local humanoid = char:findFirstChild("Humanoid") | |
176 | local torso = char:findFirstChild("Torso") | |
177 | local head = char.Head | |
178 | local ra = char:findFirstChild("Right Arm") | |
179 | local la = char:findFirstChild("Left Arm") | |
180 | local rl = char:findFirstChild("Right Leg") | |
181 | local ll = char:findFirstChild("Left Leg") | |
182 | local rs = torso:findFirstChild("Right Shoulder") | |
183 | local ls = torso:findFirstChild("Left Shoulder") | |
184 | local rh = torso:findFirstChild("Right Hip") | |
185 | local lh = torso:findFirstChild("Left Hip") | |
186 | local neck = torso:findFirstChild("Neck") | |
187 | local rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint") | |
188 | local rootpart = char:findFirstChild("HumanoidRootPart") | |
189 | local camera = workspace.CurrentCamera | |
190 | local anim = char:findFirstChild("Animate") | |
191 | DA = false | |
192 | NoSentry = true | |
193 | maincolor = game.Players.LocalPlayer.Character.Torso.BrickColor.Name | |
194 | secondcolor = "Really black" | |
195 | WSHM = {'10209908','10209905','10209905','10209908'} | |
196 | WSH = WSHM[math.random(1,#WSHM)] | |
197 | wait(1 / 60) | |
198 | Effects = { } | |
199 | local Player = game.Players.localPlayer | |
200 | local Character = Player.Character | |
201 | local Humanoid = Character.Humanoid | |
202 | local mouse = Player:GetMouse() | |
203 | local LeftArm = Character["Left Arm"] | |
204 | local RightArm = Character["Right Arm"] | |
205 | local LeftLeg = Character["Left Leg"] | |
206 | local RightLeg = Character["Right Leg"] | |
207 | local Head = Character.Head | |
208 | local Torso = Character.Torso | |
209 | local cam = game.Workspace.CurrentCamera | |
210 | local RootPart = Character.HumanoidRootPart | |
211 | local RootJoint = RootPart.RootJoint | |
212 | local equipped = false | |
213 | local attack = false | |
214 | local Anim = 'Idle' | |
215 | local idle = 0 | |
216 | local attacktype = 1 | |
217 | local Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude | |
218 | local velocity = RootPart.Velocity.y | |
219 | local sine = 0 | |
220 | local change = 1 | |
221 | local grabbed = false | |
222 | local cn = CFrame.new | |
223 | local mr = math.rad | |
224 | local angles = CFrame.Angles | |
225 | local ud = UDim2.new | |
226 | local c3 = Color3.new | |
227 | local slashDamage = 15 | |
228 | trans = 1 | |
229 | for i,v in pairs(char:GetChildren()) do if v:IsA("Accessory") then v:Remove() end end | |
230 | for i,v in pairs(char:GetChildren()) do if v:IsA("Hat") then v:Remove() end end | |
231 | Wep = 1 | |
232 | equippedgun2 = false | |
233 | ||
234 | ||
235 | ||
236 | ||
237 | ||
238 | ||
239 | ||
240 | ||
241 | ||
242 | ||
243 | --SB Plasma Shotgun 2013 | |
244 | ||
245 | --madiik's plasma shottie | |
246 | ||
247 | --variables | |
248 | ||
249 | ||
250 | ||
251 | --some more variables | |
252 | ||
253 | local spread = 1 | |
254 | -- end of some more variables | |
255 | ||
256 | local sound = Instance.new("Sound",head) | |
257 | sound.SoundId = "http://www.roblox.com/asset?id=10209842" | |
258 | sound.Volume = 2 | |
259 | sound.Pitch = 1 | |
260 | ||
261 | ||
262 | ||
263 | ||
264 | ||
265 | ||
266 | ||
267 | local sound2 = Instance.new("Sound",head) | |
268 | sound2.SoundId = "http://www.roblox.com/asset?id=10209881" | |
269 | sound2.Volume = 1 | |
270 | sound2.Pitch = 1 | |
271 | ||
272 | ||
273 | ||
274 | ||
275 | ||
276 | ||
277 | ||
278 | function attach(weld, part0, part1) | |
279 | weld.Part0 = part0 | |
280 | weld.Part1 = part1 | |
281 | end | |
282 | ||
283 | ||
284 | ||
285 | ||
286 | ||
287 | ||
288 | ||
289 | ||
290 | ||
291 | --create func | |
292 | function part(parent, size, color, formfactor, collide, transparency) | |
293 | if transparency == nil then transparency = 0 end | |
294 | if collide == nil then collide = false end | |
295 | if formfactor == nil then formfactor = Enum.FormFactor.Custom end | |
296 | local p=Instance.new("Part", parent) | |
297 | p.FormFactor=formfactor | |
298 | p.CanCollide=false | |
299 | p.Size=size | |
300 | p.Locked=true | |
301 | p.Transparency=transparency | |
302 | p.Position=torso.Position | |
303 | p.BrickColor=color | |
304 | p.FrontSurface="SmoothNoOutlines" | |
305 | p.BackSurface="SmoothNoOutlines" | |
306 | p.LeftSurface="SmoothNoOutlines" | |
307 | p.BottomSurface="SmoothNoOutlines" | |
308 | p.TopSurface="SmoothNoOutlines" | |
309 | p.RightSurface="SmoothNoOutlines" | |
310 | return p | |
311 | end | |
312 | function wedge(parent, size, color, formfactor, collide, transparency) | |
313 | ||
314 | if transparency == nil then transparency = 0 end | |
315 | if collide == nil then collide = false end | |
316 | if formfactor == nil then formfactor = Enum.FormFactor.Custom end | |
317 | ||
318 | local p=Instance.new("WedgePart", parent) | |
319 | p.FormFactor=formfactor | |
320 | p.CanCollide=false | |
321 | p.Size=size | |
322 | p.Locked=true | |
323 | p.Position = torso.Position | |
324 | p.BrickColor=color | |
325 | p.FrontSurface="SmoothNoOutlines" | |
326 | p.BackSurface="SmoothNoOutlines" | |
327 | p.LeftSurface="SmoothNoOutlines" | |
328 | p.BottomSurface="SmoothNoOutlines" | |
329 | p.TopSurface="SmoothNoOutlines" | |
330 | p.RightSurface="SmoothNoOutlines" | |
331 | return p | |
332 | end | |
333 | function weld(part0, part1, c0, parent, c1) | |
334 | if parent == nil then parent = gun end | |
335 | if c1 == nil then c1 = CFrame.new() end | |
336 | ||
337 | local wel=Instance.new("Weld", parent) | |
338 | wel.Part0 = part0 | |
339 | wel.Part1 = part1 | |
340 | wel.C0 = c0 | |
341 | wel.C1 = c1 | |
342 | return wel | |
343 | end | |
344 | function specialmesh(parent, meshType, scale, meshId) | |
345 | local mesh = Instance.new("SpecialMesh", parent) | |
346 | mesh.Scale = scale | |
347 | mesh.MeshType = meshType | |
348 | mesh.MeshId = meshId | |
349 | return mesh | |
350 | end | |
351 | ||
352 | ||
353 | --some ray functi0n | |
354 | ||
355 | function rayCast2(speed, gravity, from) | |
356 | coroutine.wrap(function() | |
357 | if char.Humanoid.Health == 0 then return end | |
358 | local rayP = Instance.new("Part") | |
359 | rayP.Name = "rayP" | |
360 | rayP.BrickColor = BrickColor.new("New Yeller") | |
361 | rayP.Material = 'Neon' | |
362 | rayP.Anchored = true | |
363 | rayP.CanCollide = false | |
364 | rayP.Locked = true | |
365 | rayP.TopSurface = Enum.SurfaceType.Smooth | |
366 | rayP.BottomSurface = Enum.SurfaceType.Smooth | |
367 | rayP.formFactor = Enum.FormFactor.Custom | |
368 | rayP.Size = Vector3.new(0.2, 0.2, 0.2) | |
369 | ||
370 | ||
371 | ||
372 | Instance.new("BlockMesh", rayP).Scale = Vector3.new(0.2, 0.2, 10) | |
373 | ||
374 | ||
375 | ||
376 | ||
377 | ||
378 | ||
379 | ||
380 | ||
381 | local bulletposition = from.Position + Vector3.new(0, 0.3, 0) | |
382 | ||
383 | local bulletvelocity = (Vector3.new(math.random(-spread*4,spread*4), math.random(-spread*4,spread*4), math.random(-spread*4,spread*4)))+( plr:GetMouse().Hit.p - bulletposition).unit*speed | |
384 | local bulletlastposition = bulletposition | |
385 | ||
386 | ||
387 | ||
388 | ||
389 | coroutine.resume(coroutine.create(function() | |
390 | while true do | |
391 | local dt = wait() | |
392 | bulletlastposition = bulletposition | |
393 | bulletvelocity = bulletvelocity + (Vector3.new(0, -14.81*gravity, 0)*dt) | |
394 | bulletposition = bulletposition + (bulletvelocity*dt) | |
395 | ||
396 | local ray = Ray.new(bulletlastposition, (bulletposition - bulletlastposition)) | |
397 | ||
398 | local hit, hitposition = workspace:FindPartOnRayWithIgnoreList( ray, { char, rayP, TrailPart} ) | |
399 | ||
400 | if (torso.Position - rayP.Position).magnitude > 540 then | |
401 | rayP:Destroy() | |
402 | break | |
403 | end | |
404 | ||
405 | ||
406 | if hit then | |
407 | local damage = math.random(10, 20) | |
408 | if hit.Parent:findFirstChild("Humanoid") ~= nil then | |
409 | hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - damage | |
410 | end | |
411 | if hit.Parent:IsA("Hat") and hit.Parent.Parent:findFirstChild("Humanoid") ~= nil then | |
412 | hit.Parent.Parent.Humanoid.Health = hit.Parent.Parent.Humanoid.Health - damage | |
413 | end | |
414 | bulletposition = hitposition | |
415 | rayP.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity) | |
416 | rayP:Destroy() | |
417 | break | |
418 | end | |
419 | rayP.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity) | |
420 | rayP.Parent = workspace | |
421 | end | |
422 | end)) | |
423 | end)() | |
424 | end | |
425 | ||
426 | ||
427 | ||
428 | ||
429 | ||
430 | ||
431 | ||
432 | --function attach(weld, part0, part1) | |
433 | --weld.Part0 = part0 | |
434 | --weld.Part1 = part1 | |
435 | --end | |
436 | ||
437 | ||
438 | ||
439 | ||
440 | ||
441 | ||
442 | ||
443 | ||
444 | ||
445 | ||
446 | ||
447 | ||
448 | ||
449 | ||
450 | ||
451 | ||
452 | ||
453 | ||
454 | ||
455 | ||
456 | ||
457 | ||
458 | ||
459 | ||
460 | ||
461 | ||
462 | ||
463 | TmRed = false | |
464 | TmBlue = false | |
465 | TeamColor = BrickColor.new("Really Black") | |
466 | ||
467 | local BC = char["Body Colors"] | |
468 | BC.HeadColor = BrickColor.new("Pastel brown") | |
469 | BC.LeftArmColor = BrickColor.new("Pastel brown") | |
470 | BC.LeftLegColor = BrickColor.new("Pastel brown") | |
471 | BC.RightArmColor = BrickColor.new("Pastel brown") | |
472 | BC.RightLegColor = BrickColor.new("Pastel brown") | |
473 | BC.TorsoColor = BrickColor.new("Pastel brown") | |
474 | ||
475 | ||
476 | New = function(Object, Parent, Name, Data) | |
477 | local Object = Instance.new(Object) | |
478 | for Index, Value in pairs(Data or {}) do | |
479 | Object[Index] = Value | |
480 | end | |
481 | Object.Parent = Parent | |
482 | Object.Name = Name | |
483 | return Object | |
484 | end | |
485 | local AddInstance = function(Object, ...) | |
486 | local Obj = Instance.new(Object) | |
487 | for i,v in next,(...) do | |
488 | Obj[i] = v | |
489 | end | |
490 | return Obj | |
491 | end | |
492 | ||
493 | ||
494 | ||
495 | ||
496 | ||
497 | Team=function() | |
498 | ||
499 | local r=math.random(1,2) | |
500 | if r==1 then | |
501 | print('RED') | |
502 | script.Name = "TeamRed" | |
503 | TmRed = true | |
504 | for i,v in pairs(char:GetChildren()) do if v:IsA("Shirt") then v:Remove() end end | |
505 | for i,v in pairs(char:GetChildren()) do if v:IsA("Pants") then v:Remove() end end | |
506 | wait()shirt = Instance.new("Shirt", char) | |
507 | shirt.Name = "Shirt" | |
508 | pants = Instance.new("Pants", char) | |
509 | pants.Name = "Pants" | |
510 | char.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=69232230" | |
511 | char.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=69232580" | |
512 | TeamColor = BrickColor.new("Bright red") | |
513 | end | |
514 | ||
515 | if r==2 then | |
516 | print('BLUE') | |
517 | TmBlue = true | |
518 | script.Name = "TeamBlue" | |
519 | for i,v in pairs(char:GetChildren()) do if v:IsA("Shirt") then v:Remove() end end | |
520 | for i,v in pairs(char:GetChildren()) do if v:IsA("Pants") then v:Remove() end end | |
521 | wait()shirt = Instance.new("Shirt", char) | |
522 | shirt.Name = "Shirt" | |
523 | pants = Instance.new("Pants", char) | |
524 | pants.Name = "Pants" | |
525 | char.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=69232247" | |
526 | char.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=69232594" | |
527 | TeamColor = BrickColor.new("Bright blue") | |
528 | end | |
529 | print(''..r) | |
530 | end | |
531 | ||
532 | Team() | |
533 | ||
534 | ||
535 | ||
536 | local MusThingHat = AddInstance("Part",{ | |
537 | Parent = head, | |
538 | CFrame = head.CFrame, | |
539 | formFactor = "Symmetric", | |
540 | Size = Vector3.new(1, 1, 1), | |
541 | CanCollide = false, | |
542 | TopSurface = "Smooth", | |
543 | BottomSurface = "Smooth", | |
544 | Locked = true, | |
545 | BrickColor=BrickColor.new("Br. yellowish orange"), | |
546 | Transparency = 1, | |
547 | }) | |
548 | local Weld = AddInstance("Weld",{ | |
549 | Parent = MusThingHat, | |
550 | Part0 = head, | |
551 | C0 = CFrame.new(0,0.5,0)*CFrame.Angles(0,0,0), | |
552 | Part1 = MusThingHat, | |
553 | }) | |
554 | local Mesh = AddInstance("SpecialMesh",{ | |
555 | Parent = MusThingHat, | |
556 | ||
557 | Scale = Vector3.new(.1,0,.1), | |
558 | ||
559 | }) | |
560 | ||
561 | local Reaper = AddInstance("Part",{ | |
562 | Parent = head, | |
563 | CFrame = head.CFrame, | |
564 | formFactor = "Symmetric", | |
565 | Size = Vector3.new(1, 1, 1), | |
566 | CanCollide = false, | |
567 | TopSurface = "Smooth", | |
568 | BottomSurface = "Smooth", | |
569 | Locked = true, | |
570 | BrickColor=BrickColor.new("Br. yellowish orange"), | |
571 | }) | |
572 | local Weld = AddInstance("Weld",{ | |
573 | Parent = Reaper, | |
574 | Part0 = head, | |
575 | C0 = CFrame.new(-.04,.7,-.1)*CFrame.Angles(0,0,.08), | |
576 | Part1 = Reaper, | |
577 | }) | |
578 | local Mesh = AddInstance("SpecialMesh",{ | |
579 | Parent = Reaper, | |
580 | MeshId = "rbxassetid://1073659", | |
581 | Scale = Vector3.new(1.06,1.05,1.06), | |
582 | VertexColor = Vector3.new(1,1,1), | |
583 | }) | |
584 | ||
585 | local Helmpart2 = AddInstance("Part",{ | |
586 | Parent = head, | |
587 | CFrame = head.CFrame, | |
588 | formFactor = "Symmetric", | |
589 | Size = Vector3.new(1, 1, 1), | |
590 | CanCollide = false, | |
591 | TopSurface = "Smooth", | |
592 | BottomSurface = "Smooth", | |
593 | Locked = true, | |
594 | BrickColor=BrickColor.new("White"), | |
595 | }) | |
596 | local Weld = AddInstance("Weld",{ | |
597 | Parent = Helmpart2, | |
598 | Part0 = head, | |
599 | C0 = CFrame.new(.01,.4,.05)*CFrame.Angles(.1,0,-.02), | |
600 | Part1 = Helmpart2, | |
601 | }) | |
602 | local Mesh = AddInstance("SpecialMesh",{ | |
603 | Parent = Helmpart2, | |
604 | Scale = Vector3.new(1.28,.48,1.28), | |
605 | VertexColor = Vector3.new(1,1,1), | |
606 | }) | |
607 | ||
608 | ||
609 | local Glassespart2 = AddInstance("Part",{ | |
610 | Parent = head, | |
611 | CFrame = head.CFrame, | |
612 | formFactor = "Symmetric", | |
613 | Size = Vector3.new(1, 1, 1), | |
614 | CanCollide = false, | |
615 | TopSurface = "Smooth", | |
616 | BottomSurface = "Smooth", | |
617 | Locked = true, | |
618 | BrickColor=BrickColor.new("Really black"), | |
619 | }) | |
620 | local Weld = AddInstance("Weld",{ | |
621 | Parent = Glassespart2, | |
622 | Part0 = head, | |
623 | C0 = CFrame.new(0,.35,0)*CFrame.Angles(0,0,0), | |
624 | Part1 = Glassespart2, | |
625 | }) | |
626 | local Mesh = AddInstance("SpecialMesh",{ | |
627 | Parent = Glassespart2, | |
628 | Scale = Vector3.new(1.27,.5,1.27), | |
629 | VertexColor = Vector3.new(1,1,1), | |
630 | }) | |
631 | ||
632 | ||
633 | ||
634 | ||
635 | ||
636 | ||
637 | ||
638 | ||
639 | local Reaper3 = AddInstance("Part",{ | |
640 | Parent = head, | |
641 | CFrame = head.CFrame, | |
642 | formFactor = "Symmetric", | |
643 | Size = Vector3.new(1, 1, 1), | |
644 | CanCollide = false, | |
645 | TopSurface = "Smooth", | |
646 | BottomSurface = "Smooth", | |
647 | Locked = true, | |
648 | BrickColor=BrickColor.new("Gold"), | |
649 | }) | |
650 | local Weld = AddInstance("Weld",{ | |
651 | Parent = Reaper3, | |
652 | Part0 = head, | |
653 | C0 = CFrame.new(0,.3,-0.02)*CFrame.Angles(-.1,0,0), | |
654 | Part1 = Reaper3, | |
655 | }) | |
656 | local Mesh = AddInstance("SpecialMesh",{ | |
657 | Parent = Reaper3, | |
658 | MeshId = "rbxassetid://19380122", | |
659 | TextureId = "rbxassetid://19380117", | |
660 | Scale = Vector3.new(.9,1,1), | |
661 | VertexColor = Vector3.new(1,1,1), | |
662 | }) | |
663 | ||
664 | ||
665 | ||
666 | ||
667 | ||
668 | ||
669 | ||
670 | local Reaper4 = AddInstance("Part",{ | |
671 | Parent = RightArm, | |
672 | CFrame = RightArm.CFrame, | |
673 | formFactor = "Symmetric", | |
674 | Size = Vector3.new(0.1, 0.5, 3), | |
675 | CanCollide = false, | |
676 | TopSurface = "Smooth", | |
677 | BottomSurface = "Smooth", | |
678 | Locked = true, | |
679 | Transparency = 0 | |
680 | }) | |
681 | local Weld = AddInstance("Weld",{ | |
682 | Parent = Reaper4, | |
683 | Part0 = RightArm, | |
684 | C0 = CFrame.new(-0.35,-1.8,-0.4)*CFrame.Angles(4.7,3.4,0), | |
685 | Part1 = Reaper4, | |
686 | }) | |
687 | local Mesh = AddInstance("SpecialMesh",{ | |
688 | Parent = Reaper4, | |
689 | MeshId = "rbxassetid://470533002", | |
690 | TextureId = "rbxassetid://470533004", | |
691 | Scale = Vector3.new(.03,.03,.03), | |
692 | VertexColor = Vector3.new(1,1,1), | |
693 | }) | |
694 | ||
695 | local GunFire = AddInstance("Part",{ | |
696 | Parent = RightArm, | |
697 | CFrame = RightArm.CFrame, | |
698 | formFactor = "Symmetric", | |
699 | Size = Vector3.new(0.1, 0.1, 0.1), | |
700 | CanCollide = false, | |
701 | TopSurface = "Smooth", | |
702 | BottomSurface = "Smooth", | |
703 | Locked = true, | |
704 | Transparency = 1 | |
705 | }) | |
706 | local Weld = AddInstance("Weld",{ | |
707 | Parent = GunFire, | |
708 | Part0 = RightArm, | |
709 | C0 = CFrame.new(-0.8,-3.5,-0.7)*CFrame.Angles(4.7,3.4,0), | |
710 | Part1 = GunFire, | |
711 | }) | |
712 | ||
713 | ||
714 | local GunParticle = Instance.new("ParticleEmitter", GunFire); | |
715 | GunParticle.VelocitySpread = 60; | |
716 | GunParticle.LightEmission = 200; | |
717 | ||
718 | local Colors2 = {Color3.new(1,.5,0), Color3.new(1,.7,0), Color3.new(1,.9,0);} | |
719 | GunParticle.Size = NumberSequence.new(.05,.07); | |
720 | ||
721 | GunParticle.Color = ColorSequence.new(Colors2[math.random(#Colors2)]); | |
722 | GunParticle.Texture = "rbxassetid://252350680"; | |
723 | GunParticle.RotSpeed = NumberRange.new(10,70); | |
724 | GunParticle.Rate = 600; | |
725 | GunParticle.Speed = NumberRange.new(15); | |
726 | GunParticle.Transparency = NumberSequence.new(0,1); | |
727 | GunParticle.Lifetime = NumberRange.new(.01,.2); | |
728 | GunParticle.EmissionDirection = 'Back' | |
729 | GunParticle.Enabled = false | |
730 | ||
731 | ||
732 | ||
733 | ||
734 | ||
735 | ||
736 | ||
737 | ||
738 | local Reaper5 = AddInstance("Part",{ | |
739 | Parent = RightArm, | |
740 | CFrame = RightArm.CFrame, | |
741 | formFactor = "Symmetric", | |
742 | Size = Vector3.new(0.1, 0.5, 3), | |
743 | CanCollide = false, | |
744 | TopSurface = "Smooth", | |
745 | BottomSurface = "Smooth", | |
746 | Locked = true, | |
747 | Transparency = 1 | |
748 | }) | |
749 | local Weld = AddInstance("Weld",{ | |
750 | Parent = Reaper5, | |
751 | Part0 = RightArm, | |
752 | C0 = CFrame.new(-.1,-0.75,-.7)*CFrame.Angles(1.5,0,3), | |
753 | Part1 = Reaper5, | |
754 | }) | |
755 | local Mesh = AddInstance("SpecialMesh",{ | |
756 | Parent = Reaper5, | |
757 | MeshId = "rbxassetid://431003868", | |
758 | TextureId = "rbxassetid://430627740", | |
759 | Scale = Vector3.new(1.93,1.99,1.99), | |
760 | VertexColor = Vector3.new(1,1,1), | |
761 | }) | |
762 | ||
763 | ||
764 | ||
765 | local Arms = AddInstance("Model",{ | |
766 | Parent = cam, | |
767 | Name = "Arms", | |
768 | ||
769 | ||
770 | }) | |
771 | ||
772 | local Arm1 = AddInstance("Part",{ | |
773 | Parent = Arms, | |
774 | Name = "RightArm", | |
775 | CFrame = RightArm.CFrame, | |
776 | formFactor = "Symmetric", | |
777 | Size = Vector3.new(.85,1.85,.85), | |
778 | CanCollide = false, | |
779 | Material = "SmoothPlastic", | |
780 | TopSurface = "Smooth", | |
781 | BottomSurface = "Smooth", | |
782 | Locked = true, | |
783 | BrickColor=BrickColor.new("Pastel brown"), | |
784 | Transparency = 0 | |
785 | }) | |
786 | local Weld = AddInstance("Weld",{ | |
787 | Parent = Arm1, | |
788 | Part0 = RightArm, | |
789 | C0 = CFrame.new(0,0,0)*CFrame.Angles(0,0,0), | |
790 | Part1 = Arm1, | |
791 | }) | |
792 | ||
793 | local Arm2 = AddInstance("Part",{ | |
794 | Parent = Arms, | |
795 | Name = "LeftArm", | |
796 | CFrame = LeftArm.CFrame, | |
797 | formFactor = "Symmetric", | |
798 | Size = Vector3.new(.85,1.85,.85), | |
799 | CanCollide = false, | |
800 | Material = "SmoothPlastic", | |
801 | TopSurface = "Smooth", | |
802 | BottomSurface = "Smooth", | |
803 | Locked = true, | |
804 | BrickColor=BrickColor.new("Pastel brown"), | |
805 | Transparency = 0 | |
806 | }) | |
807 | local Weld = AddInstance("Weld",{ | |
808 | Parent = Arm2, | |
809 | Part0 = LeftArm, | |
810 | C0 = CFrame.new(0,0,0)*CFrame.Angles(0,0,0), | |
811 | Part1 = Arm2, | |
812 | }) | |
813 | ||
814 | ||
815 | ||
816 | ||
817 | local Arm3 = AddInstance("Part",{ | |
818 | Parent = Arms, | |
819 | Name = "RightArm", | |
820 | CFrame = RightArm.CFrame, | |
821 | formFactor = "Symmetric", | |
822 | Size = Vector3.new(.9,.9,.9), | |
823 | CanCollide = false, | |
824 | Material = "SmoothPlastic", | |
825 | TopSurface = "Smooth", | |
826 | BottomSurface = "Smooth", | |
827 | Locked = true, | |
828 | BrickColor=TeamColor, | |
829 | Transparency = 0 | |
830 | }) | |
831 | local Weld = AddInstance("Weld",{ | |
832 | Parent = Arm3, | |
833 | Part0 = RightArm, | |
834 | C0 = CFrame.new(0,.5,0)*CFrame.Angles(0,0,0), | |
835 | Part1 = Arm3, | |
836 | }) | |
837 | ||
838 | local Arm4 = AddInstance("Part",{ | |
839 | Parent = Arms, | |
840 | Name = "LeftArm", | |
841 | CFrame = LeftArm.CFrame, | |
842 | formFactor = "Symmetric", | |
843 | Size = Vector3.new(.9,.9,.9), | |
844 | CanCollide = false, | |
845 | Material = "SmoothPlastic", | |
846 | TopSurface = "Smooth", | |
847 | BottomSurface = "Smooth", | |
848 | Locked = true, | |
849 | BrickColor=TeamColor, | |
850 | Transparency = 0 | |
851 | }) | |
852 | local Weld = AddInstance("Weld",{ | |
853 | Parent = Arm4, | |
854 | Part0 = LeftArm, | |
855 | C0 = CFrame.new(0,.5,0)*CFrame.Angles(0,0,0), | |
856 | Part1 = Arm4, | |
857 | }) | |
858 | local Arm5 = AddInstance("Part",{ | |
859 | Parent = Arms, | |
860 | Name = "RightArm", | |
861 | CFrame = RightArm.CFrame, | |
862 | formFactor = "Symmetric", | |
863 | Size = Vector3.new(.86,.8,.86), | |
864 | CanCollide = false, | |
865 | Material = "SmoothPlastic", | |
866 | TopSurface = "Smooth", | |
867 | BottomSurface = "Smooth", | |
868 | Locked = true, | |
869 | BrickColor=BrickColor.new("Br. yellowish orange"), | |
870 | Transparency = 0 | |
871 | }) | |
872 | local Weld = AddInstance("Weld",{ | |
873 | Parent = Arm5, | |
874 | Part0 = RightArm, | |
875 | C0 = CFrame.new(0,-.55,0)*CFrame.Angles(0,0,0), | |
876 | Part1 = Arm5, | |
877 | }) | |
878 | ||
879 | local Reaper6 = AddInstance("Part",{ | |
880 | Parent = Arms, | |
881 | CFrame = RightArm.CFrame, | |
882 | formFactor = "Symmetric", | |
883 | Size = Vector3.new(0.1, 0.1, .1), | |
884 | CanCollide = false, | |
885 | TopSurface = "Smooth", | |
886 | BottomSurface = "Smooth", | |
887 | Locked = true, | |
888 | Transparency = 1 | |
889 | }) | |
890 | local Weld = AddInstance("Weld",{ | |
891 | Parent = Reaper6, | |
892 | Part0 = RightArm, | |
893 | C0 = CFrame.new(-0.35,-1.8,-0.4)*CFrame.Angles(4.7,3.4,0), | |
894 | Part1 = Reaper6, | |
895 | }) | |
896 | local Mesh = AddInstance("SpecialMesh",{ | |
897 | Parent = Reaper6, | |
898 | MeshId = "rbxassetid://470533002", | |
899 | TextureId = "rbxassetid://470533004", | |
900 | Scale = Vector3.new(.029,.029,.029), | |
901 | VertexColor = Vector3.new(1,1,1), | |
902 | }) | |
903 | ||
904 | ||
905 | ||
906 | ||
907 | ||
908 | ||
909 | ||
910 | ||
911 | ||
912 | ||
913 | ||
914 | ||
915 | ||
916 | local Reaper7 = AddInstance("Part",{ | |
917 | Parent = Arms, | |
918 | CFrame = RightArm.CFrame, | |
919 | formFactor = "Symmetric", | |
920 | Size = Vector3.new(0.1, 0.5, 3), | |
921 | CanCollide = false, | |
922 | TopSurface = "Smooth", | |
923 | BottomSurface = "Smooth", | |
924 | Locked = true, | |
925 | Transparency = 1 | |
926 | }) | |
927 | local Weld = AddInstance("Weld",{ | |
928 | Parent = Reaper7, | |
929 | Part0 = RightArm, | |
930 | C0 = CFrame.new(-.1,-0.75,-.7)*CFrame.Angles(1.5,0,3), | |
931 | Part1 = Reaper7, | |
932 | }) | |
933 | local Mesh = AddInstance("SpecialMesh",{ | |
934 | Parent = Reaper7, | |
935 | MeshId = "rbxassetid://431003868", | |
936 | TextureId = "rbxassetid://430627740", | |
937 | Scale = Vector3.new(1.9,1.98,1.98), | |
938 | VertexColor = Vector3.new(1,1,1), | |
939 | }) | |
940 | ||
941 | ||
942 | head.face.Texture = "http://www.roblox.com/asset/?id=156600391" | |
943 | local NeckCF = cn(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
944 | Humanoid.Animator:Destroy() | |
945 | Character.Animate:Destroy() | |
946 | ||
947 | local RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14) | |
948 | local RHCF = CFrame.fromEulerAnglesXYZ(0, 1.6, 0) | |
949 | local LHCF = CFrame.fromEulerAnglesXYZ(0, -1.6, 0) | |
950 | ||
951 | ||
952 | RSH, LSH = nil, nil | |
953 | ||
954 | RW = Instance.new("Weld") | |
955 | LW = Instance.new("Weld") | |
956 | ||
957 | RH = Torso["Right Hip"] | |
958 | LH = Torso["Left Hip"] | |
959 | ||
960 | RSH = Torso["Right Shoulder"] | |
961 | LSH = Torso["Left Shoulder"] | |
962 | ||
963 | RSH.Parent = nil | |
964 | LSH.Parent = nil | |
965 | ||
966 | RW.Name = "RW" | |
967 | RW.Part0 = Torso | |
968 | RW.C0 = cn(1.5, 0.5, 0) | |
969 | RW.C1 = cn(0, 0.5, 0) | |
970 | RW.Part1 = RightArm | |
971 | RW.Parent = Torso | |
972 | ||
973 | LW.Name = "LW" | |
974 | LW.Part0 = Torso | |
975 | LW.C0 = cn(-1.5, 0.5, 0) | |
976 | LW.C1 = cn(0, 0.5, 0) | |
977 | LW.Part1 = LeftArm | |
978 | LW.Parent = Torso | |
979 | ||
980 | function clerp(a, b, t) | |
981 | local qa = { | |
982 | QuaternionFromCFrame(a) | |
983 | } | |
984 | local qb = { | |
985 | QuaternionFromCFrame(b) | |
986 | } | |
987 | local ax, ay, az = a.x, a.y, a.z | |
988 | local bx, by, bz = b.x, b.y, b.z | |
989 | local _t = 1 - t | |
990 | return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t)) | |
991 | end | |
992 | ||
993 | function QuaternionFromCFrame(cf) | |
994 | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() | |
995 | local trace = m00 + m11 + m22 | |
996 | if trace > 0 then | |
997 | local s = math.sqrt(1 + trace) | |
998 | local recip = 0.5 / s | |
999 | return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5 | |
1000 | else | |
1001 | local i = 0 | |
1002 | if m11 > m00 then | |
1003 | i = 1 | |
1004 | end | |
1005 | if m22 > (i == 0 and m00 or m11) then | |
1006 | i = 2 | |
1007 | end | |
1008 | if i == 0 then | |
1009 | local s = math.sqrt(m00 - m11 - m22 + 1) | |
1010 | local recip = 0.5 / s | |
1011 | return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip | |
1012 | elseif i == 1 then | |
1013 | local s = math.sqrt(m11 - m22 - m00 + 1) | |
1014 | local recip = 0.5 / s | |
1015 | return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip | |
1016 | elseif i == 2 then | |
1017 | local s = math.sqrt(m22 - m00 - m11 + 1) | |
1018 | local recip = 0.5 / s | |
1019 | return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip | |
1020 | end | |
1021 | end | |
1022 | end | |
1023 | ||
1024 | function QuaternionToCFrame(px, py, pz, x, y, z, w) | |
1025 | local xs, ys, zs = x + x, y + y, z + z | |
1026 | local wx, wy, wz = w * xs, w * ys, w * zs | |
1027 | local xx = x * xs | |
1028 | local xy = x * ys | |
1029 | local xz = x * zs | |
1030 | local yy = y * ys | |
1031 | local yz = y * zs | |
1032 | local zz = z * zs | |
1033 | 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)) | |
1034 | end | |
1035 | ||
1036 | function QuaternionSlerp(a, b, t) | |
1037 | local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4] | |
1038 | local startInterp, finishInterp; | |
1039 | if cosTheta >= 0.0001 then | |
1040 | if (1 - cosTheta) > 0.0001 then | |
1041 | local theta = math.acos(cosTheta) | |
1042 | local invSinTheta = 1 / math.sin(theta) | |
1043 | startInterp = math.sin((1 - t) * theta) * invSinTheta | |
1044 | finishInterp = math.sin(t * theta) * invSinTheta | |
1045 | else | |
1046 | startInterp = 1 - t | |
1047 | finishInterp = t | |
1048 | end | |
1049 | else | |
1050 | if (1 + cosTheta) > 0.0001 then | |
1051 | local theta = math.acos(-cosTheta) | |
1052 | local invSinTheta = 1 / math.sin(theta) | |
1053 | startInterp = math.sin((t - 1) * theta) * invSinTheta | |
1054 | finishInterp = math.sin(t * theta) * invSinTheta | |
1055 | else | |
1056 | startInterp = t - 1 | |
1057 | finishInterp = t | |
1058 | end | |
1059 | end | |
1060 | 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 | |
1061 | end | |
1062 | ||
1063 | function swait(num) | |
1064 | if num == 0 or num == nil then | |
1065 | game:service'RunService'.RenderStepped:wait(0) | |
1066 | else | |
1067 | for i = 0, num do | |
1068 | game:service'RunService'.RenderStepped:wait(0) | |
1069 | end | |
1070 | end | |
1071 | end | |
1072 | ||
1073 | local RbxUtility = LoadLibrary("RbxUtility") | |
1074 | local Create = RbxUtility.Create | |
1075 | ||
1076 | function RemoveOutlines(part) | |
1077 | part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10 | |
1078 | end | |
1079 | ||
1080 | function CreatePart(FormFactor, Parent, Material, Reflectance, Transparency, BColor, Name, Size) | |
1081 | local Part = Create("Part"){ | |
1082 | formFactor = FormFactor, | |
1083 | Parent = Parent, | |
1084 | Reflectance = Reflectance, | |
1085 | Transparency = Transparency, | |
1086 | CanCollide = false, | |
1087 | Locked = true, | |
1088 | BrickColor = BrickColor.new(tostring(BColor)), | |
1089 | Name = Name, | |
1090 | Size = Size, | |
1091 | Material = Material, | |
1092 | } | |
1093 | RemoveOutlines(Part) | |
1094 | return Part | |
1095 | end | |
1096 | ||
1097 | function CreateMesh(Mesh, Part, MeshType, MeshId, OffSet, Scale) | |
1098 | local Msh = Create(Mesh){ | |
1099 | Parent = Part, | |
1100 | Offset = OffSet, | |
1101 | Scale = Scale, | |
1102 | } | |
1103 | if Mesh == "SpecialMesh" then | |
1104 | Msh.MeshType = MeshType | |
1105 | Msh.MeshId = MeshId | |
1106 | end | |
1107 | return Msh | |
1108 | end | |
1109 | ||
1110 | function CreateWeld(Parent, Part0, Part1, C0, C1) | |
1111 | local Weld = Create("Weld"){ | |
1112 | Parent = Parent, | |
1113 | Part0 = Part0, | |
1114 | Part1 = Part1, | |
1115 | C0 = C0, | |
1116 | C1 = C1, | |
1117 | } | |
1118 | return Weld | |
1119 | end | |
1120 | ||
1121 | function rayCast(Position, Direction, Range, Ignore) | |
1122 | return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore) | |
1123 | end | |
1124 | ||
1125 | function CreateSound(id, par, vol, pit) | |
1126 | coroutine.resume(coroutine.create(function() | |
1127 | local sou = Instance.new("Sound", par or workspace) | |
1128 | sou.Volume = vol | |
1129 | sou.Pitch = pit or 1 | |
1130 | sou.SoundId = id | |
1131 | wait() | |
1132 | sou:play() | |
1133 | game:GetService("Debris"):AddItem(sou, 6) | |
1134 | end)) | |
1135 | end | |
1136 | ||
1137 | local function getclosest(obj, distance) | |
1138 | local last, lastx = distance + 1 | |
1139 | for i, v in pairs(workspace:GetChildren()) do | |
1140 | if v:IsA'Model' and v ~= Character and v:findFirstChild('Humanoid') and v:findFirstChild('Torso') and v:findFirstChild('Humanoid').Health > 0 then | |
1141 | local t = v.Torso | |
1142 | local dist = (t.Position - obj.Position).magnitude | |
1143 | if dist <= distance then | |
1144 | if dist < last then | |
1145 | last = dist | |
1146 | lastx = v | |
1147 | end | |
1148 | end | |
1149 | end | |
1150 | end | |
1151 | return lastx | |
1152 | end | |
1153 | ||
1154 | function Damage(hit, damage, cooldown, Color1, Color2, HSound, HPitch) | |
1155 | for i, v in pairs(hit:GetChildren()) do | |
1156 | if v:IsA("Humanoid") and hit.Name ~= Character.Name then | |
1157 | local find = v:FindFirstChild("Hitz") | |
1158 | if not find then | |
1159 | if v.Parent:findFirstChild("Head") then | |
1160 | local BillG = Create("BillboardGui"){ | |
1161 | Parent = v.Parent.Head, | |
1162 | Size = UDim2.new(1, 0, 1, 0), | |
1163 | Adornee = v.Parent.Head, | |
1164 | StudsOffset = Vector3.new(math.random(-3, 3), math.random(3, 5), math.random(-3, 3)), | |
1165 | } | |
1166 | local TL = Create("TextLabel"){ | |
1167 | Parent = BillG, | |
1168 | Size = UDim2.new(3, 3, 3, 3), | |
1169 | BackgroundTransparency = 1, | |
1170 | Text = tostring(damage).."-", | |
1171 | TextColor3 = Color1.Color, | |
1172 | TextStrokeColor3 = Color2.Color, | |
1173 | TextStrokeTransparency = 0, | |
1174 | TextXAlignment = Enum.TextXAlignment.Center, | |
1175 | TextYAlignment = Enum.TextYAlignment.Center, | |
1176 | FontSize = Enum.FontSize.Size18, | |
1177 | Font = "ArialBold", | |
1178 | } | |
1179 | coroutine.resume(coroutine.create(function() | |
1180 | wait(1) | |
1181 | for i = 0, 1, .1 do | |
1182 | wait(.1) | |
1183 | BillG.StudsOffset = BillG.StudsOffset + Vector3.new(0, .1, 0) | |
1184 | end | |
1185 | BillG:Destroy() | |
1186 | end)) | |
1187 | end | |
1188 | v.Health = v.Health - damage | |
1189 | local bool = Create("BoolValue"){ | |
1190 | Parent = v, | |
1191 | Name = 'Hitz', | |
1192 | } | |
1193 | if HSound ~= nil and HPitch ~= nil then | |
1194 | CreateSound(HSound, hit, 1, HPitch) | |
1195 | end | |
1196 | game:GetService("Debris"):AddItem(bool, cooldown) | |
1197 | end | |
1198 | end | |
1199 | end | |
1200 | end | |
1201 | ||
1202 | ||
1203 | function BlockEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay, Type) | |
1204 | local prt = CreatePart(3, workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new()) | |
1205 | prt.Anchored = true | |
1206 | prt.CFrame = cframe | |
1207 | local msh = CreateMesh("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
1208 | game:GetService("Debris"):AddItem(prt, 10) | |
1209 | if Type == 1 or Type == nil then | |
1210 | table.insert(Effects, { | |
1211 | prt, | |
1212 | "Block1", | |
1213 | delay, | |
1214 | x3, | |
1215 | y3, | |
1216 | z3, | |
1217 | msh | |
1218 | }) | |
1219 | elseif Type == 2 then | |
1220 | table.insert(Effects, { | |
1221 | prt, | |
1222 | "Block2", | |
1223 | delay, | |
1224 | x3, | |
1225 | y3, | |
1226 | z3, | |
1227 | msh | |
1228 | }) | |
1229 | end | |
1230 | end | |
1231 | ||
1232 | function SphereEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay) | |
1233 | local prt = CreatePart(3, workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new()) | |
1234 | prt.Anchored = true | |
1235 | prt.CFrame = cframe | |
1236 | local msh = CreateMesh("SpecialMesh", prt, "Sphere", "nil", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
1237 | game:GetService("Debris"):AddItem(prt, 10) | |
1238 | table.insert(Effects, { | |
1239 | prt, | |
1240 | "Cylinder", | |
1241 | delay, | |
1242 | x3, | |
1243 | y3, | |
1244 | z3, | |
1245 | msh | |
1246 | }) | |
1247 | end | |
1248 | ||
1249 | function RingEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay) | |
1250 | local prt = CreatePart(3, workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new(0.5, 0.5, 0.5)) | |
1251 | prt.Anchored = true | |
1252 | prt.CFrame = cframe * CFrame.new(x1, y1, z1) | |
1253 | local msh = CreateMesh("SpecialMesh", prt, "FileMesh", "3270017", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
1254 | game:GetService("Debris"):AddItem(prt, 10) | |
1255 | table.insert(Effects, { | |
1256 | prt, | |
1257 | "Cylinder", | |
1258 | delay, | |
1259 | x3, | |
1260 | y3, | |
1261 | z3, | |
1262 | msh | |
1263 | }) | |
1264 | end | |
1265 | ||
1266 | function CylinderEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay) | |
1267 | local prt = CreatePart(3, workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new()) | |
1268 | prt.Anchored = true | |
1269 | prt.CFrame = cframe | |
1270 | local msh = CreateMesh("CylinderMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
1271 | game:GetService("Debris"):AddItem(prt, 10) | |
1272 | table.insert(Effects, { | |
1273 | prt, | |
1274 | "Cylinder", | |
1275 | delay, | |
1276 | x3, | |
1277 | y3, | |
1278 | z3, | |
1279 | msh | |
1280 | }) | |
1281 | end | |
1282 | ||
1283 | function WaveEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay) | |
1284 | local prt = CreatePart(3, workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new()) | |
1285 | prt.Anchored = true | |
1286 | prt.CFrame = cframe | |
1287 | local msh = CreateMesh("SpecialMesh", prt, "FileMesh", "20329976", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
1288 | game:GetService("Debris"):AddItem(prt, 10) | |
1289 | table.insert(Effects, { | |
1290 | prt, | |
1291 | "Cylinder", | |
1292 | delay, | |
1293 | x3, | |
1294 | y3, | |
1295 | z3, | |
1296 | msh | |
1297 | }) | |
1298 | end | |
1299 | ||
1300 | function SpecialEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay) | |
1301 | local prt = CreatePart(3, workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new()) | |
1302 | prt.Anchored = true | |
1303 | prt.CFrame = cframe | |
1304 | local msh = CreateMesh("SpecialMesh", prt, "FileMesh", "24388358", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
1305 | game:GetService("Debris"):AddItem(prt, 10) | |
1306 | table.insert(Effects, { | |
1307 | prt, | |
1308 | "Cylinder", | |
1309 | delay, | |
1310 | x3, | |
1311 | y3, | |
1312 | z3, | |
1313 | msh | |
1314 | }) | |
1315 | end | |
1316 | ||
1317 | function BreakEffect(brickcolor, cframe, x1, y1, z1) | |
1318 | local prt = CreatePart(3, workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new(0.5, 0.5, 0.5)) | |
1319 | prt.Anchored = true | |
1320 | prt.CFrame = cframe * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)) | |
1321 | local msh = CreateMesh("SpecialMesh", prt, "Sphere", "nil", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1)) | |
1322 | local num = math.random(10, 50) / 1000 | |
1323 | game:GetService("Debris"):AddItem(prt, 10) | |
1324 | table.insert(Effects, { | |
1325 | prt, | |
1326 | "Shatter", | |
1327 | num, | |
1328 | prt.CFrame, | |
1329 | math.random() - math.random(), | |
1330 | 0, | |
1331 | math.random(50, 100) / 100 | |
1332 | }) | |
1333 | end | |
1334 | ||
1335 | ||
1336 | ||
1337 | ||
1338 | for i = 0, 1, 0.05 do | |
1339 | swait() | |
1340 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .1) | |
1341 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5), math.rad(0), math.rad(0)), .1) | |
1342 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(5), math.rad(0), math.rad(5)), 0.1) | |
1343 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(20), math.rad(0), math.rad(-10)), 0.3) | |
1344 | if Torsovelocity > 2 then | |
1345 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-50 * math.cos(sine / 4)), math.rad(0), math.rad(4 * math.cos(sine / 4))), .2) | |
1346 | RH.C0 = clerp(RH.C0, cn(1, -1 + .1 * math.cos(sine / 5), 0) * RHCF * angles(math.rad(-2), math.rad(0), math.rad(30 * math.cos(sine / 4))), .3) | |
1347 | LH.C0 = clerp(LH.C0, cn(-1, -1 + .1 * math.cos(sine / 5), 0) * LHCF * angles(math.rad(-2), math.rad(0), math.rad(30 * math.cos(sine / 4))), .3) | |
1348 | elseif Torsovelocity < 1 then | |
1349 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(5), math.rad(0), math.rad(5)), 0.1) | |
1350 | RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
1351 | LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
1352 | end | |
1353 | end | |
1354 | attack = false | |
1355 | ||
1356 | ||
1357 | ||
1358 | game:GetService'RunService'.Stepped:connect(function() | |
1359 | ||
1360 | ||
1361 | ||
1362 | if Wep == 1 then | |
1363 | equippedgun2 = false | |
1364 | Reaper4.Transparency = 1 | |
1365 | Reaper5.Transparency = 0 | |
1366 | Reaper6.Transparency = 1 | |
1367 | Reaper7.Transparency = 0 | |
1368 | end | |
1369 | if Wep == 2 then | |
1370 | equippedgun2 = true | |
1371 | Reaper4.Transparency = 0 | |
1372 | Reaper5.Transparency = 1 | |
1373 | Reaper6.Transparency = 0 | |
1374 | Reaper7.Transparency = 1 | |
1375 | end | |
1376 | if Wep == 3 then | |
1377 | equippedgun2 = false | |
1378 | Reaper4.Transparency = 1 | |
1379 | Reaper5.Transparency = 1 | |
1380 | Reaper6.Transparency = 1 | |
1381 | Reaper7.Transparency = 1 | |
1382 | end | |
1383 | ||
1384 | Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude | |
1385 | velocity = RootPart.Velocity.y | |
1386 | sine = sine + change | |
1387 | local hit, pos = rayCast(RootPart.Position, (CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0))).lookVector, 4, Character) | |
1388 | if equipped == true or equipped == false then | |
1389 | if RootPart.Velocity.y > 1 and hit == nil then | |
1390 | Anim = "Jump" | |
1391 | if attack == false and Wep == 1 then | |
1392 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
1393 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(10), math.rad(0), math.rad(0)), .1) | |
1394 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-40), math.rad(0), math.rad(30)), .1) | |
1395 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-40), math.rad(0), math.rad(-30)), .1) | |
1396 | RH.C0 = clerp(RH.C0, cn(1, -.9, -.3) * RHCF * angles(math.rad(3), math.rad(0), math.rad(0)), .1) | |
1397 | LH.C0 = clerp(LH.C0, cn(-1, -.7, -.5) * LHCF * angles(math.rad(-3), math.rad(0), math.rad(0)), .1) | |
1398 | end | |
1399 | elseif RootPart.Velocity.y < -1 and hit == nil then | |
1400 | Anim = "Fall" | |
1401 | if attack == false and Wep == 1 then | |
1402 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(10), math.rad(0), math.rad(0)), .1) | |
1403 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(10), math.rad(0), math.rad(0)), .1) | |
1404 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(50)), .1) | |
1405 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(-50)), .1) | |
1406 | RH.C0 = clerp(RH.C0, cn(1, -1, -.3) * RHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
1407 | LH.C0 = clerp(LH.C0, cn(-1, -.8, -.3) * LHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
1408 | end | |
1409 | elseif Torsovelocity < 1 and hit ~= nil then | |
1410 | Anim = "Idle" | |
1411 | if attack == false and Wep == 1 then | |
1412 | change = 1 | |
1413 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.1 + 0.1 * math.cos(sine / 25)) * angles(math.rad(0), math.rad(0), math.rad(5)), .1) | |
1414 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5 - 2 * math.cos(sine / 25)), math.rad(0), math.rad(-5)), .1) | |
1415 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5 - -.1 * math.cos(sine / 25), 0) * angles(math.rad(50), math.rad(35 - 25 * math.cos(sine / 25)), math.rad(5 + 3 * math.cos(sine / 25))), 0.1) | |
1416 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.4, -.4) * angles(math.rad(80 + 7 * math.cos(sine / 25)), math.rad(-30), math.rad(35 - 1 * math.cos(sine / 25))), 0.1) | |
1417 | RH.C0 = clerp(RH.C0, cn(1, -.9 - 0.1 * math.cos(sine / 25), 0) * RHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(-5), math.rad(0 + 2 * math.cos(sine / 25))), .1) | |
1418 | LH.C0 = clerp(LH.C0, cn(-1, -.9 - 0.1 * math.cos(sine / 25), 0) * LHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(-5), math.rad(0 + 2 * math.cos(sine / 25))), .1) | |
1419 | end | |
1420 | elseif Torsovelocity > 2 and hit ~= nil then | |
1421 | Anim = "Walk" | |
1422 | if attack == false and Wep == 1 then | |
1423 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.05 + .1 * math.cos(sine / 3)) * angles(math.rad(5), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(5 * math.cos(sine / 5))), .2) | |
1424 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(-5 * math.cos(sine / 5)) + RootPart.RotVelocity.Y / 9), .2) | |
1425 | RW.C0 = clerp(RW.C0, CFrame.new(1.2 - -.05 * math.cos(sine / 4), 0.5 - -.05 * math.cos(sine / 4), 0) * angles(math.rad(50), math.rad(57 - .1 * math.cos(sine / 25)), math.rad(5 + 3 * math.cos(sine / 25))), 0.1) | |
1426 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2 - -.05 * math.cos(sine / 4), 0.4 - -.05 * math.cos(sine / 4), -.4) * angles(math.rad(80 + 1 * math.cos(sine / 25)), math.rad(-30), math.rad(35 - 1 * math.cos(sine / 25))), 0.1) | |
1427 | RH.C0 = clerp(RH.C0, cn(1, -.9 + -.1 * math.cos(sine / 4),0 + -.1 * math.cos(sine / 4)) * RHCF * angles(math.rad(-2), math.rad(0), math.rad(50 * math.cos(sine / 4))), .3) | |
1428 | LH.C0 = clerp(LH.C0, cn(-1, -.9 + .1 * math.cos(sine / 4), 0 + .1 * math.cos(sine / 4)) * LHCF * angles(math.rad(-2), math.rad(0), math.rad(50 * math.cos(sine / 4))), .3) | |
1429 | end | |
1430 | end | |
1431 | end | |
1432 | -----------------------[Anim2]-------------------------------------------------------------------------------------------------------------------------- | |
1433 | ||
1434 | if equipped == true or equipped == false then | |
1435 | if RootPart.Velocity.y > 1 and hit == nil then | |
1436 | Anim = "Jump" | |
1437 | if attack == false and Wep == 2 then | |
1438 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
1439 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(10), math.rad(0), math.rad(0)), .1) | |
1440 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.2, 0) * angles(math.rad(60), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.1) | |
1441 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.1, -.4) * angles(math.rad(55 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.1) | |
1442 | RH.C0 = clerp(RH.C0, cn(1, -.9, -.3) * RHCF * angles(math.rad(3), math.rad(0), math.rad(0)), .1) | |
1443 | LH.C0 = clerp(LH.C0, cn(-1, -.7, -.5) * LHCF * angles(math.rad(-3), math.rad(0), math.rad(0)), .1) | |
1444 | end | |
1445 | ||
1446 | elseif RootPart.Velocity.y < -1 and hit == nil then | |
1447 | Anim = "Fall" | |
1448 | if attack == false and Wep == 2 then | |
1449 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(10), math.rad(0), math.rad(0)), .1) | |
1450 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(10), math.rad(0), math.rad(0)), .1) | |
1451 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.8, 0) * angles(math.rad(60), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.05) | |
1452 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.7, -.4) * angles(math.rad(55 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.05) | |
1453 | RH.C0 = clerp(RH.C0, cn(1, -1, -.3) * RHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
1454 | LH.C0 = clerp(LH.C0, cn(-1, -.8, -.3) * LHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
1455 | end | |
1456 | elseif Torsovelocity < 1 and hit ~= nil then | |
1457 | Anim = "Idle" | |
1458 | if attack == false and Wep == 2 then | |
1459 | change = 1 | |
1460 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.1 + 0.1 * math.cos(sine / 25)) * angles(math.rad(0), math.rad(0), math.rad(5)), .1) | |
1461 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5 - 2 * math.cos(sine / 25)), math.rad(0), math.rad(-5)), .1) | |
1462 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5, 0) * angles(math.rad(60), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.1) | |
1463 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.4, -.4) * angles(math.rad(55 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.1) | |
1464 | RH.C0 = clerp(RH.C0, cn(1, -.9 - 0.1 * math.cos(sine / 25), 0) * RHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(-5), math.rad(0 + 2 * math.cos(sine / 25))), .1) | |
1465 | LH.C0 = clerp(LH.C0, cn(-1, -.9 - 0.1 * math.cos(sine / 25), 0) * LHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(-5), math.rad(0 + 2 * math.cos(sine / 25))), .1) | |
1466 | end | |
1467 | elseif Torsovelocity > 2 and hit ~= nil then | |
1468 | Anim = "Walk" | |
1469 | if attack == false and Wep == 2 then | |
1470 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.05 + .1 * math.cos(sine / 3)) * angles(math.rad(5), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(-25 - 5 * math.cos(sine / 5))), .2) | |
1471 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(25 + 5 * math.cos(sine / 5)) + RootPart.RotVelocity.Y / 9), .2) | |
1472 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5, 0) * angles(math.rad(60), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.1) | |
1473 | - | RUS.SoundId = "rbxassetid://322621962" |
1473 | + | |
1474 | RH.C0 = clerp(RH.C0, cn(.95, -.9 + -.1 * math.cos(sine / 4),-.35) * RHCF * angles(math.rad(-2), math.rad(25), math.rad(50 * math.cos(sine / 4))), .3) | |
1475 | LH.C0 = clerp(LH.C0, cn(-.95, -.9 + .1 * math.cos(sine / 4), .35) * LHCF * angles(math.rad(-2), math.rad(25), math.rad(50 * math.cos(sine / 4))), .3) | |
1476 | end | |
1477 | ||
1478 | end | |
1479 | end | |
1480 | ||
1481 | ||
1482 | ||
1483 | -----------------------[Noraml Anim]-------------------------------------------------------------------------------------------------------------------------- | |
1484 | ||
1485 | if equipped == true or equipped == false then | |
1486 | if RootPart.Velocity.y > 1 and hit == nil then | |
1487 | Anim = "Jump" | |
1488 | if attack == false and Wep == 3 then | |
1489 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
1490 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(10), math.rad(0), math.rad(0)), .1) | |
1491 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-40), math.rad(0), math.rad(30)), .1) | |
1492 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-40), math.rad(0), math.rad(-30)), .1) | |
1493 | RH.C0 = clerp(RH.C0, cn(1, -.9, -.3) * RHCF * angles(math.rad(3), math.rad(0), math.rad(0)), .1) | |
1494 | LH.C0 = clerp(LH.C0, cn(-1, -.7, -.5) * LHCF * angles(math.rad(-3), math.rad(0), math.rad(0)), .1) | |
1495 | end | |
1496 | elseif RootPart.Velocity.y < -1 and hit == nil then | |
1497 | Anim = "Fall" | |
1498 | if attack == false and Wep == 3 then | |
1499 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(10), math.rad(0), math.rad(0)), .1) | |
1500 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(10), math.rad(0), math.rad(0)), .1) | |
1501 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(50)), .1) | |
1502 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(-50)), .1) | |
1503 | RH.C0 = clerp(RH.C0, cn(1, -1, -.3) * RHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
1504 | LH.C0 = clerp(LH.C0, cn(-1, -.8, -.3) * LHCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
1505 | end | |
1506 | elseif Torsovelocity < 1 and hit ~= nil then | |
1507 | Anim = "Idle" | |
1508 | if attack == false and Wep == 3 then | |
1509 | change = 1 | |
1510 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.1 + 0.1 * math.cos(sine / 25)) * angles(math.rad(0), math.rad(0), math.rad(5)), .1) | |
1511 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5 - 2 * math.cos(sine / 25)), math.rad(0), math.rad(-5)), .1) | |
1512 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5 - 0 * math.cos(sine / 25), 0) * angles(math.rad(0), math.rad(0 - 0 * math.cos(sine / 25)), math.rad(5 + 3 * math.cos(sine / 25))), 0.1) | |
1513 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0 + 0 * math.cos(sine / 25)), math.rad(-0), math.rad(-5 - 3 * math.cos(sine / 25))), 0.1) | |
1514 | RH.C0 = clerp(RH.C0, cn(1, -.9 - 0.1 * math.cos(sine / 25), 0) * RHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(-5), math.rad(0 + 2 * math.cos(sine / 25))), .1) | |
1515 | LH.C0 = clerp(LH.C0, cn(-1, -.9 - 0.1 * math.cos(sine / 25), 0) * LHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(-5), math.rad(0 + 2 * math.cos(sine / 25))), .1) | |
1516 | end | |
1517 | elseif Torsovelocity > 2 and hit ~= nil then | |
1518 | Anim = "Walk" | |
1519 | if attack == false and Wep == 3 then | |
1520 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.05 + .1 * math.cos(sine / 3)) * angles(math.rad(5), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(5 * math.cos(sine / 5))), .2) | |
1521 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(-5 * math.cos(sine / 5)) + RootPart.RotVelocity.Y / 9), .2) | |
1522 | RW.C0 = clerp(RW.C0, CFrame.new(1.5 - -0 * math.cos(sine / 4), 0.5 - -.05 * math.cos(sine / 4), 0) * angles(math.rad(10 + -50 * math.cos(sine / 4)), math.rad(0 - .1 * math.cos(sine / 25)), math.rad(5 + 3 * math.cos(sine / 25))), 0.3) | |
1523 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5 - -0 * math.cos(sine / 4), 0.5 - -.05 * math.cos(sine / 4), 0) * angles(math.rad(10 + 50 * math.cos(sine / 4)), math.rad(-0), math.rad(-5 - 3 * math.cos(sine / 25))), 0.3) | |
1524 | RH.C0 = clerp(RH.C0, cn(1, -.9 + -.1 * math.cos(sine / 4),0 + -.1 * math.cos(sine / 4)) * RHCF * angles(math.rad(-2), math.rad(0), math.rad(50 * math.cos(sine / 4))), .3) | |
1525 | LH.C0 = clerp(LH.C0, cn(-1, -.9 + .1 * math.cos(sine / 4), 0 + .1 * math.cos(sine / 4)) * LHCF * angles(math.rad(-2), math.rad(0), math.rad(50 * math.cos(sine / 4))), .3) | |
1526 | end | |
1527 | end | |
1528 | end | |
1529 | ||
1530 | ||
1531 | ||
1532 | ||
1533 | ||
1534 | ||
1535 | ||
1536 | ||
1537 | ||
1538 | ||
1539 | ||
1540 | ||
1541 | ||
1542 | ||
1543 | ||
1544 | ||
1545 | ||
1546 | ||
1547 | if #Effects > 0 then | |
1548 | for e = 1, #Effects do | |
1549 | if Effects[e] ~= nil then | |
1550 | local Thing = Effects[e] | |
1551 | if Thing ~= nil then | |
1552 | local Part = Thing[1] | |
1553 | local Mode = Thing[2] | |
1554 | local Delay = Thing[3] | |
1555 | local IncX = Thing[4] | |
1556 | local IncY = Thing[5] | |
1557 | local IncZ = Thing[6] | |
1558 | if Thing[1].Transparency <= 1 then | |
1559 | if Thing[2] == "Block1" then | |
1560 | Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)) | |
1561 | local Mesh = Thing[1].Mesh | |
1562 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6]) | |
1563 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
1564 | elseif Thing[2] == "Block2" then | |
1565 | Thing[1].CFrame = Thing[1].CFrame | |
1566 | local Mesh = Thing[7] | |
1567 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6]) | |
1568 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
1569 | elseif Thing[2] == "Cylinder" then | |
1570 | local Mesh = Thing[1].Mesh | |
1571 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6]) | |
1572 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
1573 | elseif Thing[2] == "Blood" then | |
1574 | local Mesh = Thing[7] | |
1575 | Thing[1].CFrame = Thing[1].CFrame * Vector3.new(0, .5, 0) | |
1576 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6]) | |
1577 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
1578 | elseif Thing[2] == "Elec" then | |
1579 | local Mesh = Thing[1].Mesh | |
1580 | Mesh.Scale = Mesh.Scale + Vector3.new(Thing[7], Thing[8], Thing[9]) | |
1581 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
1582 | elseif Thing[2] == "Disappear" then | |
1583 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
1584 | elseif Thing[2] == "Shatter" then | |
1585 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
1586 | Thing[4] = Thing[4] * CFrame.new(0, Thing[7], 0) | |
1587 | Thing[1].CFrame = Thing[4] * CFrame.fromEulerAnglesXYZ(Thing[6], 0, 0) | |
1588 | Thing[6] = Thing[6] + Thing[5] | |
1589 | end | |
1590 | else | |
1591 | Part.Parent = nil | |
1592 | table.remove(Effects, e) | |
1593 | end | |
1594 | end | |
1595 | end | |
1596 | end | |
1597 | end | |
1598 | end) | |
1599 | ||
1600 | ||
1601 | ||
1602 | ||
1603 | ||
1604 | ||
1605 | ||
1606 | ||
1607 | ||
1608 | ||
1609 | ||
1610 | ||
1611 | ||
1612 | local No = Instance.new("Sound", head); | |
1613 | No.SoundId = "rbxassetid://245064504" | |
1614 | No.Volume = 3 | |
1615 | local yes = Instance.new("Sound", head); | |
1616 | yes.SoundId = "rbxassetid://131384028" | |
1617 | yes.Volume = 3 | |
1618 | local HitM = Instance.new("Sound", Reaper5); | |
1619 | HitM.SoundId = "rbxassetid://"..WSH | |
1620 | HitM.Volume = 1.1 | |
1621 | local Swing = Instance.new("Sound", Reaper5); | |
1622 | Swing.SoundId = "rbxassetid://10209850" | |
1623 | Swing.Volume = 1.5 | |
1624 | Swing.Pitch = 1.1 | |
1625 | local SwingH = Instance.new("Sound", Reaper5); | |
1626 | SwingH.SoundId = "rbxassetid://10209590" | |
1627 | SwingH.Volume = 2.9 | |
1628 | SwingH.Pitch = .8 | |
1629 | local Taunt = Instance.new("Sound", head); | |
1630 | Taunt.SoundId = "rbxassetid://150611842" | |
1631 | Taunt.Volume = 2 | |
1632 | local RUS = Instance.new("Sound", char); | |
1633 | RUS.SoundId = "rbxassetid://2385137061" | |
1634 | RUS.Volume = 2.5 | |
1635 | RUS.Pitch = 1 | |
1636 | RUS.Looped = true | |
1637 | ||
1638 | ||
1639 | ||
1640 | ||
1641 | ||
1642 | ||
1643 | ||
1644 | ||
1645 | ||
1646 | ||
1647 | function BuildSentry() | |
1648 | do --CFrame lerp (stravant, clerp by AntiBoomz0r) | |
1649 | local function QuaternionFromCFrame(cf) -- y u no axis angle interpolation? | |
1650 | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() | |
1651 | local trace = m00 + m11 + m22 | |
1652 | if trace > 0 then | |
1653 | local s = math.sqrt(1 + trace) | |
1654 | local recip = 0.5/s | |
1655 | return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5 | |
1656 | else | |
1657 | local i = 0 | |
1658 | if m11 > m00 then | |
1659 | i = 1 | |
1660 | end | |
1661 | if m22 > (i == 0 and m00 or m11) then | |
1662 | i = 2 | |
1663 | end | |
1664 | if i == 0 then | |
1665 | local s = math.sqrt(m00-m11-m22+1) | |
1666 | local recip = 0.5/s | |
1667 | return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip | |
1668 | elseif i == 1 then | |
1669 | local s = math.sqrt(m11-m22-m00+1) | |
1670 | local recip = 0.5/s | |
1671 | return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip | |
1672 | elseif i == 2 then | |
1673 | local s = math.sqrt(m22-m00-m11+1) | |
1674 | local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip | |
1675 | end | |
1676 | end | |
1677 | end | |
1678 | local function QuaternionToCFrame(px, py, pz, x, y, z, w) | |
1679 | local xs, ys, zs = x + x, y + y, z + z | |
1680 | local wx, wy, wz = w*xs, w*ys, w*zs | |
1681 | local xx = x*xs | |
1682 | local xy = x*ys | |
1683 | local xz = x*zs | |
1684 | local yy = y*ys | |
1685 | local yz = y*zs | |
1686 | local zz = z*zs | |
1687 | 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)) | |
1688 | end | |
1689 | function QuaternionSlerp(a, b, t) | |
1690 | local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4] | |
1691 | local startInterp, finishInterp; | |
1692 | if cosTheta >= 0.0001 then | |
1693 | if (1 - cosTheta) > 0.0001 then | |
1694 | local theta = math.acos(cosTheta) | |
1695 | local invSinTheta = 1/math.sin(theta) | |
1696 | startInterp = math.sin((1-t)*theta)*invSinTheta | |
1697 | finishInterp = math.sin(t*theta)*invSinTheta | |
1698 | else | |
1699 | startInterp = 1-t | |
1700 | finishInterp = t | |
1701 | end | |
1702 | else | |
1703 | if (1+cosTheta) > 0.0001 then | |
1704 | local theta = math.acos(-cosTheta) | |
1705 | local invSinTheta = 1/math.sin(theta) | |
1706 | startInterp = math.sin((t-1)*theta)*invSinTheta | |
1707 | finishInterp = math.sin(t*theta)*invSinTheta | |
1708 | else | |
1709 | startInterp = t-1 | |
1710 | finishInterp = t | |
1711 | end | |
1712 | end | |
1713 | 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 | |
1714 | end | |
1715 | function clerp(a,b,t) | |
1716 | local qa = {QuaternionFromCFrame(a)} | |
1717 | local qb = {QuaternionFromCFrame(b)} | |
1718 | local ax, ay, az = a.x, a.y, a.z | |
1719 | local bx, by, bz = b.x, b.y, b.z | |
1720 | local _t = 1-t | |
1721 | return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t)) | |
1722 | end | |
1723 | end | |
1724 | ||
1725 | ||
1726 | ||
1727 | ||
1728 | local ABS = math.abs; | |
1729 | local SIN = math.sin; | |
1730 | local ASIN = math.asin; | |
1731 | local COS = math.cos; | |
1732 | ||
1733 | local new = Instance.new; | |
1734 | ||
1735 | function math_pos(float) | |
1736 | if float < 0 then float = 0 end | |
1737 | return float | |
1738 | end | |
1739 | function math_neg(float) | |
1740 | if float > 0 then float = 0 end | |
1741 | return float | |
1742 | end | |
1743 | function math_max(float, max) | |
1744 | if float > max then float = max end | |
1745 | return float | |
1746 | end | |
1747 | function math_min(float, min) | |
1748 | if float > min then float = min end | |
1749 | return float | |
1750 | end | |
1751 | ||
1752 | function SharpSin(double_p1) | |
1753 | return ASIN(SIN(double_p1)); | |
1754 | end | |
1755 | ||
1756 | local Storage = Instance.new("Model", script); | |
1757 | ||
1758 | function WeldP(part0, part1, C0, C1) | |
1759 | local W = new("Weld", Storage); | |
1760 | W.Part0 = part0; | |
1761 | W.Part1 = part1; | |
1762 | W.C0 = C0 or CFrame.new(); | |
1763 | W.C1 = C1 or CFrame.new(); | |
1764 | return W; | |
1765 | end | |
1766 | ||
1767 | function Bevel(part, sizeV3) | |
1768 | local BvlMesh = new("SpecialMesh", part) | |
1769 | BvlMesh.MeshId = "rbxasset://fonts/torso.mesh"; | |
1770 | if (sizeV3 ~= nil) then | |
1771 | BvlMesh.Scale = Vector3.new(sizeV3.x/2, sizeV3.y/2, sizeV3.z); | |
1772 | else | |
1773 | BvlMesh.Scale = Vector3.new(part.Size.x/2, part.Size.y/2, part.Size.z); | |
1774 | end | |
1775 | end | |
1776 | ||
1777 | ||
1778 | ||
1779 | local Scale = 0.5 -- 1 is size of a robloxian (mostly); | |
1780 | ||
1781 | Storage.Name = "ä"; | |
1782 | ||
1783 | local BasePart = new("Part"); | |
1784 | BasePart.FormFactor = "Custom"; | |
1785 | BasePart.TopSurface = 10; | |
1786 | BasePart.BottomSurface = 10; | |
1787 | BasePart.LeftSurface = 10; | |
1788 | BasePart.RightSurface = 10; | |
1789 | BasePart.FrontSurface = 10; | |
1790 | BasePart.BackSurface = 10; | |
1791 | ||
1792 | local CylPart = new("Part"); | |
1793 | CylPart.FormFactor = "Custom"; | |
1794 | CylPart.TopSurface = 10; | |
1795 | CylPart.BottomSurface = 10; | |
1796 | CylPart.LeftSurface = 10; | |
1797 | CylPart.RightSurface = 10; | |
1798 | CylPart.FrontSurface = 10; | |
1799 | CylPart.BackSurface = 10; | |
1800 | new("CylinderMesh", CylPart); | |
1801 | ||
1802 | local TopFrame = BasePart:clone() | |
1803 | TopFrame.Parent = Storage; | |
1804 | TopFrame.Size = Vector3.new(3.5*Scale, 1.5*Scale, 3.5*Scale); | |
1805 | TopFrame.BrickColor = TeamColor; | |
1806 | ||
1807 | new("CylinderMesh", TopFrame); | |
1808 | ||
1809 | local Screw = CylPart:clone(); | |
1810 | Screw.Parent = Storage; | |
1811 | Screw.Size = Vector3.new(.3*Scale, 1.6*Scale, .3*Scale); | |
1812 | Screw.BrickColor = BrickColor.new(199); | |
1813 | ||
1814 | local CGreyStyle = CylPart:clone() | |
1815 | CGreyStyle.Parent = Storage; | |
1816 | CGreyStyle.Size = Vector3.new(2.2*Scale, 1.52*Scale, 2.6*Scale); | |
1817 | CGreyStyle.BrickColor = BrickColor.new(199); | |
1818 | ||
1819 | local TurretCasing = BasePart:clone(); | |
1820 | TurretCasing.Size = Vector3.new(2.2*Scale, 1.4*Scale, 5.6*Scale); | |
1821 | TurretCasing.BrickColor = BrickColor.new(199); | |
1822 | TurretCasing.Parent = Storage; | |
1823 | ||
1824 | Bevel(TurretCasing); | |
1825 | ||
1826 | local TurretFront = BasePart:clone(); | |
1827 | TurretFront.Size = Vector3.new(1.7*Scale, 1*Scale, .2*Scale); | |
1828 | TurretFront.BrickColor = TeamColor; | |
1829 | TurretFront.Parent = Storage; | |
1830 | ||
1831 | local Barrel = CylPart:clone(); | |
1832 | Barrel.Parent = Storage; | |
1833 | Barrel.Size = Vector3.new(.7*Scale, .4*Scale, .7*Scale); | |
1834 | Barrel.BrickColor = BrickColor.Black(); | |
1835 | ||
1836 | ||
1837 | local Particle = Instance.new("ParticleEmitter", Barrel); | |
1838 | Particle.VelocitySpread = 30; | |
1839 | Particle.LightEmission = 200; | |
1840 | ||
1841 | local Colors = {Color3.new(1,.5,0), Color3.new(1,.7,0), Color3.new(1,.9,0);} | |
1842 | ||
1843 | Particle.Size = NumberSequence.new(.05,.07); | |
1844 | ||
1845 | Particle.Color = ColorSequence.new(Colors[math.random(#Colors)]); | |
1846 | Particle.Texture = "rbxassetid://252350680"; | |
1847 | Particle.RotSpeed = NumberRange.new(10,70); | |
1848 | Particle.Rate = 300; | |
1849 | Particle.Speed = NumberRange.new(15); | |
1850 | Particle.Transparency = NumberSequence.new(0,1); | |
1851 | Particle.Lifetime = NumberRange.new(.01,.2); | |
1852 | Particle.Enabled = false | |
1853 | ||
1854 | ||
1855 | ||
1856 | local RedDot = BasePart:clone(); | |
1857 | RedDot.Parent = Storage; | |
1858 | RedDot.Size = Vector3.new(.2*Scale, .2*Scale, .2*Scale); | |
1859 | RedDot.BrickColor = BrickColor.new("Really red"); | |
1860 | ||
1861 | local Sphere = Instance.new("SpecialMesh", RedDot); | |
1862 | Sphere.MeshType = "Sphere"; | |
1863 | Sphere.Scale = Vector3.new(1*Scale,1*Scale,1*Scale); | |
1864 | ||
1865 | ||
1866 | Bevel(TurretFront, Vector3.new(1.7*Scale, 1*Scale, .05*Scale)); | |
1867 | ||
1868 | local Joint = CylPart:clone(); | |
1869 | Joint.Parent = Storage; | |
1870 | Joint.Size = Vector3.new(.7*Scale, 2*Scale, .7*Scale); | |
1871 | Joint.BrickColor = BrickColor.Black(); | |
1872 | ||
1873 | local Hold = BasePart:clone(); | |
1874 | Hold.Parent = Storage; | |
1875 | Hold.BrickColor = BrickColor.Black(); | |
1876 | Hold.Size = Vector3.new(2.2*Scale, .2*Scale, .75*Scale); | |
1877 | ||
1878 | local Bolt = BasePart:clone(); | |
1879 | Bolt.Size = Vector3.new(.2*Scale, 1.5*Scale, .5*Scale); | |
1880 | Bolt.Parent = Storage; | |
1881 | Bolt.BrickColor = BrickColor.Black(); | |
1882 | ||
1883 | local Bolt2 = BasePart:clone(); | |
1884 | Bolt2.Size = Vector3.new(.2*Scale, 1.5*Scale, .5*Scale); | |
1885 | Bolt2.Parent = Storage; | |
1886 | Bolt2.BrickColor = BrickColor.Black(); | |
1887 | ||
1888 | ||
1889 | local TurretToFrame = WeldP(TopFrame, TurretCasing, CFrame.new(0, 0, 1.4*Scale)); | |
1890 | WeldP(TopFrame, CGreyStyle); | |
1891 | WeldP(TurretCasing, TurretFront, CFrame.new(0, 0, 2.8*Scale)); | |
1892 | WeldP(TopFrame, Screw); | |
1893 | local BarrelWeld = WeldP(Barrel, TurretFront, CFrame.new(.3*Scale, -.2*Scale, 0), CFrame.Angles(math.pi/2, 0, 0)); | |
1894 | ||
1895 | WeldP(RedDot, TurretFront, CFrame.new(-.55*Scale, 0, -.15*Scale), CFrame.Angles(math.pi/2, 0, 0)); | |
1896 | ||
1897 | local RotateAxisY = WeldP(Bolt, TurretCasing, CFrame.Angles(0,0,0), CFrame.new(1.1*Scale, -.75*Scale, 1*Scale)); | |
1898 | ||
1899 | WeldP(Bolt, Hold, CFrame.new(-1.1*Scale, -.5*Scale, 0)); | |
1900 | ||
1901 | WeldP(Bolt2, Hold, CFrame.new(1.1*Scale, -.5*Scale, 0)); | |
1902 | ||
1903 | local RotateAxisX = WeldP(Hold, Joint, CFrame.new(0, -1*Scale, 0)); | |
1904 | ||
1905 | ||
1906 | ||
1907 | local Leg1 = BasePart:clone(); | |
1908 | Leg1.Size = Vector3.new(.2*Scale, 3.5*Scale, .5*Scale); | |
1909 | Leg1.Parent = Storage; | |
1910 | Leg1.BrickColor = BrickColor.Black(); | |
1911 | ||
1912 | ||
1913 | WeldP(Leg1, Joint, CFrame.new(0, -1.75*Scale, 0), CFrame.new(0, -.75*Scale, 0) * CFrame.Angles(math.pi/3, 0, math.pi)); | |
1914 | ||
1915 | ||
1916 | local Leg2 = BasePart:clone(); | |
1917 | Leg2.Size = Vector3.new(.2*Scale, 3.5*Scale, .5*Scale); | |
1918 | Leg2.Parent = Storage; | |
1919 | Leg2.BrickColor = BrickColor.Black(); | |
1920 | ||
1921 | ||
1922 | WeldP(Leg2, Joint, CFrame.new(0, -1.75*Scale, 0), CFrame.new(0, -.45*Scale, 0) * CFrame.Angles(-math.pi/4, 0, math.pi + -math.pi/6)); | |
1923 | ||
1924 | ||
1925 | local Leg3 = BasePart:clone(); | |
1926 | Leg3.Size = Vector3.new(.2*Scale, 3.5*Scale, .5*Scale); | |
1927 | Leg3.Parent = Storage; | |
1928 | Leg3.BrickColor = BrickColor.Black(); | |
1929 | ||
1930 | ||
1931 | WeldP(Leg3, Joint, CFrame.new(0, -1.75*Scale, 0), CFrame.new(0, -.45*Scale, 0) * CFrame.Angles(-math.pi/4, 0, math.pi + math.pi/6)); | |
1932 | ||
1933 | for i,v in pairs(Storage:children()) do | |
1934 | if v.Name== "Part" then | |
1935 | trans = 1 | |
1936 | v.Transparency = 1 | |
1937 | end | |
1938 | end | |
1939 | ||
1940 | local InvisiBox = BasePart:clone(); | |
1941 | InvisiBox.Size = Storage:GetModelSize() + Vector3.new(2*Scale, 0, 0); | |
1942 | InvisiBox.Parent = Storage; | |
1943 | InvisiBox.Transparency = 1 | |
1944 | InvisiBox.Name = 'box' | |
1945 | WeldP(InvisiBox, Joint, CFrame.new(0, -.2*Scale, .97*Scale)); | |
1946 | ||
1947 | local InvisiBox2 = BasePart:clone(); | |
1948 | InvisiBox2.Size = Storage:GetModelSize() + Vector3.new(2*Scale, 0, 0); | |
1949 | InvisiBox2.Parent = Arms; | |
1950 | InvisiBox2.Transparency = .9 | |
1951 | InvisiBox2.Name = 'box' | |
1952 | InvisiBox2.CanCollide = false | |
1953 | InvisiBox2.BrickColor = TeamColor | |
1954 | InvisiBox2.Material = 'Neon' | |
1955 | WeldP(InvisiBox2, Joint, CFrame.new(0, -1.2*Scale, .97*Scale)); | |
1956 | ||
1957 | InvisiBox.CFrame = torso.CFrame * CFrame.new(0, 5.5*Scale, -2.9) * CFrame.Angles(0, math.pi, 0); | |
1958 | ||
1959 | local Action = "Idle"; | |
1960 | ||
1961 | local Target = nil; | |
1962 | ||
1963 | wait(1) | |
1964 | ||
1965 | InvisiBox.Anchored = true | |
1966 | ||
1967 | for i,v in pairs(Storage:children()) do | |
1968 | if v:IsA'Part' then | |
1969 | v.Locked = true | |
1970 | end | |
1971 | end | |
1972 | --// | |
1973 | --// SOUNDS | |
1974 | --// | |
1975 | for i,v in pairs(Storage:children()) do | |
1976 | if v.Name== "Part" then | |
1977 | trans = 1 | |
1978 | v.Transparency = 1 | |
1979 | end | |
1980 | end | |
1981 | for i,v in pairs(Storage:children()) do | |
1982 | if v.Name== "Part" then | |
1983 | trans = 1 | |
1984 | v.Transparency = 1 | |
1985 | for i = 1,11 do | |
1986 | ||
1987 | trans = trans - .1 | |
1988 | v.Transparency = trans | |
1989 | wait() | |
1990 | end | |
1991 | end | |
1992 | end | |
1993 | trans = 1 | |
1994 | ||
1995 | local OnFind = new("Sound", TopFrame); | |
1996 | OnFind.SoundId = "rbxassetid://10209260" | |
1997 | OnFind.Volume = 1 | |
1998 | ||
1999 | ||
2000 | local OnFire = new("Sound", TopFrame); | |
2001 | OnFire.SoundId = "rbxassetid://10209257" | |
2002 | OnFire.Volume = 1 | |
2003 | ||
2004 | local OnEmpty = new("Sound", TopFrame); | |
2005 | OnEmpty.SoundId = "rbxassetid://10209225" | |
2006 | OnEmpty.Volume = 1 | |
2007 | ||
2008 | local Scanning = new("Sound", TopFrame); | |
2009 | Scanning.SoundId = "rbxassetid://258704234" | |
2010 | Scanning.Volume = 1 | |
2011 | ||
2012 | local Explode = new("Sound", TopFrame); | |
2013 | Explode.SoundId = "rbxassetid://10209236" | |
2014 | Explode.Volume = .5 | |
2015 | ||
2016 | local Move = new("Sound", TopFrame); | |
2017 | Move.SoundId = "rbxassetid://258704467"; | |
2018 | Move.Volume = 1; | |
2019 | ||
2020 | ||
2021 | ||
2022 | ||
2023 | ||
2024 | function FindShortest(Table) | |
2025 | local Current = Table[1] | |
2026 | local Final | |
2027 | for _,v in pairs(Table) do | |
2028 | if v[2] ~= Current[2] then | |
2029 | if v[1] < Current[1] then | |
2030 | Current = v | |
2031 | end | |
2032 | end | |
2033 | end | |
2034 | Final = Current | |
2035 | return Final | |
2036 | end | |
2037 | ||
2038 | function GetNearbyPlayer() | |
2039 | ||
2040 | local List = {} | |
2041 | for i,v in pairs(workspace:children()) do | |
2042 | if (v ~= nil) then | |
2043 | if (v:IsA'Model') then | |
2044 | if (v:findFirstChild'Torso' ~= nil) then | |
2045 | local rx, ry, rz = Hold.CFrame:toEulerAnglesXYZ(); | |
2046 | if (v:findFirstChild'Torso'.Position - Hold.CFrame * CFrame.new(0, 0, 20) * CFrame.Angles(0, ry, 0).p).magnitude < 20 then | |
2047 | if (v ~= char) then | |
2048 | for x,z in next, v:children() do | |
2049 | if z:IsA'Humanoid' and z.Health > 0.01 then | |
2050 | table.insert(List, {(v:findFirstChild'Torso'.Position - Hold.CFrame * CFrame.new(0, 0, 20) * CFrame.Angles(0, ry, 0).p).magnitude, v}) | |
2051 | end | |
2052 | end | |
2053 | end | |
2054 | end | |
2055 | end | |
2056 | end | |
2057 | end | |
2058 | end | |
2059 | if (FindShortest(List) ~= nil) then | |
2060 | return FindShortest(List)[2]; | |
2061 | else | |
2062 | return nil; | |
2063 | end | |
2064 | end | |
2065 | ||
2066 | local Health = Instance.new("Humanoid", Storage); | |
2067 | Health.MaxHealth = 150; | |
2068 | Health.Health = 150; | |
2069 | ||
2070 | ||
2071 | ||
2072 | function RayC(Part, speed) | |
2073 | coroutine.wrap(function() | |
2074 | local Visual = BasePart:clone(); | |
2075 | Visual.FormFactor = "Custom"; | |
2076 | Visual.BrickColor = BrickColor.Yellow(); | |
2077 | Visual.Size = Vector3.new(.2, 3, .2); | |
2078 | Visual.CFrame = Part.CFrame * CFrame.new(0, -1, 0); | |
2079 | Visual.Anchored = true; | |
2080 | Visual.CanCollide = false; | |
2081 | Visual.Locked = true | |
2082 | ||
2083 | ||
2084 | coroutine.wrap(function() | |
2085 | ||
2086 | wait(.2) | |
2087 | ||
2088 | wait(.1); | |
2089 | wait(.3) | |
2090 | ||
2091 | end)() | |
2092 | ||
2093 | Instance.new("SpecialMesh", Visual).MeshType = "Sphere"; | |
2094 | Visual.Mesh.Scale = Vector3.new(.5, 1, .5); | |
2095 | ||
2096 | local bulletpos = Visual.Position | |
2097 | local bulletvelocity = (Part.CFrame.p - bulletpos).unit*speed | |
2098 | local lastbulletpos = Visual.Position | |
2099 | Visual.Parent = Storage; | |
2100 | while game:service'RunService'.Stepped:wait() do | |
2101 | ||
2102 | lastbulletpos = bulletpos | |
2103 | bulletpos = bulletpos + bulletvelocity | |
2104 | local RayCast = Ray.new(lastbulletpos, (bulletpos - lastbulletpos)) | |
2105 | local hit, hitpos = workspace:FindPartOnRay(RayCast, Storage, false, true) | |
2106 | if (Joint.Position - Visual.Position).magnitude > 1000 or Visual.Parent == nil then | |
2107 | Visual:Destroy(); | |
2108 | break | |
2109 | end | |
2110 | Visual.Anchored = true | |
2111 | Visual.CFrame = CFrame.new(bulletpos, bulletpos+bulletvelocity) * CFrame.Angles(math.pi/2, 0, 0); | |
2112 | if hit then | |
2113 | if hit.Parent:IsA'Hat' then | |
2114 | if hit.Parent.Parent:IsA'Model' then | |
2115 | for x,z in next, hit.Parent.Parent:children() do | |
2116 | if z:IsA'Humanoid' then | |
2117 | z:TakeDamage(math.random(8,12)); | |
2118 | end | |
2119 | end | |
2120 | end | |
2121 | else | |
2122 | if hit.Parent:IsA'Model' then | |
2123 | for x,z in next, hit.Parent:children() do | |
2124 | if z:IsA'Humanoid' then | |
2125 | z:TakeDamage(math.random(8,12)); | |
2126 | end | |
2127 | end | |
2128 | end | |
2129 | end | |
2130 | ||
2131 | Visual:Destroy(); | |
2132 | break | |
2133 | end | |
2134 | end | |
2135 | end)() | |
2136 | end | |
2137 | ||
2138 | lastTick = tick(); | |
2139 | local db = false; | |
2140 | game:service'RunService'.RenderStepped:connect(function() | |
2141 | if Action == "DEAD" then return end; | |
2142 | ||
2143 | ||
2144 | if not Wrangler then | |
2145 | --// | |
2146 | --// AUTOMATED MODE, MOTION SENSOR WILL DETECT MOVEMENT | |
2147 | --// | |
2148 | ||
2149 | ||
2150 | --// | |
2151 | --// IF PLAYER USED WRANGLER, THERE IS A SHIELD WICH MUST BE REMOVED | |
2152 | --// | |
2153 | ||
2154 | if (Storage:findFirstChild'Shield') then | |
2155 | Storage:findFirstChild'Shield':Destroy(); | |
2156 | end | |
2157 | ||
2158 | local LastTarget = Target; | |
2159 | ||
2160 | --// | |
2161 | --// CHECK FOR NEARBY ENEMIES | |
2162 | --// | |
2163 | local Player = GetNearbyPlayer(); | |
2164 | Target = Player; | |
2165 | ||
2166 | --// | |
2167 | --// BEEP ON TARGET FOUND | |
2168 | --// | |
2169 | if (Target ~= LastTarget and Target ~= nil) then | |
2170 | Move.Pitch = 0.9 + math.random()/9; | |
2171 | Move:play(); | |
2172 | OnFind:play(); | |
2173 | Action = "Standby"; | |
2174 | end | |
2175 | ||
2176 | --// | |
2177 | --// IDLE | |
2178 | --// | |
2179 | if Action == "Idle" then | |
2180 | RotateAxisX.C1 = clerp(RotateAxisX.C1, CFrame.Angles(0, SharpSin(tick()*2)*.2, 0), .1); | |
2181 | RotateAxisY.C0 = clerp(RotateAxisY.C0, CFrame.new(), .1); | |
2182 | end | |
2183 | ||
2184 | ||
2185 | --// | |
2186 | --// SENTRY DEAD | |
2187 | --// | |
2188 | ||
2189 | --// | |
2190 | --// IF PLAYER EXISTS, FIRE! | |
2191 | --// | |
2192 | ||
2193 | ||
2194 | ||
2195 | if Action == "Standby" then | |
2196 | pcall(function() | |
2197 | local tor = Target.Torso.CFrame.p -- Target CFrame | |
2198 | local direction = InvisiBox.CFrame.lookVector -- Direction handling, welds mess up, just a workaround. | |
2199 | local heading = math.atan2(direction.x, direction.z)-- | |
2200 | local RotY = math.deg(heading) | |
2201 | if RotY < 0 then | |
2202 | RotY = (360 - math.abs(RotY)); | |
2203 | end | |
2204 | RotateAxisX.C1 = --Begin here | |
2205 | clerp(RotateAxisX.C1, | |
2206 | CFrame.new( | |
2207 | ||
2208 | Vector3.new(), --The Pivot0 of pointing the weld. | |
2209 | Vector3.new(tor.x, 0, tor.z) - Vector3.new(RotateAxisX.Part1.CFrame.x, 0, RotateAxisX.Part1.CFrame.z)) --We point the sentry here | |
2210 | ||
2211 | * CFrame.Angles(0, math.rad(360) - math.rad(RotY), 0), | |
2212 | .1 | |
2213 | ); | |
2214 | ||
2215 | local Point = Hold.CFrame:toObjectSpace(CFrame.new(Hold.CFrame.p,tor))*CFrame.Angles(0,math.rad(180),0) | |
2216 | local RX, RY, RZ = Point:toEulerAnglesXYZ() | |
2217 | if math.deg(RX) > 45 then | |
2218 | RX = math.rad(45) | |
2219 | elseif math.deg(RX) < -55 then | |
2220 | RX = math.rad(-55) | |
2221 | end | |
2222 | RotateAxisY.C0 = clerp(RotateAxisY.C0,CFrame.Angles(RX,0,0),.1) | |
2223 | ||
2224 | end) | |
2225 | end | |
2226 | if Action == "Fire" then | |
2227 | pcall(function() | |
2228 | local tor = Target.Torso.CFrame.p; | |
2229 | local direction = InvisiBox.CFrame.lookVector | |
2230 | local heading = math.atan2(direction.x, direction.z) | |
2231 | local RotY = math.deg(heading) | |
2232 | if RotY < 0 then | |
2233 | RotY = (360 - math.abs(RotY)); | |
2234 | end | |
2235 | RotateAxisX.C1 = --Begin here | |
2236 | clerp(RotateAxisX.C1, | |
2237 | CFrame.new( | |
2238 | ||
2239 | Vector3.new(), --The Pivot0 of pointing the weld. | |
2240 | Vector3.new(tor.x, 0, tor.z) - Vector3.new(RotateAxisX.Part1.CFrame.x, 0, RotateAxisX.Part1.CFrame.z)) --We point the sentry here | |
2241 | ||
2242 | * CFrame.Angles(0, math.rad(360) - math.rad(RotY), 0), | |
2243 | .1 | |
2244 | ); | |
2245 | ||
2246 | BarrelWeld.C0 = clerp(BarrelWeld.C0, CFrame.new()) | |
2247 | local Point = Hold.CFrame:toObjectSpace(CFrame.new(Hold.CFrame.p,tor))*CFrame.Angles(0,math.rad(180),0) | |
2248 | local RX, RY, RZ = Point:toEulerAnglesXYZ() | |
2249 | if math.deg(RX) > 45 then | |
2250 | RX = math.rad(45) | |
2251 | elseif math.deg(RX) < -55 then | |
2252 | RX = math.rad(-55) | |
2253 | end | |
2254 | RotateAxisY.C0 = clerp(RotateAxisY.C0,CFrame.Angles(RX,0,0),.1) | |
2255 | end) | |
2256 | end | |
2257 | ||
2258 | if (Target ~= nil) then | |
2259 | if Action == "Fire" or db then return end | |
2260 | if Action == "Standby" then | |
2261 | db = true | |
2262 | wait(.2); | |
2263 | end | |
2264 | Action = "Fire"; | |
2265 | db = false | |
2266 | OnFire:play(); | |
2267 | ||
2268 | Particle.Color = ColorSequence.new(Colors[math.random(#Colors)]); | |
2269 | ||
2270 | local PointLight = Instance.new("PointLight", Barrel); | |
2271 | PointLight.Color = Color3.new(1,.8,0) | |
2272 | PointLight.Brightness = 6; | |
2273 | Particle.Enabled = true | |
2274 | game:service'Debris':AddItem(PointLight, .05); | |
2275 | ||
2276 | ||
2277 | ||
2278 | RayC(Barrel, 20) | |
2279 | ||
2280 | ||
2281 | ||
2282 | ||
2283 | wait(.1) | |
2284 | Particle.Enabled = false | |
2285 | if (Target ~= nil) then | |
2286 | Action = "Standby"; | |
2287 | else | |
2288 | Action = "Idle"; | |
2289 | end | |
2290 | end | |
2291 | ||
2292 | if tick() - lastTick > 2.5 and Target == nil then | |
2293 | lastTick = tick(); | |
2294 | Scanning:play(); | |
2295 | end | |
2296 | end | |
2297 | ||
2298 | if (Health.Health < 0.0001 or RotateAxisX.Parent == nil) then | |
2299 | Action = "DEAD"; | |
2300 | if db then return end | |
2301 | RotateAxisY:Destroy(); | |
2302 | TurretToFrame:Destroy(); | |
2303 | Joint:Destroy(); | |
2304 | InvisiBox2:Destroy(); | |
2305 | db = true | |
2306 | local expl = Instance.new("Explosion", Storage); | |
2307 | ||
2308 | expl.BlastRadius = .3; | |
2309 | expl.BlastPressure = 2050000; | |
2310 | expl.Position = TopFrame.Position; | |
2311 | Explode:Play() | |
2312 | NoSentry = true | |
2313 | game:service'Debris':AddItem(Storage, 3); | |
2314 | ||
2315 | end | |
2316 | ||
2317 | end) | |
2318 | end | |
2319 | ||
2320 | ||
2321 | ||
2322 | combo = 0 | |
2323 | function strike(hit) | |
2324 | if hit and hit.Parent and hit.Parent.Name ~= char.Name then | |
2325 | local targetHumanoid = hit.Parent:FindFirstChild("Humanoid") | |
2326 | if targetHumanoid and targetHumanoid ~= char:FindFirstChild("Humanoid") then | |
2327 | if combo == 1 then | |
2328 | targetHumanoid:TakeDamage(slashDamage) | |
2329 | SwingH:Play() | |
2330 | ||
2331 | end | |
2332 | ||
2333 | ||
2334 | ||
2335 | end | |
2336 | end | |
2337 | end | |
2338 | ||
2339 | ||
2340 | ||
2341 | Reaper5.Touched:connect(strike) | |
2342 | -------------------------------------------------------------------------------------------------------------------------- | |
2343 | function AnimSit() | |
2344 | for i = 0, 1, 0.05 do | |
2345 | ||
2346 | swait() | |
2347 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, -1, -.6) * angles(math.rad(0), math.rad(0), math.rad(0)), .1) | |
2348 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(0)), .1) | |
2349 | LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.3, .1) * angles(math.rad(20), math.rad(0), math.rad(20)), 0.1) | |
2350 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(0), math.rad(0), math.rad(5)), 0.1) | |
2351 | RH.C0 = clerp(RH.C0, cn(1, -.4, -.4) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
2352 | LH.C0 = clerp(LH.C0, cn(-1, -1, -.6) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(60)), .1) | |
2353 | end | |
2354 | ||
2355 | end | |
2356 | ||
2357 | function AnimSitHit1() | |
2358 | for i = 0, 1, 0.05 do | |
2359 | ||
2360 | swait() | |
2361 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, -1, -.6) * angles(math.rad(10), math.rad(0), math.rad(0)), .1) | |
2362 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5), math.rad(0), math.rad(0)), .1) | |
2363 | LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.3, .1) * angles(math.rad(20), math.rad(0), math.rad(20)), 0.1) | |
2364 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(170), math.rad(0), math.rad(-5)), 0.08) | |
2365 | RH.C0 = clerp(RH.C0, cn(1, -.4, -.4) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(10)), .1) | |
2366 | LH.C0 = clerp(LH.C0, cn(-1, -1, -.6) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(50)), .1) | |
2367 | end | |
2368 | ||
2369 | end | |
2370 | ||
2371 | ||
2372 | function AnimSitHit2() | |
2373 | for i = 0, 1, 0.05 do | |
2374 | ||
2375 | swait() | |
2376 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, -1, -.6) * angles(math.rad(0), math.rad(0), math.rad(0)), .1) | |
2377 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(15), math.rad(0), math.rad(0)), .1) | |
2378 | LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.3, .1) * angles(math.rad(20), math.rad(0), math.rad(20)), 0.1) | |
2379 | RW.C0 = clerp(RW.C0, CFrame.new(1.55, 0.4, -.1) * angles(math.rad(40), math.rad(3 ), math.rad(-15)), 0.3) | |
2380 | RH.C0 = clerp(RH.C0, cn(1, -.4, -.4) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
2381 | LH.C0 = clerp(LH.C0, cn(-1, -1, -.6) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(60)), .1) | |
2382 | end | |
2383 | ||
2384 | end | |
2385 | -------------------------------------------------------------------------------------------------------------------------- | |
2386 | ||
2387 | function No1() | |
2388 | for i = 0, 1, 0.05 do | |
2389 | ||
2390 | swait() | |
2391 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0,0,0) * angles(math.rad(0), math.rad(0), math.rad(0)), .1) | |
2392 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(30), math.rad(0), math.rad(40)), .1) | |
2393 | LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.5, -.1) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.1) | |
2394 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(30), math.rad(0), math.rad(0)), 0.1) | |
2395 | RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
2396 | LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
2397 | end | |
2398 | ||
2399 | end | |
2400 | ||
2401 | ||
2402 | ||
2403 | function No2() | |
2404 | for i = 0, 1, 0.05 do | |
2405 | ||
2406 | swait() | |
2407 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0,0,0) * angles(math.rad(0), math.rad(0), math.rad(0)), .1) | |
2408 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(-40)), .1) | |
2409 | LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.5, -.1) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.1) | |
2410 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(30), math.rad(0), math.rad(0)), 0.1) | |
2411 | RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
2412 | LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
2413 | end | |
2414 | ||
2415 | end | |
2416 | ||
2417 | ||
2418 | ||
2419 | -------------------------------------------------------------------------------------------------------------------------- | |
2420 | ||
2421 | function Yes1() | |
2422 | for i = 0, 1, 0.1 do | |
2423 | ||
2424 | swait() | |
2425 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0,0,0) * angles(math.rad(0), math.rad(0), math.rad(0)), .1) | |
2426 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(25), math.rad(0), math.rad(0)), .1) | |
2427 | LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.5, -.1) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.1) | |
2428 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(30), math.rad(0), math.rad(0)), 0.1) | |
2429 | RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
2430 | LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
2431 | end | |
2432 | ||
2433 | end | |
2434 | ||
2435 | ||
2436 | ||
2437 | function Yes2() | |
2438 | for i = 0, 1, 0.1 do | |
2439 | ||
2440 | swait() | |
2441 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0,0,0) * angles(math.rad(0), math.rad(0), math.rad(0)), .1) | |
2442 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
2443 | LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.5, -.1) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.1) | |
2444 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(30), math.rad(0), math.rad(0)), 0.1) | |
2445 | RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
2446 | LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(0)), .1) | |
2447 | end | |
2448 | ||
2449 | end | |
2450 | ||
2451 | ||
2452 | ||
2453 | -------------------------------------------------------------------------------------------------------------------------- | |
2454 | function AttackAnim1() | |
2455 | for i = 0, 1, 0.05 do | |
2456 | swait() | |
2457 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(-5), math.rad(0), math.rad(0)), .1) | |
2458 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5), math.rad(0), math.rad(0)), .1) | |
2459 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(170), math.rad(0), math.rad(10)), 0.08) | |
2460 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(40), math.rad(0), math.rad(10)), 0.3) | |
2461 | if Torsovelocity > 2 then | |
2462 | RH.C0 = clerp(RH.C0, cn(1, -1 + .1 * math.cos(sine / 5), 0) * RHCF * angles(math.rad(-2), math.rad(0), math.rad(30 * math.cos(sine / 4))), .3) | |
2463 | LH.C0 = clerp(LH.C0, cn(-1, -1 + .1 * math.cos(sine / 5), 0) * LHCF * angles(math.rad(-2), math.rad(0), math.rad(30 * math.cos(sine / 4))), .3) | |
2464 | elseif Torsovelocity < 1 then | |
2465 | RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(-5)), .1) | |
2466 | LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(5)), .1) | |
2467 | end | |
2468 | end | |
2469 | end | |
2470 | ||
2471 | ||
2472 | function AttackAnim2() | |
2473 | for i = 0, 1, 0.05 do | |
2474 | swait() | |
2475 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(5), math.rad(0), math.rad(0)), .2) | |
2476 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(5), math.rad(0), math.rad(0)), .1) | |
2477 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.1) * angles(math.rad(5), math.rad(10), math.rad(-10)), 0.25) | |
2478 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(20), math.rad(0), math.rad(10)), 0.3) | |
2479 | if Torsovelocity > 2 then | |
2480 | RH.C0 = clerp(RH.C0, cn(1, -.9 + -.1 * math.cos(sine / 4),0 + -.1 * math.cos(sine / 4)) * RHCF * angles(math.rad(-2), math.rad(0), math.rad(50 * math.cos(sine / 4))), .3) | |
2481 | LH.C0 = clerp(LH.C0, cn(-1, -.9 + .1 * math.cos(sine / 4), 0 + .1 * math.cos(sine / 4)) * LHCF * angles(math.rad(-2), math.rad(0), math.rad(50 * math.cos(sine / 4))), .3) | |
2482 | ||
2483 | elseif Torsovelocity < 1 then | |
2484 | RH.C0 = clerp(RH.C0, cn(1, -1, 0) * RHCF * angles(math.rad(-2), math.rad(5), math.rad(5)), .1) | |
2485 | LH.C0 = clerp(LH.C0, cn(-1, -1, 0) * LHCF * angles(math.rad(-2), math.rad(5), math.rad(-5)), .1) | |
2486 | end | |
2487 | end | |
2488 | end | |
2489 | -------------------------------------------------------------------------------------------------------------------------- | |
2490 | ||
2491 | ||
2492 | ||
2493 | function ShotAttackAnim1() | |
2494 | for i = 0, 1, 0.07 do | |
2495 | swait() | |
2496 | ||
2497 | if Torsovelocity > 2 then | |
2498 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.05 + .1 * math.cos(sine / 3)) * angles(math.rad(5), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(-50 - 5 * math.cos(sine / 5))), .2) | |
2499 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(50 + 5 * math.cos(sine / 5)) + RootPart.RotVelocity.Y / 9), .2) | |
2500 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5, 0) * angles(math.rad(90), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.2) | |
2501 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.4, -.4) * angles(math.rad(85 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.2) | |
2502 | RH.C0 = clerp(RH.C0, cn(.9, -.9 + -.1 * math.cos(sine / 4),-.6) * RHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3) | |
2503 | LH.C0 = clerp(LH.C0, cn(-.9, -.9 + .1 * math.cos(sine / 4), .5) * LHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3) | |
2504 | ||
2505 | ||
2506 | ||
2507 | elseif Torsovelocity < 1 then | |
2508 | ||
2509 | ||
2510 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-50)), .2) | |
2511 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(50)), .2) | |
2512 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5, 0) * angles(math.rad(90), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.2) | |
2513 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.4, -.4) * angles(math.rad(85 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.2) | |
2514 | RH.C0 = clerp(RH.C0, cn(.9, -.9 - 0.1 * math.cos(sine / 25), -.6) * RHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2) | |
2515 | LH.C0 = clerp(LH.C0, cn(-.9, -.9 - 0.1 * math.cos(sine / 25), .5) * LHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2) | |
2516 | ||
2517 | ||
2518 | end | |
2519 | end | |
2520 | end | |
2521 | ||
2522 | ||
2523 | ||
2524 | ||
2525 | ||
2526 | function ShotAttackAnim2() | |
2527 | for i = 0, 1, 0.05 do | |
2528 | swait() | |
2529 | ||
2530 | if Torsovelocity > 2 then | |
2531 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.05 + .1 * math.cos(sine / 3)) * angles(math.rad(5), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(-50 - 5 * math.cos(sine / 5))), .2) | |
2532 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(50 + 5 * math.cos(sine / 5)) + RootPart.RotVelocity.Y / 9), .2) | |
2533 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5, 0) * angles(math.rad(100), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.1) | |
2534 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.4, -.4) * angles(math.rad(75 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.1) | |
2535 | RH.C0 = clerp(RH.C0, cn(.9, -.9 + -.1 * math.cos(sine / 4),-.6) * RHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3) | |
2536 | LH.C0 = clerp(LH.C0, cn(-.9, -.9 + .1 * math.cos(sine / 4), .5) * LHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3) | |
2537 | ||
2538 | ||
2539 | ||
2540 | elseif Torsovelocity < 1 then | |
2541 | ||
2542 | ||
2543 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-50)), .2) | |
2544 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(50)), .2) | |
2545 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5, 0) * angles(math.rad(100), math.rad(0 - .01 * math.cos(sine / 25)), math.rad(-40 + 0.1 * math.cos(sine / 25))), 0.1) | |
2546 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.4, -.4) * angles(math.rad(75 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-10 - 1 * math.cos(sine / 25))), 0.1) | |
2547 | RH.C0 = clerp(RH.C0, cn(.9, -.9 - 0.1 * math.cos(sine / 25), -.6) * RHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2) | |
2548 | LH.C0 = clerp(LH.C0, cn(-.9, -.9 - 0.1 * math.cos(sine / 25), .5) * LHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2) | |
2549 | ||
2550 | ||
2551 | end | |
2552 | end | |
2553 | end | |
2554 | ||
2555 | ||
2556 | ||
2557 | function ShotAttackAnim3() | |
2558 | for i = 0, 1, 0.05 do | |
2559 | swait() | |
2560 | ||
2561 | if Torsovelocity > 2 then | |
2562 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.05 + .1 * math.cos(sine / 3)) * angles(math.rad(5), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(-50 - 5 * math.cos(sine / 5))), .2) | |
2563 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(50 + 5 * math.cos(sine / 5)) + RootPart.RotVelocity.Y / 9), .2) | |
2564 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.56, -.2) * angles(math.rad(45), math.rad(-20 - .01 * math.cos(sine / 25)), math.rad(-70 + 0.1 * math.cos(sine / 25))), 0.2) | |
2565 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.6, -.6) * angles(math.rad(115 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-30 - 1 * math.cos(sine / 25))), 0.2) | |
2566 | RH.C0 = clerp(RH.C0, cn(.9, -.9 + -.1 * math.cos(sine / 4),-.6) * RHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3) | |
2567 | LH.C0 = clerp(LH.C0, cn(-.9, -.9 + .1 * math.cos(sine / 4), .5) * LHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3) | |
2568 | ||
2569 | ||
2570 | ||
2571 | elseif Torsovelocity < 1 then | |
2572 | ||
2573 | ||
2574 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-50)), .2) | |
2575 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(50)), .2) | |
2576 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.56, -.2) * angles(math.rad(45), math.rad(-20 - .01 * math.cos(sine / 25)), math.rad(-70 + 0.1 * math.cos(sine / 25))), 0.2) | |
2577 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.6, -.6) * angles(math.rad(115 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-30 - 1 * math.cos(sine / 25))), 0.2) | |
2578 | RH.C0 = clerp(RH.C0, cn(.9, -.9 - 0.1 * math.cos(sine / 25), -.6) * RHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2) | |
2579 | LH.C0 = clerp(LH.C0, cn(-.9, -.9 - 0.1 * math.cos(sine / 25), .5) * LHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2) | |
2580 | ||
2581 | ||
2582 | end | |
2583 | end | |
2584 | end | |
2585 | ||
2586 | function ShotAttackAnim4() | |
2587 | for i = 0, 1, 0.05 do | |
2588 | swait() | |
2589 | ||
2590 | if Torsovelocity > 2 then | |
2591 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.05 + .1 * math.cos(sine / 3)) * angles(math.rad(5), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(-50 - 5 * math.cos(sine / 5))), .2) | |
2592 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(50 + 5 * math.cos(sine / 5)) + RootPart.RotVelocity.Y / 9), .2) | |
2593 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.56, 0) * angles(math.rad(45), math.rad(-20 - .01 * math.cos(sine / 25)), math.rad(-70 + 0.1 * math.cos(sine / 25))), 0.2) | |
2594 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.6, -.8) * angles(math.rad(115 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-50 - 1 * math.cos(sine / 25))), 0.2) | |
2595 | RH.C0 = clerp(RH.C0, cn(.9, -.9 + -.1 * math.cos(sine / 4),-.6) * RHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3) | |
2596 | LH.C0 = clerp(LH.C0, cn(-.9, -.9 + .1 * math.cos(sine / 4), .5) * LHCF * angles(math.rad(-2), math.rad(50), math.rad(50 * math.cos(sine / 4))), .3) | |
2597 | ||
2598 | ||
2599 | ||
2600 | elseif Torsovelocity < 1 then | |
2601 | ||
2602 | ||
2603 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(-50)), .2) | |
2604 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(0), math.rad(0), math.rad(50)), .2) | |
2605 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.56, 0) * angles(math.rad(45), math.rad(-20 - .01 * math.cos(sine / 25)), math.rad(-70 + 0.1 * math.cos(sine / 25))), 0.2) | |
2606 | LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.6, -.8) * angles(math.rad(115 + 1 * math.cos(sine / 25)), math.rad(15), math.rad(-50 - 1 * math.cos(sine / 25))), 0.2) | |
2607 | RH.C0 = clerp(RH.C0, cn(.9, -.9 - 0.1 * math.cos(sine / 25), -.6) * RHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2) | |
2608 | LH.C0 = clerp(LH.C0, cn(-.9, -.9 - 0.1 * math.cos(sine / 25), .5) * LHCF * angles(math.rad(-2 + 1 * math.cos(sine / 25)), math.rad(50), math.rad(10 + 2 * math.cos(sine / 25))), .2) | |
2609 | ||
2610 | ||
2611 | end | |
2612 | end | |
2613 | end | |
2614 | -------------------------------------------------------------------------------------------------------------------------- | |
2615 | ||
2616 | function DanAni1() | |
2617 | for i = 0, .8, 0.05 + MusThingHat.Mesh.Scale.Y*0.025 do | |
2618 | ||
2619 | swait() | |
2620 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0,0,-.4) * angles(math.rad(5), math.rad(-8), math.rad(0)), MusThingHat.Mesh.Scale.Y*0.2) | |
2621 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(MusThingHat.Mesh.Scale.Y*30) +math.rad(-10),0,math.rad(0)),MusThingHat.Mesh.Scale.Y*0.2) | |
2622 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, -.25) * angles(math.rad(170), math.rad(0), math.rad(20)), MusThingHat.Mesh.Scale.Y*0.2) | |
2623 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.0) * angles(math.rad(90), math.rad(0), math.rad(-45)), MusThingHat.Mesh.Scale.Y*0.2) | |
2624 | RH.C0 = clerp(RH.C0, cn(1, -.2, -.4) * RHCF * angles(math.rad(-4), math.rad(-15), math.rad(-5)), MusThingHat.Mesh.Scale.Y*0.3) | |
2625 | LH.C0 = clerp(LH.C0, cn(-1, -1, -.0) * LHCF * angles(math.rad(4), math.rad(5), math.rad(5)), MusThingHat.Mesh.Scale.Y*0.2) | |
2626 | end | |
2627 | ||
2628 | end | |
2629 | ||
2630 | ||
2631 | ||
2632 | function DanAni2() | |
2633 | for i = 0, .8, 0.05 + MusThingHat.Mesh.Scale.Y*0.025 do | |
2634 | ||
2635 | swait() | |
2636 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0,0,-.5) * angles(math.rad(8), math.rad(8), math.rad(0)), MusThingHat.Mesh.Scale.Y*0.2) | |
2637 | Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(MusThingHat.Mesh.Scale.Y*30) +math.rad(-10),0,math.rad(0)),MusThingHat.Mesh.Scale.Y*0.2) | |
2638 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.6, -.25) * angles(math.rad(180), math.rad(0), math.rad(25)), MusThingHat.Mesh.Scale.Y*0.2) | |
2639 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, -.0) * angles(math.rad(0), math.rad(0), math.rad(45)), MusThingHat.Mesh.Scale.Y*0.2) | |
2640 | RH.C0 = clerp(RH.C0, cn(1, -1, -.0) * RHCF * angles(math.rad(4), math.rad(-5), math.rad(-8)), MusThingHat.Mesh.Scale.Y*0.2) | |
2641 | LH.C0 = clerp(LH.C0, cn(-1, -.2, -.4) * LHCF * angles(math.rad(-4), math.rad(15), math.rad(8)), MusThingHat.Mesh.Scale.Y*0.3) | |
2642 | end | |
2643 | ||
2644 | ||
2645 | end | |
2646 | ||
2647 | ||
2648 | ||
2649 | -------------------------------------------------------------------------------------------------------------------------- | |
2650 | ||
2651 | BuildNow = false | |
2652 | ||
2653 | Shotuse = false | |
2654 | ||
2655 | wait2 = false | |
2656 | ||
2657 | mouse.KeyDown:connect(function(key) | |
2658 | ||
2659 | if key == "g" and attack == false then | |
2660 | yes:Play() | |
2661 | head.face.Texture = "http://www.roblox.com/asset/?id=393521316" | |
2662 | humanoid.WalkSpeed = 0 | |
2663 | attack = true | |
2664 | Yes1() | |
2665 | Yes2() | |
2666 | Yes1() | |
2667 | Yes2() | |
2668 | attack = false | |
2669 | humanoid.WalkSpeed = 16 | |
2670 | head.face.Texture = "http://www.roblox.com/asset/?id=156600391" | |
2671 | end | |
2672 | end) | |
2673 | ||
2674 | ||
2675 | mouse.KeyDown:connect(function(key) | |
2676 | if key == "e" and attack == false then | |
2677 | if Wep == 1 then | |
2678 | Wep = 2 | |
2679 | else | |
2680 | Wep = 1 | |
2681 | end | |
2682 | ||
2683 | ||
2684 | end | |
2685 | end) | |
2686 | ||
2687 | mouse.KeyDown:connect(function(key) | |
2688 | if key == "p" and attack == false then | |
2689 | ||
2690 | Wep = 3 | |
2691 | ||
2692 | ||
2693 | ||
2694 | end | |
2695 | end) | |
2696 | ||
2697 | ||
2698 | ||
2699 | ||
2700 | ||
2701 | ||
2702 | ||
2703 | ||
2704 | ||
2705 | ||
2706 | ||
2707 | ||
2708 | equippedgun = true | |
2709 | ||
2710 | ||
2711 | ||
2712 | ||
2713 | coroutine.wrap(function() | |
2714 | while equippedgun do | |
2715 | ||
2716 | if spread < 0 then spread = 0 end | |
2717 | if humanoid.Health == 0 then break end | |
2718 | ||
2719 | ||
2720 | game:service'RunService'.Stepped:wait() | |
2721 | end | |
2722 | end)() | |
2723 | ||
2724 | mouse.Button1Down:connect(function() | |
2725 | if debounce then return end | |
2726 | if equippedgun2 == true and attack == false then | |
2727 | Shotuse = true | |
2728 | debounce = true | |
2729 | ||
2730 | wait(.2) | |
2731 | ||
2732 | sound:play() | |
2733 | ||
2734 | ||
2735 | ||
2736 | coroutine.wrap(function() | |
2737 | wait(0.3) | |
2738 | for angle = 0, 4 do | |
2739 | ||
2740 | wait() | |
2741 | end | |
2742 | ||
2743 | wait(0.2) | |
2744 | sound2:play() | |
2745 | ||
2746 | ||
2747 | wait(0.1) | |
2748 | for move = 0, 3 do | |
2749 | if move > 2 then return end | |
2750 | ||
2751 | ||
2752 | wait(0.06) | |
2753 | end | |
2754 | end)() | |
2755 | spread = spread + 1 | |
2756 | coroutine.wrap(function() | |
2757 | for bullitz = 0, 7 do | |
2758 | if bullitz > 6 then return end | |
2759 | rayCast2(300, 1, Reaper4) | |
2760 | GunParticle.Enabled = true | |
2761 | local PointLight = Instance.new("PointLight", Reaper4); | |
2762 | PointLight.Color = Color3.new(.2,.2,0) | |
2763 | PointLight.Brightness = 2; | |
2764 | game:service'Debris':AddItem(PointLight, .05); | |
2765 | end | |
2766 | end)() | |
2767 | coroutine.wrap(function() | |
2768 | for _ = 0, 50 do | |
2769 | pcall(function() | |
2770 | spread = spread - 0.03 | |
2771 | end) | |
2772 | wait() | |
2773 | end | |
2774 | end)() | |
2775 | wait(1) | |
2776 | debounce = false | |
2777 | end | |
2778 | ||
2779 | end) | |
2780 | ||
2781 | ||
2782 | ||
2783 | ||
2784 | ||
2785 | ||
2786 | ||
2787 | ||
2788 | ||
2789 | mouse.Button1Down:connect(function(key) | |
2790 | ||
2791 | if attack == false and Wep == 1 then | |
2792 | attack = true | |
2793 | ||
2794 | AttackAnim1() | |
2795 | combo = 1 | |
2796 | Swing:Play() | |
2797 | AttackAnim2() | |
2798 | attack = false | |
2799 | combo = 0 | |
2800 | end | |
2801 | end) | |
2802 | ||
2803 | ||
2804 | ||
2805 | mouse.KeyDown:connect(function(key) | |
2806 | ||
2807 | if key == "f" and attack == false then | |
2808 | No:Play() | |
2809 | humanoid.WalkSpeed = 0 | |
2810 | attack = true | |
2811 | No1() | |
2812 | No2() | |
2813 | attack = false | |
2814 | humanoid.WalkSpeed = 16 | |
2815 | end | |
2816 | end) | |
2817 | ||
2818 | ||
2819 | ||
2820 | ||
2821 | mouse.KeyDown:connect(function(key) | |
2822 | if attack == false or DA == true then | |
2823 | if key == "r" and Wep == 3 then | |
2824 | ||
2825 | if DA == false then | |
2826 | DA = true | |
2827 | RUS:Play() | |
2828 | attack=true | |
2829 | humanoid.WalkSpeed = 0 | |
2830 | head.face.Texture = "http://www.roblox.com/asset/?id=393521316" | |
2831 | else | |
2832 | DA = false | |
2833 | RUS:Stop() | |
2834 | attack=false | |
2835 | humanoid.WalkSpeed = 16 | |
2836 | head.face.Texture = "http://www.roblox.com/asset/?id=156600391" | |
2837 | end | |
2838 | end | |
2839 | end | |
2840 | end) | |
2841 | ||
2842 | ||
2843 | ||
2844 | mouse.KeyDown:connect(function(key) | |
2845 | ||
2846 | if key == "t" and attack == false then | |
2847 | Taunt:Play() | |
2848 | humanoid.WalkSpeed = 0 | |
2849 | attack = true | |
2850 | No1() | |
2851 | Yes2() | |
2852 | attack = false | |
2853 | humanoid.WalkSpeed = 16 | |
2854 | end | |
2855 | end) | |
2856 | ||
2857 | mouse.KeyDown:connect(function(key) | |
2858 | if key == "z" then | |
2859 | ||
2860 | ||
2861 | ||
2862 | if NoSentry == false and attack == false and wait2 == false then | |
2863 | wait2 = true | |
2864 | for i,v in pairs(script:children()) do | |
2865 | if (v:IsA'Model') then | |
2866 | ||
2867 | ||
2868 | for i,v in pairs(v:children()) do | |
2869 | if (v:IsA'Humanoid') then | |
2870 | v.Health = 0 | |
2871 | end | |
2872 | end | |
2873 | ||
2874 | ||
2875 | end | |
2876 | ||
2877 | NoSentry = true | |
2878 | ||
2879 | end | |
2880 | ||
2881 | ||
2882 | ||
2883 | end | |
2884 | ||
2885 | ||
2886 | ||
2887 | if NoSentry == true and attack == false and wait2 == false and Wep == 1 then | |
2888 | attack = true | |
2889 | wait2 = true | |
2890 | humanoid.WalkSpeed = 0 | |
2891 | AnimSit() | |
2892 | AnimSitHit1() | |
2893 | WSH = WSHM[math.random(1,#WSHM)] | |
2894 | HitM.SoundId = "rbxassetid://"..WSH | |
2895 | HitM:Play() | |
2896 | BuildNow = true | |
2897 | AnimSitHit2() | |
2898 | AnimSitHit1() | |
2899 | WSH = WSHM[math.random(1,#WSHM)] | |
2900 | HitM.SoundId = "rbxassetid://"..WSH | |
2901 | HitM:Play() | |
2902 | AnimSitHit2() | |
2903 | AnimSitHit1() | |
2904 | WSH = WSHM[math.random(1,#WSHM)] | |
2905 | HitM.SoundId = "rbxassetid://"..WSH | |
2906 | HitM:Play() | |
2907 | AnimSitHit2() | |
2908 | AnimSitHit1() | |
2909 | WSH = WSHM[math.random(1,#WSHM)] | |
2910 | HitM.SoundId = "rbxassetid://"..WSH | |
2911 | HitM:Play() | |
2912 | AnimSitHit2() | |
2913 | AnimSitHit1() | |
2914 | WSH = WSHM[math.random(1,#WSHM)] | |
2915 | HitM.SoundId = "rbxassetid://"..WSH | |
2916 | HitM:Play() | |
2917 | AnimSitHit2() | |
2918 | AnimSitHit1() | |
2919 | WSH = WSHM[math.random(1,#WSHM)] | |
2920 | HitM.SoundId = "rbxassetid://"..WSH | |
2921 | HitM:Play() | |
2922 | AnimSitHit2() | |
2923 | AnimSitHit1() | |
2924 | WSH = WSHM[math.random(1,#WSHM)] | |
2925 | HitM.SoundId = "rbxassetid://"..WSH | |
2926 | HitM:Play() | |
2927 | AnimSitHit2() | |
2928 | AnimSitHit1() | |
2929 | WSH = WSHM[math.random(1,#WSHM)] | |
2930 | HitM.SoundId = "rbxassetid://"..WSH | |
2931 | HitM:Play() | |
2932 | AnimSitHit2() | |
2933 | AnimSitHit1() | |
2934 | WSH = WSHM[math.random(1,#WSHM)] | |
2935 | HitM.SoundId = "rbxassetid://"..WSH | |
2936 | HitM:Play() | |
2937 | AnimSitHit2() | |
2938 | AnimSitHit1() | |
2939 | WSH = WSHM[math.random(1,#WSHM)] | |
2940 | HitM.SoundId = "rbxassetid://"..WSH | |
2941 | HitM:Play() | |
2942 | AnimSitHit2() | |
2943 | AnimSit() | |
2944 | ||
2945 | humanoid.WalkSpeed = 16 | |
2946 | attack = false | |
2947 | NoSentry = false | |
2948 | ||
2949 | end | |
2950 | wait() | |
2951 | ||
2952 | wait2 = false | |
2953 | end end) | |
2954 | ||
2955 | ||
2956 | ||
2957 | humanoid.Died:connect(function() | |
2958 | Arms:Destroy() | |
2959 | end) | |
2960 | ||
2961 | print([[ | |
2962 | ||
2963 | ||
2964 | ---------------------------------------- | |
2965 | Tf2 Engineer Class | |
2966 | ---------------------------------------- | |
2967 | Script by: 123jl123 | |
2968 | Sentry by: Madiik | |
2969 | TheBoozled gave me a Mesh and Sounds from tf2 | |
2970 | ---------------------------------------- | |
2971 | Dont leak and dont do it..... | |
2972 | ---------------------------------------- | |
2973 | ]]) | |
2974 | ||
2975 | game:GetService("RunService"):BindToRenderStep("ew", 0, function() | |
2976 | MusThingHat.Mesh.Scale = Vector3.new(MusThingHat.Mesh.Scale.X, RUS.PlaybackLoudness / 160, MusThingHat.Mesh.Scale.Z) | |
2977 | end) | |
2978 | ||
2979 | local mesh1anan = Instance.new("SpecialMesh") | |
2980 | mesh1anan.MeshType = Enum.MeshType.FileMesh | |
2981 | mesh1anan.Scale = Vector3.new(3,3,3) | |
2982 | mesh1anan.MeshId = "http://www.roblox.com/asset/?id=521754610" | |
2983 | mesh1anan.TextureId = "http://www.roblox.com/asset/?id=521754612" | |
2984 | ||
2985 | Glow1 = Color3.new(1,1,1) | |
2986 | Glow2 = Color3.new(0,0,0) | |
2987 | ||
2988 | GlowParticle = Instance.new("ParticleEmitter") | |
2989 | GlowParticle.LightEmission = 1 | |
2990 | ||
2991 | GlowParticle.Size = NumberSequence.new(0,2) | |
2992 | GlowParticle.Texture = "http://www.roblox.com/asset/?id=52620985" | |
2993 | GlowParticle.Transparency = NumberSequence.new(0,1) | |
2994 | GlowParticle.LockedToPart = false | |
2995 | GlowParticle.Lifetime = NumberRange.new(0.5) | |
2996 | GlowParticle.Rate= 25 | |
2997 | GlowParticle.Speed =NumberRange.new(0) | |
2998 | ||
2999 | ||
3000 | function RainDucks() | |
3001 | local locationanan = char.Torso.CFrame | |
3002 | local tacoa = Instance.new("Part") | |
3003 | tacoa.Size = Vector3.new(.5,.5,.5) | |
3004 | tacoa.CanCollide = false | |
3005 | tacoa.RotVelocity = Vector3.new(math.random(0,6),math.random(0,6),math.random(0,6)) | |
3006 | local meshanananan = mesh1anan:clone() | |
3007 | meshanananan.Parent = tacoa | |
3008 | meshanananan.Scale = Vector3.new(1,1,1) | |
3009 | tacoa.CFrame = locationanan * CFrame.new(math.random(-8,8),math.random(10,40),math.random(-8,8)) | |
3010 | tacoa.Parent = workspace | |
3011 | ||
3012 | ||
3013 | game:GetService("Debris"):AddItem(tacoa,4) | |
3014 | local GP = GlowParticle:clone() | |
3015 | GP.Parent = tacoa | |
3016 | Glow1 = Color3.new(math.random(), math.random(), math.random()) | |
3017 | GP.Color = ColorSequence.new(Glow1,Glow2) | |
3018 | ||
3019 | end | |
3020 | ||
3021 | ||
3022 | ||
3023 | --]] | |
3024 | ||
3025 | ||
3026 | ||
3027 | while true do wait() | |
3028 | if BuildNow == true then | |
3029 | BuildNow = false | |
3030 | ||
3031 | BuildSentry() | |
3032 | end | |
3033 | if Shotuse == true then | |
3034 | Shotuse = false | |
3035 | attack = true | |
3036 | ShotAttackAnim1() | |
3037 | GunParticle.Enabled = false | |
3038 | ShotAttackAnim2() | |
3039 | ShotAttackAnim3() | |
3040 | ShotAttackAnim4() | |
3041 | ShotAttackAnim3() | |
3042 | attack = false | |
3043 | end | |
3044 | ||
3045 | ||
3046 | ||
3047 | ||
3048 | if DA == true then | |
3049 | DanAni1() | |
3050 | RainDucks() | |
3051 | local PointLight = Instance.new("PointLight", Torso); | |
3052 | PointLight.Color = Color3.new(math.random(), math.random(), math.random()) | |
3053 | PointLight.Brightness = 50; | |
3054 | PointLight.Range = MusThingHat.Mesh.Scale.Y*10; | |
3055 | game:service'Debris':AddItem(PointLight, .3); | |
3056 | ||
3057 | DanAni2() | |
3058 | RainDucks() | |
3059 | local PointLight = Instance.new("PointLight", Torso); | |
3060 | PointLight.Color = Color3.new(math.random(), math.random(), math.random()) | |
3061 | PointLight.Brightness = 50; | |
3062 | PointLight.Range = MusThingHat.Mesh.Scale.Y*10; | |
3063 | game:service'Debris':AddItem(PointLight, .3); | |
3064 | ||
3065 | ||
3066 | ||
3067 | end | |
3068 | ||
3069 | ||
3070 | ||
3071 | ||
3072 | ||
3073 | ||
3074 | end |