SHOW:
|
|
- or go back to the newest paste.
1 | - | |
1 | + | |
2 | Made by Fenrier. | |
3 | ]] | |
4 | print("Before using this weapon, press G to use the sword, then press F to use the gun, then click to slash or fire. Depending on what weapon you are using.") | |
5 | Player=game:GetService("Players").LocalPlayer | |
6 | Character=Player.Character | |
7 | PlayerGui=Player.PlayerGui | |
8 | Backpack=Player.Backpack | |
9 | Torso=Character.Torso | |
10 | Head=Character.Head | |
11 | Humanoid=Character.Humanoid | |
12 | LeftArm=Character["Left Arm"] | |
13 | LeftLeg=Character["Left Leg"] | |
14 | RightArm=Character["Right Arm"] | |
15 | RightLeg=Character["Right Leg"] | |
16 | LS=Torso["Left Shoulder"] | |
17 | LH=Torso["Left Hip"] | |
18 | RS=Torso["Right Shoulder"] | |
19 | RH=Torso["Right Hip"] | |
20 | Neck=Torso.Neck | |
21 | it=Instance.new | |
22 | vt=Vector3.new | |
23 | cf=CFrame.new | |
24 | euler=CFrame.fromEulerAnglesXYZ | |
25 | angles=CFrame.Angles | |
26 | necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
27 | necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
28 | LHC0=cf(-1,-1,0,-0,-0,-1,0,1,0,1,0,0) | |
29 | LHC1=cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0) | |
30 | RHC0=cf(1,-1,0,0,0,1,0,1,0,-1,-0,-0) | |
31 | RHC1=cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0) | |
32 | RootPart=Character.HumanoidRootPart | |
33 | RootJoint=RootPart.RootJoint | |
34 | RootCF=euler(-1.57,0,3.14) | |
35 | attack = false | |
36 | attackdebounce = false | |
37 | MMouse=nil | |
38 | combo=0 | |
39 | mana=0 | |
40 | local idle=0 | |
41 | local Anim="Idle" | |
42 | local Effects={} | |
43 | local gun=false | |
44 | local shoot=false | |
45 | --player | |
46 | player=nil | |
47 | --save shoulders | |
48 | RSH, LSH=nil, nil | |
49 | --welds | |
50 | RW, LW=Instance.new("Weld"), Instance.new("Weld") | |
51 | RW.Name="Right Shoulder" LW.Name="Left Shoulder" | |
52 | LH=Torso["Left Hip"] | |
53 | RH=Torso["Right Hip"] | |
54 | TorsoColor=Torso.BrickColor | |
55 | ||
56 | function swait(num) | |
57 | if num==0 or num==nil then | |
58 | --if Stagger.Value==false or Stun.Value<=100 then | |
59 | game:service'RunService'.Stepped:wait(0) | |
60 | --end | |
61 | else | |
62 | for i=0,num do | |
63 | game:service'RunService'.Stepped:wait(0) | |
64 | --[[if Stagger.Value==true or Stun.Value>=100 then | |
65 | break | |
66 | end]] | |
67 | end | |
68 | end | |
69 | end | |
70 | ||
71 | if Character:findFirstChild("Ignis",true) ~= nil then | |
72 | Character:findFirstChild("Ignis",true).Parent = nil | |
73 | end | |
74 | if Player.PlayerGui:findFirstChild("WeaponGUI",true) ~= nil then | |
75 | Player.PlayerGui:findFirstChild("WeaponGUI",true).Parent = nil | |
76 | end | |
77 | if Character:findFirstChild("Stats",true) ~= nil then | |
78 | Character:findFirstChild("Stats",true).Parent = nil | |
79 | end | |
80 | local Stats=Instance.new("BoolValue") | |
81 | Stats.Name="Stats" | |
82 | Stats.Parent=Character | |
83 | local Atk=Instance.new("NumberValue") | |
84 | Atk.Name="Damage" | |
85 | Atk.Parent=Stats | |
86 | Atk.Value=1 | |
87 | local Def=Instance.new("NumberValue") | |
88 | Def.Name="Defense" | |
89 | Def.Parent=Stats | |
90 | Def.Value=1 | |
91 | local Speed=Instance.new("NumberValue") | |
92 | Speed.Name="Speed" | |
93 | Speed.Parent=Stats | |
94 | Speed.Value=1 | |
95 | local Mvmt=Instance.new("NumberValue") | |
96 | Mvmt.Name="Movement" | |
97 | Mvmt.Parent=Stats | |
98 | Mvmt.Value=1 | |
99 | local Block=Instance.new("BoolValue") | |
100 | Block.Name="Block" | |
101 | Block.Parent=Stats | |
102 | Block.Value=false | |
103 | local Stun=Instance.new("NumberValue") | |
104 | Stun.Name="Stun" | |
105 | Stun.Parent=Stats | |
106 | Stun.Value=0 | |
107 | local Stunned=Instance.new("BoolValue") | |
108 | Stunned.Name="Stunned" | |
109 | Stunned.Parent=Stats | |
110 | Stunned.Value=false | |
111 | local Stagger=Instance.new("BoolValue") | |
112 | Stagger.Name="Stagger" | |
113 | Stagger.Parent=Stats | |
114 | Stagger.Value=false | |
115 | local StaggerHit=Instance.new("BoolValue") | |
116 | StaggerHit.Name="StaggerHit" | |
117 | StaggerHit.Parent=Stats | |
118 | StaggerHit.Value=false | |
119 | local RecentEnemy=Instance.new("ObjectValue") | |
120 | RecentEnemy.Name="RecentEnemy" | |
121 | RecentEnemy.Parent=Stats | |
122 | RecentEnemy.Value=nil | |
123 | ||
124 | function NoOutline(Part) | |
125 | Part.TopSurface,Part.BottomSurface,Part.LeftSurface,Part.RightSurface,Part.FrontSurface,Part.BackSurface = 10,10,10,10,10,10 | |
126 | end | |
127 | ||
128 | function part(formfactor,parent,reflectance,transparency,brickcolor,name,size) | |
129 | local fp=it("Part") | |
130 | fp.formFactor=formfactor | |
131 | fp.Parent=parent | |
132 | fp.Reflectance=reflectance | |
133 | fp.Transparency=transparency | |
134 | fp.CanCollide=false | |
135 | fp.Locked=true | |
136 | fp.BrickColor=brickcolor | |
137 | fp.Name=name | |
138 | fp.Size=size | |
139 | fp.Position=Torso.Position | |
140 | NoOutline(fp) | |
141 | fp.Material="SmoothPlastic" | |
142 | fp:BreakJoints() | |
143 | return fp | |
144 | end | |
145 | ||
146 | function mesh(Mesh,part,meshtype,meshid,offset,scale) | |
147 | local mesh=it(Mesh) | |
148 | mesh.Parent=part | |
149 | if Mesh=="SpecialMesh" then | |
150 | mesh.MeshType=meshtype | |
151 | if meshid~="nil" then | |
152 | mesh.MeshId="http://www.roblox.com/asset/?id="..meshid | |
153 | end | |
154 | end | |
155 | mesh.Offset=offset | |
156 | mesh.Scale=scale | |
157 | return mesh | |
158 | end | |
159 | ||
160 | function weld(parent,part0,part1,c0) | |
161 | local weld=it("Weld") | |
162 | weld.Parent=parent | |
163 | weld.Part0=part0 | |
164 | weld.Part1=part1 | |
165 | weld.C0=c0 | |
166 | return weld | |
167 | end | |
168 | ||
169 | local Color1=Torso.BrickColor | |
170 | ||
171 | local fengui=it("GuiMain") | |
172 | fengui.Parent=Player.PlayerGui | |
173 | fengui.Name="WeaponGUI" | |
174 | local fenframe=it("Frame") | |
175 | fenframe.Parent=fengui | |
176 | fenframe.BackgroundColor3=Color3.new(255,255,255) | |
177 | fenframe.BackgroundTransparency=1 | |
178 | fenframe.BorderColor3=Color3.new(17,17,17) | |
179 | fenframe.Size=UDim2.new(0.0500000007, 0, 0.100000001, 0) | |
180 | fenframe.Position=UDim2.new(0.4,0,0.1,0) | |
181 | local fenbarmana1=it("TextLabel") | |
182 | fenbarmana1.Parent=fenframe | |
183 | fenbarmana1.Text=" " | |
184 | fenbarmana1.BackgroundTransparency=0 | |
185 | fenbarmana1.BackgroundColor3=Color3.new(0,0,0) | |
186 | fenbarmana1.SizeConstraint="RelativeXY" | |
187 | fenbarmana1.TextXAlignment="Center" | |
188 | fenbarmana1.TextYAlignment="Center" | |
189 | fenbarmana1.Position=UDim2.new(0,0,0,0) | |
190 | fenbarmana1.Size=UDim2.new(4,0,0.2,0) | |
191 | local fenbarmana2=it("TextLabel") | |
192 | fenbarmana2.Parent=fenframe | |
193 | fenbarmana2.Text=" " | |
194 | fenbarmana2.BackgroundTransparency=0 | |
195 | fenbarmana2.BackgroundColor3=BrickColor.new("Really red").Color | |
196 | fenbarmana2.SizeConstraint="RelativeXY" | |
197 | fenbarmana2.TextXAlignment="Center" | |
198 | fenbarmana2.TextYAlignment="Center" | |
199 | fenbarmana2.Position=UDim2.new(0,0,0,0) | |
200 | fenbarmana2.Size=UDim2.new(4*mana/100,0,0.2,0) | |
201 | local fenbarmana3=it("TextLabel") | |
202 | fenbarmana3.Parent=fenframe | |
203 | fenbarmana3.Text=" " | |
204 | fenbarmana3.BackgroundTransparency=0 | |
205 | fenbarmana3.BackgroundColor3=Color3.new(Col1,Col2,Col3) | |
206 | fenbarmana3.SizeConstraint="RelativeXY" | |
207 | fenbarmana3.TextXAlignment="Center" | |
208 | fenbarmana3.TextYAlignment="Center" | |
209 | fenbarmana3.Position=UDim2.new(0,0,0,0) | |
210 | fenbarmana3.Size=UDim2.new(0,0,0.2,0) | |
211 | local fenbarmana4=it("TextLabel") | |
212 | fenbarmana4.Parent=fenframe | |
213 | fenbarmana4.Text="Mana("..mana..")" | |
214 | fenbarmana4.BackgroundTransparency=1 | |
215 | fenbarmana4.BackgroundColor3=Color3.new(0,0,0) | |
216 | fenbarmana4.SizeConstraint="RelativeXY" | |
217 | fenbarmana4.TextXAlignment="Center" | |
218 | fenbarmana4.TextYAlignment="Center" | |
219 | fenbarmana4.Position=UDim2.new(0,0,-0.3,0) | |
220 | fenbarmana4.Size=UDim2.new(4,0,0.2,0) | |
221 | fenbarmana4.FontSize="Size9" | |
222 | fenbarmana4.TextStrokeTransparency=0 | |
223 | fenbarmana4.TextColor=BrickColor.new("White") | |
224 | ||
225 | local modelzorz=Instance.new("Model") | |
226 | modelzorz.Parent=Character | |
227 | modelzorz.Name="Ignis" | |
228 | ||
229 | local prt1=part(3,modelzorz,0,0,TorsoColor,"Part01",vt()) | |
230 | local prt2=part(3,modelzorz,0,0,BrickColor.new("Black"),"Part02",vt()) | |
231 | local prt3=part(3,modelzorz,0.5,0,BrickColor.new("Reddish brown"),"Part03",vt()) | |
232 | local prt4=part(3,modelzorz,0.5,0,BrickColor.new("Reddish brown"),"Part04",vt()) | |
233 | local prt8=part(3,modelzorz,0.5,0,BrickColor.new("Reddish brown"),"Part08",vt()) | |
234 | local prt9=part(3,modelzorz,0.5,0,BrickColor.new("Reddish brown"),"Part09",vt()) | |
235 | local prt10=part(3,modelzorz,0.5,0,BrickColor.new("Reddish brown"),"Part10",vt()) | |
236 | local prt11=part(3,modelzorz,0.5,0,BrickColor.new("Reddish brown"),"Part11",vt()) | |
237 | local prt12=part(3,modelzorz,0.5,0,BrickColor.new("Reddish brown"),"Part12",vt()) | |
238 | local gprt1=part(3,modelzorz,0,0.9,BrickColor.new("Dusty Rose"),"Gun Part01",vt()) | |
239 | local gprt2=part(3,modelzorz,0.2,0,BrickColor.new("Dusty Rose"),"Gun Part02",vt()) | |
240 | local gprt3=part(3,modelzorz,0.2,0,BrickColor.new("Dusty Rose"),"Gun Part03",vt()) | |
241 | local gprt4=part(3,modelzorz,0.2,0,BrickColor.new("Dusty Rose"),"Gun Part04",vt()) | |
242 | local gprt5=part(3,modelzorz,0.2,0,BrickColor.new("Dusty Rose"),"Gun Part05",vt()) | |
243 | local gprt6=part(3,modelzorz,0.2,0,BrickColor.new("Dusty Rose"),"Gun Part06",vt()) | |
244 | local gprt7=part(3,modelzorz,0,0,BrickColor.new("Really black"),"Gun Part07",vt()) | |
245 | local gprt8=part(3,modelzorz,0.2,0,BrickColor.new("Dusty Rose"),"Gun Part08",vt()) | |
246 | local gprt9=part(3,modelzorz,0,0,BrickColor.new("Really black"),"Gun Part09",vt()) | |
247 | local gprt10=part(3,modelzorz,0.2,0,BrickColor.new("Dusty Rose"),"Gun Part10",vt()) | |
248 | local gprt11=part(3,modelzorz,0,0,BrickColor.new("Black"),"Gun Part11",vt()) | |
249 | local gprt12=part(3,modelzorz,0,0,BrickColor.new("Really red"),"Gun Part12",vt()) | |
250 | local gprt13=part(3,modelzorz,0,0,BrickColor.new("Black"),"Gun Part13",vt()) | |
251 | local gprt14=part(3,modelzorz,0,0,BrickColor.new("Black"),"Gun Part14",vt()) | |
252 | local gprt15=part(3,modelzorz,0,0,BrickColor.new("Really red"),"Gun Part15",vt()) | |
253 | local gprt16=part(3,modelzorz,0,.2,BrickColor.new("Really red"),"Gun Part16",vt()) | |
254 | ||
255 | local msh1=mesh("SpecialMesh",prt1,"Head","nil",vt(0,0,0),vt(2.5,6,2.5)) | |
256 | local msh2=mesh("BlockMesh",prt2,"","",vt(0,0,0),vt(1.5,7,1.5)) | |
257 | local msh3=mesh("BlockMesh",prt3,"","",vt(0,0,0),vt(1.6,3,1.6)) | |
258 | local msh4=mesh("BlockMesh",prt4,"","",vt(0,0,0),vt(1.6,9,1)) | |
259 | local msh8=mesh("BlockMesh",prt8,"","",vt(0,0,0),vt(1.6,4,1)) | |
260 | local msh9=mesh("BlockMesh",prt9,"","",vt(0,0,0),vt(1.6,20,2)) | |
261 | local msh10=mesh("SpecialMesh",prt10,"Wedge","nil",vt(0,0,0),vt(1.6,3,2)) | |
262 | local msh11=mesh("BlockMesh",prt11,"","",vt(0,0,0),vt(1.6,17.5,1.5)) | |
263 | local msh12=mesh("SpecialMesh",prt12,"Wedge","nil",vt(0,0,0),vt(1.6,2.1,1.5)) | |
264 | local gmsh1=mesh("BlockMesh",gprt1,"","",vt(0,0,0),vt(1,1,1)) | |
265 | local gmsh2=mesh("BlockMesh",gprt2,"","",vt(0,0,0),vt(2,4,2)) | |
266 | local gmsh3=mesh("SpecialMesh",gprt3,"Wedge","nil",vt(0,0,0),vt(2,2,1)) | |
267 | local gmsh4=mesh("BlockMesh",gprt4,"","",vt(0,0,0),vt(1.99,6,2)) | |
268 | local gmsh5=mesh("SpecialMesh",gprt5,"Wedge","nil",vt(0,0,0),vt(1.99,2,2)) | |
269 | local gmsh6=mesh("BlockMesh",gprt6,"","",vt(0,0,0),vt(2.1,8.6,2)) | |
270 | local gmsh7=mesh("BlockMesh",gprt7,"","",vt(0,0,0),vt(2,8.5,1.99)) | |
271 | local gmsh8=mesh("CylinderMesh",gprt8,"","",vt(0,0,0),vt(2,2,2)) | |
272 | local gmsh9=mesh("CylinderMesh",gprt9,"","",vt(0,0,0),vt(1.5,2.01,1.5)) | |
273 | local gmsh10=mesh("SpecialMesh",gprt10,"Wedge","nil",vt(0,0,0),vt(2,2,2)) | |
274 | local gmsh11=mesh("BlockMesh",gprt11,"","",vt(0,0,0),vt(2.2,2,1)) | |
275 | local gmsh12=mesh("BlockMesh",gprt12,"","",vt(0,0,0),vt(2.21,1.8,.8)) | |
276 | local gmsh13=mesh("BlockMesh",gprt13,"","",vt(0,0,0),vt(2.22,.5,1)) | |
277 | local gmsh14=mesh("BlockMesh",gprt14,"","",vt(0,0,0),vt(2.2,6,1)) | |
278 | local gmsh15=mesh("BlockMesh",gprt15,"","",vt(0,0,0),vt(2.21,5,.9)) | |
279 | ||
280 | local wld1=weld(prt1,prt1,Torso,euler(0,1.57,-2.1)*cf(-1.8,-1.7,-.5)) | |
281 | local wld2=weld(prt2,prt2,prt1,euler(0,0,0)*cf(0,0,0)) | |
282 | local wld3=weld(prt3,prt3,prt2,euler(0,0,0)*cf(0,-1,0)) | |
283 | local wld4=weld(prt4,prt4,prt3,euler(0,0,0)*cf(0,-1.2,-.1)) | |
284 | local wld8=weld(prt8,prt8,prt4,euler(1.57,0,0)*cf(0,0,-0.5)) | |
285 | local wld9=weld(prt9,prt9,prt4,euler(0,0,0)*cf(0,-3,0)) | |
286 | local wld10=weld(prt10,prt10,prt9,euler(0,3.14,0)*cf(0,-2.3,0)) | |
287 | local wld11=weld(prt11,prt11,prt4,euler(0,0,0)*cf(0,-2.85,-.36)) | |
288 | local wld12=weld(prt12,prt12,prt11,euler(0,3.14,0)*cf(0,-1.95,0)) | |
289 | local gwld1=weld(gprt1,gprt1,LeftLeg,euler(2.3,0,0)*cf(.6,-.8,.3)) | |
290 | --local gwld1=weld(gprt1,gprt1,LeftArm,euler(1.57,0,0)*cf(0,.9,0)) | |
291 | local gwld2=weld(gprt2,gprt2,gprt1,euler(.7,0,0)*cf(0,0,0)) | |
292 | local gwld3=weld(gprt3,gprt3,gprt2,euler(1.57,3.14,0)*cf(0,.5,0)) | |
293 | local gwld4=weld(gprt4,gprt4,gprt2,euler(0.87,0,0)*cf(0,-.6,.3)) | |
294 | local gwld5=weld(gprt5,gprt5,gprt4,euler(0,3.14,0)*cf(0,-.8,0)) | |
295 | local gwld6=weld(gprt6,gprt6,gprt4,euler(0,0,0)*cf(0,-.25,-.1)) | |
296 | local gwld7=weld(gprt7,gprt7,gprt4,euler(0,0,0)*cf(0,-.25,-.1)) | |
297 | local gwld8=weld(gprt8,gprt8,gprt7,euler(0,0,0)*cf(0,-.9,0)) | |
298 | local gwld9=weld(gprt9,gprt9,gprt8,euler(0,0,0)*cf(0,0,0)) | |
299 | local gwld10=weld(gprt10,gprt10,gprt6,euler(0,0,3.14)*cf(0,1.05,0)) | |
300 | local gwld11=weld(gprt11,gprt11,gprt6,euler(0,0,0)*cf(0,.5,0.1)) | |
301 | local gwld12=weld(gprt12,gprt12,gprt11,euler(0,0,0)*cf(0,0,0)) | |
302 | local gwld13=weld(gprt13,gprt13,gprt11,euler(0,0,0)*cf(0,0,0)) | |
303 | local gwld14=weld(gprt14,gprt14,gprt6,euler(0,0,0)*cf(0,-.1,-.11)) | |
304 | local gwld15=weld(gprt15,gprt15,gprt14,euler(0,0,0)*cf(0,.05,0)) | |
305 | local gwld16=weld(gprt16,gprt16,gprt11,euler(-1.57,0,0)*cf(0,0,0)) | |
306 | ||
307 | num=0 | |
308 | num2=0 | |
309 | for i=1,10 do | |
310 | local prt5=part(3,modelzorz,0.5,0,BrickColor.new("Reddish brown"),"Part05",vt()) | |
311 | local msh5=mesh("BlockMesh",prt5,"","",vt(0,0,0),vt(1.61,2,1.61)) | |
312 | local wld5=weld(prt5,prt5,prt4,cf(0,0,1.05)*euler(1.57+num,0,0)) | |
313 | if i>=3 and i<=9 then | |
314 | local prt6=part(3,modelzorz,0.5,0,BrickColor.new("Reddish brown"),"Part06",vt()) | |
315 | local msh6=mesh("BlockMesh",prt6,"","",vt(0,0,0),vt(1.6,1.5,2)) | |
316 | local wld6=weld(prt6,prt6,prt5,cf(0,0.1,.3)) | |
317 | local prt7=part(3,modelzorz,0.5,0,BrickColor.new("Reddish brown"),"Part07",vt()) | |
318 | local msh7=mesh("SpecialMesh",prt7,"FileMesh","9756362",vt(0,0,0),vt(.3,.3,.6)) | |
319 | local wld7=weld(prt7,prt7,prt6,euler(0,0,0.785)*cf(0,0,0.2)) | |
320 | end | |
321 | num=num+0.348 | |
322 | end | |
323 | ||
324 | num=0 | |
325 | for i=1,4 do | |
326 | local gprt11=part(3,modelzorz,0,0,BrickColor.new("Black"),"Gun Part11",vt()) | |
327 | local gmsh11=mesh("CylinderMesh",gprt11,"","",vt(0,0,0),vt(.6,2.2,.6)) | |
328 | local gwld11=weld(gprt11,gprt11,gprt6,euler(0,0,1.57)*cf(0,-.5-num,0.1)) | |
329 | num=num-.2 | |
330 | end | |
331 | ||
332 | local hitbox=part(3,nil,0,1,BrickColor.new("Black"),"Hitbox",vt(1,1,1)) | |
333 | --hitbox.Anchored=false | |
334 | local hitbox2=part(3,nil,0,1,BrickColor.new("Black"),"Hitbox",vt(1,1,1)) | |
335 | hitbox2.Anchored=true | |
336 | ||
337 | if (script.Parent.className~="HopperBin") then | |
338 | Tool=Instance.new("HopperBin") | |
339 | Tool.Parent=Backpack | |
340 | Tool.Name="Ignis" | |
341 | script.Parent=Tool | |
342 | end | |
343 | Bin=script.Parent | |
344 | ||
345 | local bodvel=Instance.new("BodyVelocity") | |
346 | local bg=Instance.new("BodyGyro") | |
347 | ||
348 | so = function(id,par,vol,pit) | |
349 | coroutine.resume(coroutine.create(function() | |
350 | local sou = Instance.new("Sound",par or workspace) | |
351 | sou.Volume=vol | |
352 | sou.Pitch=pit or 1 | |
353 | sou.SoundId=id | |
354 | swait() | |
355 | sou:play() | |
356 | game:GetService("Debris"):AddItem(sou,6) | |
357 | end)) | |
358 | end | |
359 | ||
360 | function clerp(a,b,t) | |
361 | local qa = {QuaternionFromCFrame(a)} | |
362 | local qb = {QuaternionFromCFrame(b)} | |
363 | local ax, ay, az = a.x, a.y, a.z | |
364 | local bx, by, bz = b.x, b.y, b.z | |
365 | local _t = 1-t | |
366 | return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t)) | |
367 | end | |
368 | ||
369 | function QuaternionFromCFrame(cf) | |
370 | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() | |
371 | local trace = m00 + m11 + m22 | |
372 | if trace > 0 then | |
373 | local s = math.sqrt(1 + trace) | |
374 | local recip = 0.5/s | |
375 | return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5 | |
376 | else | |
377 | local i = 0 | |
378 | if m11 > m00 then | |
379 | i = 1 | |
380 | end | |
381 | if m22 > (i == 0 and m00 or m11) then | |
382 | i = 2 | |
383 | end | |
384 | if i == 0 then | |
385 | local s = math.sqrt(m00-m11-m22+1) | |
386 | local recip = 0.5/s | |
387 | return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip | |
388 | elseif i == 1 then | |
389 | local s = math.sqrt(m11-m22-m00+1) | |
390 | local recip = 0.5/s | |
391 | return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip | |
392 | elseif i == 2 then | |
393 | local s = math.sqrt(m22-m00-m11+1) | |
394 | local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip | |
395 | end | |
396 | end | |
397 | end | |
398 | ||
399 | function QuaternionToCFrame(px, py, pz, x, y, z, w) | |
400 | local xs, ys, zs = x + x, y + y, z + z | |
401 | local wx, wy, wz = w*xs, w*ys, w*zs | |
402 | local xx = x*xs | |
403 | local xy = x*ys | |
404 | local xz = x*zs | |
405 | local yy = y*ys | |
406 | local yz = y*zs | |
407 | local zz = z*zs | |
408 | 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)) | |
409 | end | |
410 | ||
411 | function QuaternionSlerp(a, b, t) | |
412 | local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4] | |
413 | local startInterp, finishInterp; | |
414 | if cosTheta >= 0.0001 then | |
415 | if (1 - cosTheta) > 0.0001 then | |
416 | local theta = math.acos(cosTheta) | |
417 | local invSinTheta = 1/math.sin(theta) | |
418 | startInterp = math.sin((1-t)*theta)*invSinTheta | |
419 | finishInterp = math.sin(t*theta)*invSinTheta | |
420 | else | |
421 | startInterp = 1-t | |
422 | finishInterp = t | |
423 | end | |
424 | else | |
425 | if (1+cosTheta) > 0.0001 then | |
426 | local theta = math.acos(-cosTheta) | |
427 | local invSinTheta = 1/math.sin(theta) | |
428 | startInterp = math.sin((t-1)*theta)*invSinTheta | |
429 | finishInterp = math.sin(t*theta)*invSinTheta | |
430 | else | |
431 | startInterp = t-1 | |
432 | finishInterp = t | |
433 | end | |
434 | end | |
435 | 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 | |
436 | end | |
437 | ||
438 | function hideanim() | |
439 | equipped=false | |
440 | for i=0,1,0.5 do | |
441 | swait() | |
442 | wld1.C0=clerp(wld1.C0,euler(0,-1.57,-1)*euler(.4,0,0)*cf(0,1,0),.4) | |
443 | gwld1.C0=clerp(gwld1.C0,euler(2,0,0)*cf(0,1,0),.4) | |
444 | Neck.C0=clerp(Neck.C0,necko*euler(-.2,0,-.4),.4) | |
445 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.4) | |
446 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(2,0,.2),.4) | |
447 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
448 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(.2,0,.2),.4) | |
449 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
450 | end | |
451 | for i=0,1,0.2 do | |
452 | swait() | |
453 | wld1.C0=clerp(wld1.C0,euler(0,-1.57,-1)*euler(.4,0,0)*cf(0,1,0),.4) | |
454 | gwld1.C0=clerp(gwld1.C0,euler(2,0,0)*cf(0,1,0),.4) | |
455 | Neck.C0=clerp(Neck.C0,necko*euler(-.2,0,-.4),.4) | |
456 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.4) | |
457 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(3.4,0,.2),.4) | |
458 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
459 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(.2,0,.2),.4) | |
460 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
461 | RH.C0=clerp(RH.C0,RHC0,.4) | |
462 | RH.C1=clerp(RH.C1,RHC1,.4) | |
463 | LH.C0=clerp(LH.C0,LHC0,.4) | |
464 | LH.C1=clerp(LH.C1,LHC1,.4) | |
465 | end | |
466 | Mvmt.Value=Mvmt.Value+.1 | |
467 | wld1.Part1=Torso | |
468 | wld1.C0=euler(0,1.57,-2.1)*cf(-1.8,-1.7,-.5) | |
469 | gwld1.Part1=LeftLeg | |
470 | gwld1.C0=euler(2.3,0,0)*cf(.6,-.8,.3) | |
471 | for i=0,1,0.3 do | |
472 | swait() | |
473 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,0),.4) | |
474 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.4) | |
475 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,0),.4) | |
476 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
477 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,0),.4) | |
478 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
479 | end | |
480 | end | |
481 | ||
482 | function equipanim() | |
483 | equipped=true | |
484 | for i=0,1,0.5 do | |
485 | swait() | |
486 | Neck.C0=clerp(Neck.C0,necko*euler(-.2,0,-.4),.4) | |
487 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.4) | |
488 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(2,0,.2),.4) | |
489 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
490 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(.2,0,.2),.4) | |
491 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
492 | end | |
493 | for i=0,1,0.2 do | |
494 | swait() | |
495 | Neck.C0=clerp(Neck.C0,necko*euler(-.2,0,-.4),.4) | |
496 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.4) | |
497 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(3.4,0,.2),.4) | |
498 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
499 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(.2,0,.2),.4) | |
500 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
501 | end | |
502 | Mvmt.Value=Mvmt.Value-.1 | |
503 | wld1.Part1=RightArm | |
504 | wld1.C0=euler(0,-1.57,-1)*euler(.4,0,0)*cf(0,1,0) | |
505 | gwld1.Part1=LeftArm | |
506 | --gwld1.C0=euler(1.57,0,0)*cf(0,1,0) | |
507 | gwld1.C0=euler(2,0,0)*cf(0,1,0) | |
508 | --[[for i=0,2,0.5 do | |
509 | swait() | |
510 | wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,0),.3) | |
511 | gwld1.C0=clerp(gwld1.C0,euler(1.57,0,0)*cf(0,1,0),.4) | |
512 | Neck.C0=clerp(Neck.C0,necko*euler(-.1,0,-.2),.4) | |
513 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.4) | |
514 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1.5,0,.2),.4) | |
515 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
516 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,0),.4) | |
517 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
518 | end]] | |
519 | end | |
520 | ||
521 | function StaggerAnim() | |
522 | attack=true | |
523 | for i=1,math.random(2,4) do | |
524 | ClangEffect(BrickColor.new("New Yeller"),cf(hitbox.Position)*euler(math.random(-50,50)/100,math.random(-50,50),math.random(-50,50)/100),0,.1,.2,math.random(150,300)/1000) | |
525 | end | |
526 | for i=0,1,0.35 do | |
527 | swait() | |
528 | Torso.Velocity=RootPart.CFrame.lookVector*-40 | |
529 | wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,.2),.3) | |
530 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,.5)*euler(.1,0,0),.3) | |
531 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(-.2,0,-.4),.3) | |
532 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.2,0,.7)*euler(0,-.7,0),.3) | |
533 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
534 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.2,0,-.4)*euler(0,.4,0),.3) | |
535 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
536 | RH.C0=clerp(RH.C0,cf(1,-.8,0)*euler(0,1.57,0)*euler(-.5,0,.6),.3) | |
537 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,.2,.2),.3) | |
538 | end | |
539 | for i=0,1,0.2 do | |
540 | swait() | |
541 | Torso.Velocity=RootPart.CFrame.lookVector*-40 | |
542 | wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,.2),.3) | |
543 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,.5)*euler(.1,0,0),.4) | |
544 | RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,-.2)*euler(-.5,0,-.4),.4) | |
545 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.2,0,.7)*euler(0,-.7,0),.4) | |
546 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
547 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.2,0,-.4)*euler(0,.4,0),.4) | |
548 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
549 | RH.C0=clerp(RH.C0,cf(1,-.8,0)*euler(0,1.57,0)*euler(-.5,0,.6),.4) | |
550 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,.2,.5),.4) | |
551 | end | |
552 | for i=0,1,0.1 do | |
553 | swait() | |
554 | wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,.2),.3) | |
555 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,.4)*euler(.5,0,0),.3) | |
556 | RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,-1.8)*euler(-.2,0,-.4),.3) | |
557 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.3,0,.4)*euler(0,-.4,0),.3) | |
558 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
559 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.3,0,-.2)*euler(0,.4,0),.3) | |
560 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
561 | RH.C0=clerp(RH.C0,cf(1,-.8,0)*euler(0,1.57,0)*euler(-.5,0,1.2),.3) | |
562 | LH.C0=clerp(LH.C0,cf(-1,0,-1)*euler(0,-1.57,0)*euler(0,.2,.2),.3) | |
563 | end | |
564 | swait(15) | |
565 | combo=0 | |
566 | attack=false | |
567 | end | |
568 | ||
569 | function StaggerHitt() | |
570 | attack=true | |
571 | for i=1,math.random(2,4) do | |
572 | ClangEffect(BrickColor.new("New Yeller"),cf(hitbox.Position)*euler(math.random(-50,50)/100,math.random(-50,50),math.random(-50,50)/100),0,.1,.2,math.random(150,300)/1000) | |
573 | end | |
574 | for i=0,1,0.1 do | |
575 | swait() | |
576 | wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,.2),.3) | |
577 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,.7)*euler(.1,0,0),.3) | |
578 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(-.2,0,-.6),.3) | |
579 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.4,0,.9)*euler(0,-.7,0),.3) | |
580 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
581 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.2,0,-.4)*euler(0,.4,0),.3) | |
582 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
583 | RH.C0=clerp(RH.C0,cf(1,-.8,0)*euler(0,1.57,0)*euler(-.2,0,-.4),.3) | |
584 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,.2,.2),.3) | |
585 | end | |
586 | attack=false | |
587 | end | |
588 | ||
589 | function StunAnim() | |
590 | attack=true | |
591 | Stunned.Value=true | |
592 | for i=0,1,0.3 do | |
593 | swait() | |
594 | Humanoid.WalkSpeed=0 | |
595 | wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,.2),.3) | |
596 | Neck.C0=clerp(Neck.C0,necko*euler(-.2,0,-.5),.2) | |
597 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(.2,0,-3),.2) | |
598 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.2,0,1.3),.2) | |
599 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
600 | LW.C0=clerp(LW.C0,cf(-1.2,0.5,-.4)*euler(1,0,.4)*euler(0,-.1,0),.2) | |
601 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
602 | RH.C0=clerp(RH.C0,cf(1,-.6,0)*euler(0,1.57,0)*euler(-.5,0,.3),.25) | |
603 | LH.C0=clerp(LH.C0,cf(-1,-.8,0)*euler(0,-1.57,0)*euler(-.2,0,0),.25) | |
604 | end | |
605 | for i=0,1,0.3 do | |
606 | swait() | |
607 | Humanoid.WalkSpeed=0 | |
608 | wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,.2),.3) | |
609 | Neck.C0=clerp(Neck.C0,necko*euler(-.3,0,-.5),.2) | |
610 | RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,-.5)*euler(.8,0,-3),.2) | |
611 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.8,0,1.3),.2) | |
612 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
613 | LW.C0=clerp(LW.C0,cf(-1.2,0.5,-.4)*euler(1.2,0,.8)*euler(0,-.1,0),.2) | |
614 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
615 | RH.C0=clerp(RH.C0,cf(1,-.6,0)*euler(0,1.57,0)*euler(-.5,0,.6),.25) | |
616 | LH.C0=clerp(LH.C0,cf(-1,-.8,0)*euler(0,-1.57,0)*euler(.1,0,.7),.25) | |
617 | end | |
618 | for i=0,1,0.3 do | |
619 | swait() | |
620 | Humanoid.WalkSpeed=0 | |
621 | wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,.2),.3) | |
622 | Neck.C0=clerp(Neck.C0,necko*euler(-.3,0,-1),.2) | |
623 | RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,-2)*euler(1.57,0,-3),.2) | |
624 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-.8,0,1.3),.2) | |
625 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
626 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.2,0,-.8)*euler(0,-.1,0),.2) | |
627 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
628 | RH.C0=clerp(RH.C0,cf(1,-.6,0)*euler(0,1.57,0)*euler(-.2,0,.6),.25) | |
629 | LH.C0=clerp(LH.C0,cf(-1,-.8,0)*euler(0,-1.57,0)*euler(-.1,0,.3),.25) | |
630 | end | |
631 | gairo=Instance.new("BodyGyro") | |
632 | gairo.Parent=RootPart | |
633 | gairo.maxTorque=Vector3.new(4e+005,4e+005,4e+005)*math.huge | |
634 | gairo.P=20e+003 | |
635 | gairo.cframe=RootPart.CFrame | |
636 | v=Instance.new("BodyVelocity",RootPart) | |
637 | v.Name="BodVel" | |
638 | v.P=2000 | |
639 | v.maxForce=Vector3.new(500000000,50000000,500000000) | |
640 | v.velocity=vt(0,-50,0) | |
641 | for i=0,1,0.1 do | |
642 | swait() | |
643 | Humanoid.WalkSpeed=0 | |
644 | v.velocity=vt(0,-50,0) | |
645 | wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,.2),.3) | |
646 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,-1.57),.3) | |
647 | RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,-2.5)*euler(1.57,0,-3.14),.3) | |
648 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-1.57,0,1.5)*euler(.2,0,0),.3) | |
649 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
650 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.5,0,-1.57)*euler(0,0,0),.3) | |
651 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
652 | RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(-.3,.5,0),.3) | |
653 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(-.1,.2,0),.3) | |
654 | end | |
655 | for i=1,70 do | |
656 | swait() | |
657 | Humanoid.WalkSpeed=0 | |
658 | v.velocity=vt(0,-50,0) | |
659 | end | |
660 | v.velocity=vt(0,0,0) | |
661 | for i=0,1,0.2 do | |
662 | swait() | |
663 | wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,.2),.3) | |
664 | Neck.C0=clerp(Neck.C0,necko*euler(.2,0,0),.3) | |
665 | RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,-2)*euler(1,0,-4),.3) | |
666 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-1.57,0,1)*euler(.2,-1,0),.3) | |
667 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
668 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.2,0,.2)*euler(0,0,0),.3) | |
669 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.3) | |
670 | RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(-.3,.5,.4),.3) | |
671 | LH.C0=clerp(LH.C0,cf(-1,-1,-1)*euler(0,-1.57,0)*euler(-.1,.2,1),.3) | |
672 | end | |
673 | gairo.Parent=nil | |
674 | v.Parent=nil | |
675 | combo=0 | |
676 | Stunned.Value=false | |
677 | attack=false | |
678 | end | |
679 | ||
680 | function attackone() | |
681 | attack=true | |
682 | for i=0,1,0.2 do | |
683 | swait() | |
684 | wld1.C0=clerp(wld1.C0,euler(2.9,0,3.14)*cf(0,1,.2),.4) | |
685 | Neck.C0=clerp(Neck.C0,necko*euler(.2,0,.5),.4) | |
686 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,-.5),.4) | |
687 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(2,0,1),.4) | |
688 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
689 | LW.C0=clerp(LW.C0,cf(-1.3,0.5,-.3)*euler(.4,0,.2)*euler(0,-.2,0),.4) | |
690 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
691 | RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(0,.5,0),.4) | |
692 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,.5,0),.4) | |
693 | if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then | |
694 | break | |
695 | end | |
696 | end | |
697 | con1=hitbox.Touched:connect(function(hit) Damagefunc(hit,10,15,math.random(5,10),"Normal",RootPart,.5,1,math.random(3,10),nil,true) end) | |
698 | hitbox.Parent=modelzorz | |
699 | hitbox.Size=vt(.5,7,1) | |
700 | hitbox.CFrame=prt9.CFrame*cf(0,-1,.4) | |
701 | blcf=nil | |
702 | scfr=nil | |
703 | for i=0,1,0.3 do | |
704 | swait() | |
705 | local blcf = prt9.CFrame*cf(0,-1,0) | |
706 | if scfr and (prt9.Position-scfr.p).magnitude > .1 then | |
707 | local h = 7 | |
708 | local a,b = Triangle((scfr*CFrame.new(0,h/2,0)).p,(scfr*CFrame.new(0,-h/2,0)).p,(blcf*CFrame.new(0,h/2,0)).p) | |
709 | if a then game.Debris:AddItem(a,1) end if b then game.Debris:AddItem(b,1) end | |
710 | local a,b = Triangle((blcf*CFrame.new(0,h/2,0)).p,(blcf*CFrame.new(0,-h/2,0)).p,(scfr*CFrame.new(0,-h/2,0)).p) | |
711 | if a then game.Debris:AddItem(a,1) end if b then game.Debris:AddItem(b,1) end | |
712 | scfr = blcf | |
713 | elseif not scfr then | |
714 | scfr = blcf | |
715 | end | |
716 | hitbox.CFrame=prt9.CFrame*cf(0,-1,.4) | |
717 | wld1.C0=clerp(wld1.C0,euler(1.2,0,3.14)*cf(0,1,0),.4) | |
718 | --wld1.C0=clerp(wld1.C0,euler(2,0,3.14)*cf(0,1,.2),.4) | |
719 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,-.5)*euler(.2,0,0),.4) | |
720 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,.5),.4) | |
721 | RW.C0=clerp(RW.C0,cf(1.2,0.5,-.3)*euler(.2,0,-.2)*euler(0,-.5,0),.4) | |
722 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
723 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.4,0,-.2),.4) | |
724 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
725 | RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(0,-.5,0),.4) | |
726 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,-.5,0),.4) | |
727 | if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then | |
728 | break | |
729 | end | |
730 | end | |
731 | for i=0,1,0.2 do | |
732 | swait() | |
733 | local blcf = prt9.CFrame*cf(0,-1,0) | |
734 | if scfr and (prt9.Position-scfr.p).magnitude > .1 then | |
735 | local h = 7 | |
736 | local a,b = Triangle((scfr*CFrame.new(0,h/2,0)).p,(scfr*CFrame.new(0,-h/2,0)).p,(blcf*CFrame.new(0,h/2,0)).p) | |
737 | if a then game.Debris:AddItem(a,1) end if b then game.Debris:AddItem(b,1) end | |
738 | local a,b = Triangle((blcf*CFrame.new(0,h/2,0)).p,(blcf*CFrame.new(0,-h/2,0)).p,(scfr*CFrame.new(0,-h/2,0)).p) | |
739 | if a then game.Debris:AddItem(a,1) end if b then game.Debris:AddItem(b,1) end | |
740 | scfr = blcf | |
741 | elseif not scfr then | |
742 | scfr = blcf | |
743 | end | |
744 | hitbox.CFrame=prt9.CFrame*cf(0,-1,.4) | |
745 | wld1.C0=clerp(wld1.C0,euler(1.5,0,3.14)*euler(0,0,.3)*cf(0,1,0),.4) | |
746 | --wld1.C0=clerp(wld1.C0,euler(2,0,3.14)*cf(0,1,.2),.4) | |
747 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,-.5)*euler(.2,0,0),.4) | |
748 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,.5),.4) | |
749 | RW.C0=clerp(RW.C0,cf(1,0.5,-.5)*euler(.6,0,-1)*euler(0,-.7,0),.4) | |
750 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
751 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.4,0,-.2),.4) | |
752 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
753 | RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(0,-.5,0),.4) | |
754 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,-.5,0),.4) | |
755 | if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then | |
756 | break | |
757 | end | |
758 | end | |
759 | con1:disconnect() | |
760 | hitbox.Parent=nil | |
761 | attack=false | |
762 | end | |
763 | ||
764 | function attacktwo() | |
765 | attack=true | |
766 | for i=0,1,0.2 do | |
767 | swait() | |
768 | wld1.C0=clerp(wld1.C0,euler(1.5,0,3.14)*cf(0,1,0),.4) | |
769 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,-.7)*euler(.2,0,0),.4) | |
770 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,.7),.4) | |
771 | RW.C0=clerp(RW.C0,cf(1,0.5,-.5)*euler(1.57,0,-1)*euler(0,1.2,0),.4) | |
772 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
773 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.8,0,-.4),.4) | |
774 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
775 | RH.C0=clerp(RH.C0,cf(.8,-1,.2)*euler(0,1.57,0)*euler(0,-.7,0),.4) | |
776 | LH.C0=clerp(LH.C0,cf(-.8,-1,.2)*euler(0,-1.57,0)*euler(0,-.7,0),.4) | |
777 | if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then | |
778 | break | |
779 | end | |
780 | end | |
781 | con1=hitbox.Touched:connect(function(hit) Damagefunc(hit,10,15,math.random(5,10),"Normal",RootPart,.5,1,math.random(3,10),nil,true) end) | |
782 | hitbox.Parent=modelzorz | |
783 | hitbox.Size=vt(.5,7,1) | |
784 | hitbox.CFrame=prt9.CFrame*cf(0,-1,.4) | |
785 | blcf=nil | |
786 | scfr=nil | |
787 | for i=0,1,0.3 do | |
788 | swait() | |
789 | local blcf = prt9.CFrame*cf(0,-1,0) | |
790 | if scfr and (prt9.Position-scfr.p).magnitude > .1 then | |
791 | local h = 7 | |
792 | local a,b = Triangle((scfr*CFrame.new(0,h/2,0)).p,(scfr*CFrame.new(0,-h/2,0)).p,(blcf*CFrame.new(0,h/2,0)).p) | |
793 | if a then game.Debris:AddItem(a,1) end if b then game.Debris:AddItem(b,1) end | |
794 | local a,b = Triangle((blcf*CFrame.new(0,h/2,0)).p,(blcf*CFrame.new(0,-h/2,0)).p,(scfr*CFrame.new(0,-h/2,0)).p) | |
795 | if a then game.Debris:AddItem(a,1) end if b then game.Debris:AddItem(b,1) end | |
796 | scfr = blcf | |
797 | elseif not scfr then | |
798 | scfr = blcf | |
799 | end | |
800 | hitbox.CFrame=prt9.CFrame*cf(0,-1,.4) | |
801 | wld1.C0=clerp(wld1.C0,euler(.5,0,3.14)*cf(0,1,.2),.4) | |
802 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,.5)*euler(0,0,0),.4) | |
803 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,-.5),.4) | |
804 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1.3,0,1)*euler(0,1.6,0),.4) | |
805 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
806 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.2,0,-.2),.4) | |
807 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
808 | RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(0,.5,0),.4) | |
809 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,.5,0),.4) | |
810 | if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then | |
811 | break | |
812 | end | |
813 | end | |
814 | for i=0,1,0.2 do | |
815 | swait() | |
816 | local blcf = prt9.CFrame*cf(0,-1,0) | |
817 | if scfr and (prt9.Position-scfr.p).magnitude > .1 then | |
818 | local h = 7 | |
819 | local a,b = Triangle((scfr*CFrame.new(0,h/2,0)).p,(scfr*CFrame.new(0,-h/2,0)).p,(blcf*CFrame.new(0,h/2,0)).p) | |
820 | if a then game.Debris:AddItem(a,1) end if b then game.Debris:AddItem(b,1) end | |
821 | local a,b = Triangle((blcf*CFrame.new(0,h/2,0)).p,(blcf*CFrame.new(0,-h/2,0)).p,(scfr*CFrame.new(0,-h/2,0)).p) | |
822 | if a then game.Debris:AddItem(a,1) end if b then game.Debris:AddItem(b,1) end | |
823 | scfr = blcf | |
824 | elseif not scfr then | |
825 | scfr = blcf | |
826 | end | |
827 | hitbox.CFrame=prt9.CFrame*cf(0,-1,.4) | |
828 | wld1.C0=clerp(wld1.C0,euler(.3,0,3.14)*cf(0,1,.2),.4) | |
829 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,.5)*euler(.1,0,0),.4) | |
830 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,-.5),.4) | |
831 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1,0,.8)*euler(0,1.3,0),.4) | |
832 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
833 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.2,0,-.2),.4) | |
834 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
835 | RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(0,.5,0),.4) | |
836 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,.5,0),.4) | |
837 | if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then | |
838 | break | |
839 | end | |
840 | end | |
841 | con1:disconnect() | |
842 | hitbox.Parent=nil | |
843 | attack=false | |
844 | end | |
845 | ||
846 | function attackthree() | |
847 | attack=true | |
848 | for i=0,1,0.15 do | |
849 | swait() | |
850 | wld1.C0=clerp(wld1.C0,euler(2.9,0,3.14)*cf(0,1,.2),.4) | |
851 | gwld1.C0=clerp(gwld1.C0,euler(1.57,0,0)*cf(0,1,0),.4) | |
852 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,1.57),.4) | |
853 | RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,-.2)*euler(0,0,-1.57),.4) | |
854 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1.3,0,.5),.4) | |
855 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
856 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.57,0,-1.57),.4) | |
857 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
858 | RH.C0=clerp(RH.C0,cf(.5,-1,-.2)*euler(0,1.57,0)*euler(-.4,1.57,0),.4) | |
859 | LH.C0=clerp(LH.C0,cf(-.5,-1,.2)*euler(0,-1.57,0)*euler(.2,1.57,0),.4) | |
860 | if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then | |
861 | break | |
862 | end | |
863 | end | |
864 | for i=1,2 do | |
865 | LW.C0=cf(-1.5,0.5,0)*euler(1.57,0,-1.57) | |
866 | Shootcombo() | |
867 | for i=0,1,0.3 do | |
868 | swait() | |
869 | gwld6.C0=clerp(gwld6.C0,euler(0,0,0)*cf(0,.5,-.1),.6) | |
870 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.57,0,-1.57)*euler(.5,0,0),.5) | |
871 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.5) | |
872 | if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then | |
873 | break | |
874 | end | |
875 | end | |
876 | for i=0,1,0.2 do | |
877 | swait() | |
878 | gwld6.C0=clerp(gwld6.C0,euler(0,0,0)*cf(0,-.25,-.1),.4) | |
879 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.57,0,-1.57),.4) | |
880 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
881 | if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then | |
882 | break | |
883 | end | |
884 | end | |
885 | if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then | |
886 | break | |
887 | end | |
888 | end | |
889 | attack=false | |
890 | end | |
891 | ||
892 | function attackfour() | |
893 | attack=true | |
894 | for i=0,1,0.2 do | |
895 | swait() | |
896 | wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,.2),.4) | |
897 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,.2),.4) | |
898 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,-.3),.4) | |
899 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1,0,1.2)*euler(0,-2,0),.4) | |
900 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
901 | LW.C0=clerp(LW.C0,cf(-1.4,0.5,-.2)*euler(.7,0,.1)*euler(0,-.4,0),.4) | |
902 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
903 | RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(0,.3,0),.4) | |
904 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,.3,0),.4) | |
905 | if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then | |
906 | break | |
907 | end | |
908 | end | |
909 | con1=hitbox.Touched:connect(function(hit) Damagefunc(hit,15,20,math.random(5,10),"Normal",RootPart,.5,2,math.random(10,20),nil,true) end) | |
910 | hitbox.Parent=modelzorz | |
911 | hitbox.Size=vt(.5,7,1) | |
912 | hitbox.CFrame=prt9.CFrame*cf(0,-1,.4) | |
913 | blcf=nil | |
914 | scfr=nil | |
915 | for i=0,1,0.1 do | |
916 | swait() | |
917 | Torso.Velocity=RootPart.CFrame.lookVector*40 | |
918 | local blcf = prt9.CFrame*cf(0,-1,0) | |
919 | if scfr and (prt9.Position-scfr.p).magnitude > .1 then | |
920 | local h = 7 | |
921 | local a,b = Triangle((scfr*CFrame.new(0,h/2,0)).p,(scfr*CFrame.new(0,-h/2,0)).p,(blcf*CFrame.new(0,h/2,0)).p) | |
922 | if a then game.Debris:AddItem(a,1) end if b then game.Debris:AddItem(b,1) end | |
923 | local a,b = Triangle((blcf*CFrame.new(0,h/2,0)).p,(blcf*CFrame.new(0,-h/2,0)).p,(scfr*CFrame.new(0,-h/2,0)).p) | |
924 | if a then game.Debris:AddItem(a,1) end if b then game.Debris:AddItem(b,1) end | |
925 | scfr = blcf | |
926 | elseif not scfr then | |
927 | scfr = blcf | |
928 | end | |
929 | hitbox.CFrame=prt9.CFrame*cf(0,-1,.4) | |
930 | wld1.C0=clerp(wld1.C0,euler(.5,0,3.14)*cf(0,1,.2),.35) | |
931 | Neck.C0=clerp(Neck.C0,necko*euler(.2,0,-.6),.35) | |
932 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,.6),.35) | |
933 | RW.C0=clerp(RW.C0,cf(1,0.5,-0.5)*euler(1.2,0,-1.2)*euler(0,-1.2,0),.35) | |
934 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.35) | |
935 | LW.C0=clerp(LW.C0,cf(-1.4,0.5,-.2)*euler(-.4,0,-.7)*euler(0,0,0),.35) | |
936 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.35) | |
937 | RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(0,-.6,0),.35) | |
938 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,-.6,0),.35) | |
939 | if Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then | |
940 | break | |
941 | end | |
942 | end | |
943 | con1:disconnect() | |
944 | hitbox.Parent=nil | |
945 | attack=false | |
946 | end | |
947 | ||
948 | function Punishment() | |
949 | attack=true | |
950 | local ref=part(3,workspace,0,1,BrickColor.new("Black"),"Effect",vt()) | |
951 | ref.Anchored=true | |
952 | ref.CFrame=RootPart.CFrame*cf(0,0,-2) | |
953 | game:GetService("Debris"):AddItem(ref,1) | |
954 | for _,c in pairs(workspace:children()) do | |
955 | local hum=c:findFirstChild("Humanoid") | |
956 | if hum~=nil then | |
957 | local head=c:findFirstChild("HumanoidRootPart") | |
958 | if head~=nil then | |
959 | if GetDist(head,ref,3)==true then | |
960 | if head.Parent:findFirstChild("Stats")~=nil then | |
961 | if head.Parent.Stats.Stunned.Value==true then | |
962 | Mvmt.Value=Mvmt.Value-1 | |
963 | for i=0,1,0.3 do | |
964 | swait() | |
965 | wld1.C0=clerp(wld1.C0,euler(-2,0,3.14)*cf(0,1,.2),.4) | |
966 | gwld1.C0=clerp(gwld1.C0,euler(1.57,0,0)*cf(0,1,0),.4) | |
967 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,-1.57)*euler(.2,0,0),.4) | |
968 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,1.57),.4) | |
969 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1.57,0,1.57)*euler(2,0,0),.4) | |
970 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
971 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.2,0,-.4),.4) | |
972 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
973 | RH.C0=clerp(RH.C0,cf(.5,-1,.2)*euler(0,1.57,0)*euler(0,-1.57,0),.4) | |
974 | LH.C0=clerp(LH.C0,cf(-.5,-1,-.2)*euler(0,-1.57,0)*euler(0,-1.57,0),.4) | |
975 | end | |
976 | for i=0,1,0.18 do | |
977 | swait() | |
978 | wld1.C0=clerp(wld1.C0,euler(-1.57,0,3.14)*cf(0,1,.2),.4) | |
979 | gwld1.C0=clerp(gwld1.C0,euler(1.57,0,0)*cf(0,1,0),.4) | |
980 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,-1.57)*euler(.2,0,0),.4) | |
981 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,1.57),.4) | |
982 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1.57,0,1.57),.4) | |
983 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
984 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.2,0,-.4),.4) | |
985 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.4) | |
986 | RH.C0=clerp(RH.C0,cf(.5,-1,.2)*euler(0,1.57,0)*euler(0,-1.57,0),.4) | |
987 | LH.C0=clerp(LH.C0,cf(-.5,-1,-.2)*euler(0,-1.57,0)*euler(0,-1.57,0),.4) | |
988 | end | |
989 | DecreaseStat(head.Parent,"Defense",.3,300) | |
990 | Damagefunc(head,10,20,math.random(5,10),"Normal",RootPart,.2,2,0,nil,nil,false) | |
991 | for i=0,1,0.05 do | |
992 | swait() | |
993 | MagicBlock(BrickColor.new("Really red"),cf(head.Parent.Torso.Position),1,1,1,2,2,2,.1,1) | |
994 | wld1.C0=clerp(wld1.C0,euler(-1.17,0,3.14)*cf(0,1,.2),.2) | |
995 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,1.57),.2) | |
996 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1.57,0,1.57)*euler(-.4,0,0),.2) | |
997 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-.2,0,-.4),.4) | |
998 | RH.C0=clerp(RH.C0,cf(.5,-1,.2)*euler(0,1.57,0)*euler(0,-1.57,0),.4) | |
999 | LH.C0=clerp(LH.C0,cf(-.5,-1,-.2)*euler(0,-1.57,0)*euler(0,-1.57,0),.4) | |
1000 | end | |
1001 | Neck.C0=necko*euler(0,0,-1.57)*euler(.2,0,0) | |
1002 | swait(10) | |
1003 | Mvmt.Value=Mvmt.Value+1 | |
1004 | end | |
1005 | end | |
1006 | end | |
1007 | end | |
1008 | end | |
1009 | end | |
1010 | attack=false | |
1011 | end | |
1012 | ||
1013 | function GunStance() | |
1014 | attack=true | |
1015 | gun=true | |
1016 | Mvmt.Value=Mvmt.Value-.4 | |
1017 | for i=0,1,0.1 do | |
1018 | swait() | |
1019 | wld1.C0=clerp(wld1.C0,euler(2.9,0,3.14)*cf(0,1,.2),.2) | |
1020 | gwld6.C0=clerp(gwld6.C0,euler(0,0,0)*cf(0,-.25,-.1),.4) | |
1021 | --gwld1.C0=clerp(gwld1.C0,euler(1.57,0,0)*cf(0,1,0),.4) | |
1022 | gwld1.C0=euler(1.57-8*i,0,0)*cf(0,1,0) | |
1023 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,1.57)*euler(-.4,0,0),.2) | |
1024 | RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,-.2)*euler(0,0,-1.57),.2) | |
1025 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1.3,0,1),.2) | |
1026 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
1027 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.57,0,-1.57)*euler(1,0,0),.2) | |
1028 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
1029 | RH.C0=clerp(RH.C0,cf(.5,-1,-.2)*euler(0,1.57,0)*euler(-.4,1.57,0),.2) | |
1030 | LH.C0=clerp(LH.C0,cf(-.5,-1,.2)*euler(0,-1.57,0)*euler(.2,1.57,0),.2) | |
1031 | end | |
1032 | RootJoint.C0=RootCF*cf(0,0,-.2)*euler(0,0,-1.57) | |
1033 | LW.C0=cf(-1.5,0.5,0)*euler(1.57,0,-1.57) | |
1034 | gairo=Instance.new("BodyGyro") | |
1035 | gairo.Parent=RootPart | |
1036 | gairo.maxTorque=Vector3.new(4e+005,4e+005,4e+005)*math.huge | |
1037 | gairo.P=20e+003 | |
1038 | gairo.cframe=RootPart.CFrame | |
1039 | local offset=nil | |
1040 | while gun==true do | |
1041 | swait() | |
1042 | local gunpos=vt(MMouse.Hit.p.x,Head.Position.Y,MMouse.Hit.p.z) | |
1043 | offset=(Torso.Position.y-MMouse.Hit.p.y)/60 | |
1044 | mag=(Torso.Position-MMouse.Hit.p).magnitude/80 | |
1045 | offset=offset/mag | |
1046 | gairo.cframe=cf(Head.Position,gunpos) | |
1047 | gwld1.C0=clerp(gwld1.C0,euler(1.57,0,0)*cf(0,1,0),.3) | |
1048 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,1.57),.3) | |
1049 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(offset,0,0),.2) | |
1050 | end | |
1051 | Mvmt.Value=Mvmt.Value+.4 | |
1052 | if shoot==true then | |
1053 | for i=0,1,0.1 do | |
1054 | swait() | |
1055 | gwld6.C0=clerp(gwld6.C0,euler(0,0,0)*cf(0,.5,-.1),.6) | |
1056 | gwld1.C0=clerp(gwld1.C0,euler(1.57,0,0)*cf(0,1,0),.2) | |
1057 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,1.57)*euler(0,0,0),.2) | |
1058 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.57,0,-1.57)*euler(1,0,0),.2) | |
1059 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
1060 | end | |
1061 | end | |
1062 | gairo.Parent=nil | |
1063 | shoot=false | |
1064 | attack=false | |
1065 | end | |
1066 | ||
1067 | function Shootcombo() | |
1068 | table.insert(Effects,{gprt16.CFrame.lookVector,"Shoot",30,gprt8.Position,5,10,0,1}) | |
1069 | end | |
1070 | ||
1071 | function Shoot1() | |
1072 | table.insert(Effects,{gprt16.CFrame.lookVector,"Shoot",100,gprt8.Position,10,20,math.random(10,20),2}) | |
1073 | end | |
1074 | ||
1075 | function DecreaseStat(Model,Stat,Amount,Duration) | |
1076 | if Model:findFirstChild("Stats")~=nil then | |
1077 | if Model.Stats[Stat]~=nil then | |
1078 | Model.Stats[Stat].Value=Model.Stats[Stat].Value-Amount | |
1079 | table.insert(Effects,{Model,"DecreaseStat",Stat,Amount,Duration}) | |
1080 | end | |
1081 | end | |
1082 | end | |
1083 | ||
1084 | function GetDist(Part1,Part2,magni) | |
1085 | local targ=Part1.Position-Part2.Position | |
1086 | local mag=targ.magnitude | |
1087 | if mag<=magni then | |
1088 | return true | |
1089 | else | |
1090 | return false | |
1091 | end | |
1092 | end | |
1093 | ||
1094 | function MagniDamage(Part,magni,mindam,maxdam,knock,Type) | |
1095 | for _,c in pairs(workspace:children()) do | |
1096 | local hum=c:findFirstChild("Humanoid") | |
1097 | if hum~=nil then | |
1098 | local head=c:findFirstChild("Torso") | |
1099 | if head~=nil then | |
1100 | local targ=head.Position-Part.Position | |
1101 | local mag=targ.magnitude | |
1102 | if mag<=magni and c.Name~=Player.Name then | |
1103 | Damagefunc(head,mindam,maxdam,knock,Type,RootPart,.2,1,3) | |
1104 | end | |
1105 | end | |
1106 | end | |
1107 | end | |
1108 | end | |
1109 | ||
1110 | function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants | |
1111 | return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore) | |
1112 | end | |
1113 | ||
1114 | local Point=Torso.CFrame*cf(0,Torso.Size.Y,0) | |
1115 | LastPoint=Point | |
1116 | function effect(Color,Ref,LP,P1,returnn) | |
1117 | if LP==nil or P1==nil then return end | |
1118 | local effectsmsh=Instance.new("CylinderMesh") | |
1119 | effectsmsh.Scale=Vector3.new(0.2,1,0.2) | |
1120 | effectsmsh.Name="Mesh" | |
1121 | local effectsg=Instance.new("Part") | |
1122 | NoOutline(effectsg) | |
1123 | effectsg.formFactor=3 | |
1124 | effectsg.CanCollide=false | |
1125 | effectsg.Name="Eff" | |
1126 | effectsg.Locked=true | |
1127 | effectsg.Anchored=true | |
1128 | effectsg.Size=Vector3.new(0.5,1,0.5) | |
1129 | effectsg.Parent=workspace | |
1130 | effectsmsh.Parent=effectsg | |
1131 | effectsg.BrickColor=BrickColor.new(Color) | |
1132 | effectsg.Reflectance=Ref | |
1133 | local point1=P1 | |
1134 | local mg=(LP.p - point1.p).magnitude | |
1135 | effectsg.Size=Vector3.new(0.5,mg,0.5) | |
1136 | effectsg.CFrame=cf((LP.p+point1.p)/2,point1.p) * CFrame.Angles(math.rad(90),0,0) | |
1137 | effectsmsh.Scale=Vector3.new(0.2,1,0.2) | |
1138 | game:GetService("Debris"):AddItem(effectsg,2) | |
1139 | if returnn then return effectsg end | |
1140 | if not returnn then | |
1141 | table.insert(Effects,{effectsg,"Cylinder",0.2,0.01,0,0.01,effectsmsh}) | |
1142 | end | |
1143 | end | |
1144 | ||
1145 | local function CFrameFromTopBack(at, top, back) | |
1146 | local right = top:Cross(back) | |
1147 | return CFrame.new(at.x, at.y, at.z, | |
1148 | right.x, top.x, back.x, | |
1149 | right.y, top.y, back.y, | |
1150 | right.z, top.z, back.z) | |
1151 | end | |
1152 | ||
1153 | function Triangle(a, b, c) | |
1154 | local edg1 = (c-a):Dot((b-a).unit) | |
1155 | local edg2 = (a-b):Dot((c-b).unit) | |
1156 | local edg3 = (b-c):Dot((a-c).unit) | |
1157 | if edg1 <= (b-a).magnitude and edg1 >= 0 then | |
1158 | a, b, c = a, b, c | |
1159 | elseif edg2 <= (c-b).magnitude and edg2 >= 0 then | |
1160 | a, b, c = b, c, a | |
1161 | elseif edg3 <= (a-c).magnitude and edg3 >= 0 then | |
1162 | a, b, c = c, a, b | |
1163 | else | |
1164 | assert(false, "unreachable") | |
1165 | end | |
1166 | ||
1167 | local len1 = (c-a):Dot((b-a).unit) | |
1168 | local len2 = (b-a).magnitude - len1 | |
1169 | local width = (a + (b-a).unit*len1 - c).magnitude | |
1170 | ||
1171 | local maincf = CFrameFromTopBack(a, (b-a):Cross(c-b).unit, -(b-a).unit) | |
1172 | ||
1173 | local list = {} | |
1174 | ||
1175 | if len1 > 0.01 then | |
1176 | local w1 = Instance.new('WedgePart', m) | |
1177 | game:GetService("Debris"):AddItem(w1,5) | |
1178 | w1.Material = "SmoothPlastic" | |
1179 | w1.FormFactor = 'Custom' | |
1180 | w1.BrickColor = BrickColor.new("Bright red") | |
1181 | w1.Transparency = 0 | |
1182 | w1.Reflectance = 0 | |
1183 | w1.Material = "SmoothPlastic" | |
1184 | w1.CanCollide = false | |
1185 | NoOutline(w1) | |
1186 | local sz = Vector3.new(0.2, width, len1) | |
1187 | w1.Size = sz | |
1188 | local sp = Instance.new("SpecialMesh",w1) | |
1189 | sp.MeshType = "Wedge" | |
1190 | sp.Scale = Vector3.new(0,1,1) * sz/w1.Size | |
1191 | w1:BreakJoints() | |
1192 | w1.Anchored = true | |
1193 | w1.Parent = workspace | |
1194 | w1.Transparency = 0.7 | |
1195 | table.insert(Effects,{w1,"Disappear",.05}) | |
1196 | w1.CFrame = maincf*CFrame.Angles(math.pi,0,math.pi/2)*CFrame.new(0,width/2,len1/2) | |
1197 | table.insert(list,w1) | |
1198 | end | |
1199 | ||
1200 | if len2 > 0.01 then | |
1201 | local w2 = Instance.new('WedgePart', m) | |
1202 | game:GetService("Debris"):AddItem(w2,5) | |
1203 | w2.Material = "SmoothPlastic" | |
1204 | w2.FormFactor = 'Custom' | |
1205 | w2.BrickColor = BrickColor.new("Bright red") | |
1206 | w2.Transparency = 0 | |
1207 | w2.Reflectance = 0 | |
1208 | w2.Material = "SmoothPlastic" | |
1209 | w2.CanCollide = false | |
1210 | NoOutline(w2) | |
1211 | local sz = Vector3.new(0.2, width, len2) | |
1212 | w2.Size = sz | |
1213 | local sp = Instance.new("SpecialMesh",w2) | |
1214 | sp.MeshType = "Wedge" | |
1215 | sp.Scale = Vector3.new(0,1,1) * sz/w2.Size | |
1216 | w2:BreakJoints() | |
1217 | w2.Anchored = true | |
1218 | w2.Parent = workspace | |
1219 | w2.Transparency = 0.7 | |
1220 | table.insert(Effects,{w2,"Disappear",.05}) | |
1221 | w2.CFrame = maincf*CFrame.Angles(math.pi,math.pi,-math.pi/2)*CFrame.new(0,width/2,-len1 - len2/2) | |
1222 | table.insert(list,w2) | |
1223 | end | |
1224 | return unpack(list) | |
1225 | end | |
1226 | ||
1227 | function MagicBlock(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay,Type,parent) | |
1228 | local prt=part(3,workspace,0,0,brickcolor,"Effect",vt()) | |
1229 | prt.Anchored=true | |
1230 | prt.CFrame=cframe | |
1231 | msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1)) | |
1232 | game:GetService("Debris"):AddItem(prt,5) | |
1233 | if Type==1 or Type==nil then | |
1234 | table.insert(Effects,{prt,"Block1",delay,x3,y3,z3,msh}) | |
1235 | elseif Type==2 then | |
1236 | table.insert(Effects,{prt,"Block2",delay,x3,y3,z3,msh}) | |
1237 | end | |
1238 | end | |
1239 | ||
1240 | function MagicCircle(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay) | |
1241 | local prt=part(3,workspace,0,0,brickcolor,"Effect",vt()) | |
1242 | prt.Anchored=true | |
1243 | prt.CFrame=cframe | |
1244 | local msh=mesh("SpecialMesh",prt,"Sphere","nil",vt(0,0,0),vt(x1,y1,z1)) | |
1245 | game:GetService("Debris"):AddItem(prt,2) | |
1246 | table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3,msh}) | |
1247 | end | |
1248 | ||
1249 | function MagicCylinder(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay) | |
1250 | local prt=part(3,workspace,0,0,brickcolor,"Effect",vt()) | |
1251 | prt.Anchored=true | |
1252 | prt.CFrame=cframe | |
1253 | local msh=mesh("CylinderMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1)) | |
1254 | game:GetService("Debris"):AddItem(prt,2) | |
1255 | table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3,msh}) | |
1256 | end | |
1257 | ||
1258 | function MagicHead(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay) | |
1259 | local prt=part(3,workspace,0,0,brickcolor,"Effect",vt()) | |
1260 | prt.Anchored=true | |
1261 | prt.CFrame=cframe | |
1262 | local msh=mesh("SpecialMesh",prt,"Head","nil",vt(0,0,0),vt(x1,y1,z1)) | |
1263 | game:GetService("Debris"):AddItem(prt,2) | |
1264 | table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3,msh}) | |
1265 | end | |
1266 | ||
1267 | function ClangEffect(brickcolor,cframe,duration,decrease,size,power) | |
1268 | local prt=part(3,workspace,0,1,brickcolor,"Effect",vt()) | |
1269 | prt.Anchored=true | |
1270 | prt.CFrame=cframe | |
1271 | local msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(5,5,5)) | |
1272 | game:GetService("Debris"):AddItem(prt,2) | |
1273 | table.insert(Effects,{prt,"CylinderClang",duration,decrease,size,power,prt.CFrame,nil}) | |
1274 | end | |
1275 | ||
1276 | function MagicWave(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay) | |
1277 | local prt=part(3,workspace,0,0,brickcolor,"Effect",vt()) | |
1278 | prt.Anchored=true | |
1279 | prt.CFrame=cframe | |
1280 | local msh=mesh("SpecialMesh",prt,"FileMesh","http://www.roblox.com/asset/?id=20329976",vt(0,0,0),vt(x1,y1,z1)) | |
1281 | game:GetService("Debris"):AddItem(prt,5) | |
1282 | table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3,msh}) | |
1283 | end | |
1284 | ||
1285 | Damagefunc=function(hit,minim,maxim,knockback,Type,Property,Delay,KnockbackType,incstun,stagger,staghit,ranged) | |
1286 | if hit.Parent==nil then | |
1287 | return | |
1288 | end | |
1289 | if hit.Name=="Hitbox" and hit.Parent~=modelzorz then | |
1290 | StaggerHit.Value=true | |
1291 | end | |
1292 | h=hit.Parent:FindFirstChild("Humanoid") | |
1293 | for _,v in pairs(hit.Parent:children()) do | |
1294 | if v:IsA("Humanoid") then | |
1295 | h=v | |
1296 | end | |
1297 | end | |
1298 | if hit.Parent.Parent:FindFirstChild("Torso")~=nil then | |
1299 | h=hit.Parent.Parent:FindFirstChild("Humanoid") | |
1300 | end | |
1301 | if hit.Parent.className=="Hat" then | |
1302 | hit=hit.Parent.Parent:findFirstChild("Head") | |
1303 | end | |
1304 | if h~=nil and hit.Parent.Name~=Character.Name and hit.Parent:FindFirstChild("Torso")~=nil then | |
1305 | if hit.Parent:findFirstChild("DebounceHit")~=nil then if hit.Parent.DebounceHit.Value==true then return end end | |
1306 | c=Instance.new("ObjectValue") | |
1307 | c.Name="creator" | |
1308 | c.Value=game:service("Players").LocalPlayer | |
1309 | c.Parent=h | |
1310 | RecentEnemy.Value=hit.Parent | |
1311 | game:GetService("Debris"):AddItem(c,.5) | |
1312 | minim=minim*Atk.Value | |
1313 | maxim=maxim*Atk.Value | |
1314 | Damage=math.random(minim,maxim) | |
1315 | blocked=false | |
1316 | enblock=nil | |
1317 | Stats=hit.Parent:findFirstChild("Stats") | |
1318 | if Stats~=nil then | |
1319 | enblock=Stats:findFirstChild("Block") | |
1320 | if Stats:findFirstChild("Defense")~=nil then | |
1321 | Damage=Damage/Stats.Defense.Value | |
1322 | if Damage<=3 and staghit==true then | |
1323 | if ranged~=true then | |
1324 | StaggerHit.Value=true | |
1325 | end | |
1326 | end | |
1327 | end | |
1328 | if Stats:findFirstChild("Stun")~=nil then | |
1329 | Stats.Stun.Value=Stats.Stun.Value+incstun | |
1330 | end | |
1331 | if Stats:findFirstChild("Stagger")~=nil then | |
1332 | if stagger==true then | |
1333 | Stats.Stagger.Value=true | |
1334 | end | |
1335 | end | |
1336 | end | |
1337 | if enblock~=nil then | |
1338 | if enblock.Value==true then | |
1339 | blocked=true | |
1340 | end | |
1341 | end | |
1342 | if blocked==true then | |
1343 | showDamage(hit.Parent,"Block",.5,BrickColor.new("Bright blue")) | |
1344 | if ranged~=true then | |
1345 | enblock.Value=false | |
1346 | Stagger.Value=true | |
1347 | end | |
1348 | else | |
1349 | Damage=math.floor(Damage) | |
1350 | h.Health=h.Health-Damage | |
1351 | showDamage(hit.Parent,Damage,.5,BrickColor:Red()) | |
1352 | if Type=="NormalDecreaseMvmt1" then | |
1353 | DecreaseStat(hit.Parent,"Movement",.1,200) | |
1354 | end | |
1355 | if Type=="Knockdown" then | |
1356 | hum=hit.Parent.Humanoid | |
1357 | hum.PlatformStand=true | |
1358 | coroutine.resume(coroutine.create(function(HHumanoid) | |
1359 | swait(1) | |
1360 | HHumanoid.PlatformStand=false | |
1361 | end),hum) | |
1362 | local angle=(hit.Position-(Property.Position+Vector3.new(0,0,0))).unit | |
1363 | --hit.CFrame=cf(hit.Position,Vector3.new(angle.x,hit.Position.y,angle.z))*CFrame.fromEulerAnglesXYZ(math.pi/4,0,0) | |
1364 | local bodvol=Instance.new("BodyVelocity") | |
1365 | bodvol.velocity=angle*knockback | |
1366 | bodvol.P=5000 | |
1367 | bodvol.maxForce=Vector3.new(8e+003, 8e+003, 8e+003) | |
1368 | bodvol.Parent=hit | |
1369 | rl=Instance.new("BodyAngularVelocity") | |
1370 | rl.P=3000 | |
1371 | rl.maxTorque=Vector3.new(500000,500000,500000)*50000000000000 | |
1372 | rl.angularvelocity=Vector3.new(math.random(-10,10),math.random(-10,10),math.random(-10,10)) | |
1373 | rl.Parent=hit | |
1374 | game:GetService("Debris"):AddItem(bodvol,.5) | |
1375 | game:GetService("Debris"):AddItem(rl,.5) | |
1376 | elseif Type=="Knockdown2" then | |
1377 | hum=hit.Parent.Humanoid | |
1378 | local angle=(hit.Position-(Property.Position+Vector3.new(0,0,0))).unit | |
1379 | local bodvol=Instance.new("BodyVelocity") | |
1380 | bodvol.velocity=angle*knockback | |
1381 | bodvol.P=5000 | |
1382 | bodvol.maxForce=Vector3.new(8e+003, 8e+003, 8e+003) | |
1383 | bodvol.Parent=hit | |
1384 | game:GetService("Debris"):AddItem(bodvol,.5) | |
1385 | elseif Type=="Normal" or Type=="NormalDecreaseMvmt1" then | |
1386 | vp=Instance.new("BodyVelocity") | |
1387 | vp.P=500 | |
1388 | vp.maxForce=Vector3.new(math.huge,0,math.huge) | |
1389 | if KnockbackType==1 then | |
1390 | vp.velocity=Property.CFrame.lookVector*knockback+Property.Velocity/1.05 | |
1391 | elseif KnockbackType==2 then | |
1392 | vp.velocity=Property.CFrame.lookVector*knockback | |
1393 | end | |
1394 | game:GetService("Debris"):AddItem(vp,.5) | |
1395 | if knockback>0 then | |
1396 | vp.Parent=hit.Parent.Torso | |
1397 | end | |
1398 | end | |
1399 | end | |
1400 | debounce=Instance.new("BoolValue") | |
1401 | debounce.Name="DebounceHit" | |
1402 | debounce.Parent=hit.Parent | |
1403 | debounce.Value=true | |
1404 | game:GetService("Debris"):AddItem(debounce,Delay) | |
1405 | c=Instance.new("ObjectValue") | |
1406 | c.Name="creator" | |
1407 | c.Value=Player | |
1408 | c.Parent=h | |
1409 | game:GetService("Debris"):AddItem(c,.5) | |
1410 | CRIT=false | |
1411 | end | |
1412 | end | |
1413 | ||
1414 | showDamage=function(Char,Dealt,du,Color) | |
1415 | m=Instance.new("Model") | |
1416 | m.Name=tostring(Dealt) | |
1417 | h=Instance.new("Humanoid") | |
1418 | h.Health=0 | |
1419 | h.MaxHealth=0 | |
1420 | h.Parent=m | |
1421 | c=Instance.new("Part") | |
1422 | c.Transparency=0 | |
1423 | c.BrickColor=Color | |
1424 | c.Name="Head" | |
1425 | c.TopSurface=0 | |
1426 | c.BottomSurface=0 | |
1427 | c.formFactor="Plate" | |
1428 | c.Size=Vector3.new(1,.4,1) | |
1429 | ms=Instance.new("CylinderMesh") | |
1430 | ms.Scale=Vector3.new(.8,.8,.8) | |
1431 | if CRIT==true then | |
1432 | ms.Scale=Vector3.new(1,1.25,1) | |
1433 | end | |
1434 | ms.Parent=c | |
1435 | c.Reflectance=0 | |
1436 | Instance.new("BodyGyro").Parent=c | |
1437 | c.Parent=m | |
1438 | if Char:findFirstChild("Head")~=nil then | |
1439 | c.CFrame=cf(Char["Head"].CFrame.p+Vector3.new(0,1.5,0)) | |
1440 | elseif Char.Parent:findFirstChild("Head")~=nil then | |
1441 | c.CFrame=cf(Char.Parent["Head"].CFrame.p+Vector3.new(0,1.5,0)) | |
1442 | end | |
1443 | f=Instance.new("BodyPosition") | |
1444 | f.P=2000 | |
1445 | f.D=100 | |
1446 | f.maxForce=Vector3.new(math.huge,math.huge,math.huge) | |
1447 | f.position=c.Position+Vector3.new(0,3,0) | |
1448 | f.Parent=c | |
1449 | game:GetService("Debris"):AddItem(m,.5+du) | |
1450 | c.CanCollide=false | |
1451 | m.Parent=workspace | |
1452 | c.CanCollide=false | |
1453 | end | |
1454 | ||
1455 | combo=0 | |
1456 | function ob1d(mouse) | |
1457 | if gun==true and mana>=10 then | |
1458 | mana=mana-10 | |
1459 | shoot=true | |
1460 | Shoot1() | |
1461 | gun=false | |
1462 | end | |
1463 | if attack==true or equipped==false then return end | |
1464 | hold=true | |
1465 | if combo==0 then | |
1466 | combo=1 | |
1467 | attackone() | |
1468 | elseif combo==1 then | |
1469 | combo=2 | |
1470 | attacktwo() | |
1471 | elseif combo==2 then | |
1472 | combo=3 | |
1473 | attackthree() | |
1474 | elseif combo==3 then | |
1475 | combo=0 | |
1476 | attackfour() | |
1477 | end | |
1478 | coroutine.resume(coroutine.create(function() | |
1479 | for i=1,50 do | |
1480 | if attack==false then | |
1481 | swait() | |
1482 | end | |
1483 | end | |
1484 | if attack==false then | |
1485 | combo=0 | |
1486 | end | |
1487 | end)) | |
1488 | end | |
1489 | ||
1490 | function ob1u(mouse) | |
1491 | hold = false | |
1492 | end | |
1493 | ||
1494 | buttonhold = false | |
1495 | ||
1496 | eul=0 | |
1497 | equipped=false | |
1498 | function key(key) | |
1499 | if key=="g" then | |
1500 | if gun==true then | |
1501 | gun=false | |
1502 | end | |
1503 | end | |
1504 | if attack==true then return end | |
1505 | if key=="f" then | |
1506 | attack=true | |
1507 | if equipped==false then | |
1508 | equipped=true | |
1509 | RSH=ch.Torso["Right Shoulder"] | |
1510 | LSH=ch.Torso["Left Shoulder"] | |
1511 | -- | |
1512 | RSH.Parent=nil | |
1513 | LSH.Parent=nil | |
1514 | -- | |
1515 | RW.Name="Right Shoulder" | |
1516 | RW.Part0=ch.Torso | |
1517 | RW.C0=cf(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5) | |
1518 | RW.C1=cf(0, 0.5, 0) | |
1519 | RW.Part1=ch["Right Arm"] | |
1520 | RW.Parent=ch.Torso | |
1521 | -- | |
1522 | LW.Name="Left Shoulder" | |
1523 | LW.Part0=ch.Torso | |
1524 | LW.C0=cf(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8) | |
1525 | LW.C1=cf(0, 0.5, 0) | |
1526 | LW.Part1=ch["Left Arm"] | |
1527 | LW.Parent=ch.Torso | |
1528 | -- | |
1529 | equipanim() | |
1530 | else | |
1531 | equipped=false | |
1532 | hideanim() | |
1533 | swait(0) | |
1534 | RW.Parent=nil | |
1535 | LW.Parent=nil | |
1536 | RSH.Parent=player.Character.Torso | |
1537 | LSH.Parent=player.Character.Torso | |
1538 | end | |
1539 | attack=false | |
1540 | end | |
1541 | if equipped==false then return end | |
1542 | if key=="g" then | |
1543 | if gun==false then | |
1544 | GunStance() | |
1545 | end | |
1546 | end | |
1547 | if key=="q" then | |
1548 | Punishment() | |
1549 | end | |
1550 | if key=="h" then | |
1551 | mana=100 | |
1552 | end | |
1553 | if key=="j" then | |
1554 | test() | |
1555 | end | |
1556 | if attack==false then | |
1557 | RecentEnemy.Value=nil | |
1558 | end | |
1559 | end | |
1560 | ||
1561 | function key2(key) | |
1562 | ||
1563 | ||
1564 | end | |
1565 | ||
1566 | function s(mouse) | |
1567 | mouse.Button1Down:connect(function() ob1d(mouse) end) | |
1568 | mouse.Button1Up:connect(function() ob1u(mouse) end) | |
1569 | mouse.KeyDown:connect(key) | |
1570 | mouse.KeyUp:connect(key2) | |
1571 | ||
1572 | player=Player | |
1573 | ch=Character | |
1574 | MMouse=mouse | |
1575 | end | |
1576 | ||
1577 | function ds(mouse) | |
1578 | end | |
1579 | ||
1580 | Bin.Selected:connect(s) | |
1581 | Bin.Deselected:connect(ds) | |
1582 | print("Vulca loaded.") | |
1583 | ||
1584 | local mananum=0 | |
1585 | local donum=0 | |
1586 | local stunnum=0 | |
1587 | local staggeranim=false | |
1588 | local stunanim=false | |
1589 | local Point=nil | |
1590 | local LastPoint=nil | |
1591 | while true do | |
1592 | hitbox2.Parent=hitbox.Parent | |
1593 | hitbox2.Size=hitbox.Size | |
1594 | hitbox2.CFrame=hitbox.CFrame | |
1595 | game:service'RunService'.RenderStepped:wait(0) | |
1596 | if Stagger.Value==true and staggeranim==false then | |
1597 | coroutine.resume(coroutine.create(function() | |
1598 | staggeranim=true | |
1599 | while attack==true do | |
1600 | swait() | |
1601 | end | |
1602 | StaggerAnim() | |
1603 | StaggerHit.Value=false | |
1604 | Stagger.Value=false | |
1605 | staggeranim=false | |
1606 | end)) | |
1607 | end | |
1608 | if StaggerHit.Value==true and staggeranim==false then | |
1609 | coroutine.resume(coroutine.create(function() | |
1610 | staggeranim=true | |
1611 | while attack==true do | |
1612 | swait() | |
1613 | end | |
1614 | StaggerHitt() | |
1615 | StaggerHit.Value=false | |
1616 | Stagger.Value=false | |
1617 | staggeranim=false | |
1618 | end)) | |
1619 | end | |
1620 | if Mvmt.Value<0 or Stagger.Value==true or Stun.Value>=100 or StaggerHit.Value==true then | |
1621 | Humanoid.WalkSpeed=0 | |
1622 | else | |
1623 | Humanoid.WalkSpeed=16*Mvmt.Value | |
1624 | end | |
1625 | if Stun.Value>=100 and stunanim==false then | |
1626 | coroutine.resume(coroutine.create(function() | |
1627 | stunanim=true | |
1628 | while attack==true do | |
1629 | swait() | |
1630 | end | |
1631 | StunAnim() | |
1632 | Stun.Value=0 | |
1633 | stunanim=false | |
1634 | end)) | |
1635 | end | |
1636 | if stunnum>=10 then | |
1637 | if Stun.Value>0 then | |
1638 | Stun.Value=Stun.Value-1 | |
1639 | end | |
1640 | stunnum=0 | |
1641 | end | |
1642 | stunnum=stunnum+1 | |
1643 | if donum>=.5 then | |
1644 | handidle=true | |
1645 | elseif donum<=0 then | |
1646 | handidle=false | |
1647 | end | |
1648 | if handidle==false then | |
1649 | donum=donum+0.003 | |
1650 | else | |
1651 | donum=donum-0.003 | |
1652 | end | |
1653 | local torvel=(RootPart.Velocity*Vector3.new(1,0,1)).magnitude | |
1654 | local velderp=RootPart.Velocity.y | |
1655 | hitfloor,posfloor=rayCast(RootPart.Position,(CFrame.new(RootPart.Position,RootPart.Position - Vector3.new(0,1,0))).lookVector,4,Character) | |
1656 | if equipped==true then | |
1657 | if attack==false then | |
1658 | idle=idle+1 | |
1659 | else | |
1660 | idle=0 | |
1661 | end | |
1662 | if idle>=500 then | |
1663 | if attack==false then | |
1664 | --Sheath() | |
1665 | end | |
1666 | end | |
1667 | if RootPart.Velocity.y > 1 and hitfloor==nil then | |
1668 | Anim="Jump" | |
1669 | if attack==false then | |
1670 | wld1.C0=clerp(wld1.C0,euler(2.9,0,3.14)*cf(0,1,.2),.2) | |
1671 | Neck.C0=clerp(Neck.C0,necko*euler(-0.2,0,0),.2) | |
1672 | Neck.C1=clerp(Neck.C1,necko2*euler(0,0,0),.2) | |
1673 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.2) | |
1674 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1,0,0.5),.2) | |
1675 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
1676 | LW.C0=clerp(LW.C0,cf(-1.2,0.5,-.4)*euler(1,0,.8)*euler(0,-.7,0),.2) | |
1677 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
1678 | RH.C0=clerp(RH.C0,cf(1,-1,-.3)*euler(-0.5,1.57,0)*euler(-.2,0,0),.2) | |
1679 | LH.C0=clerp(LH.C0,cf(-1,-1,-.3)*euler(-0.5,-1.57,0)*euler(-.2,0,0),.2) | |
1680 | end | |
1681 | elseif RootPart.Velocity.y < -1 and hitfloor==nil then | |
1682 | Anim="Fall" | |
1683 | if attack==false then | |
1684 | wld1.C0=clerp(wld1.C0,euler(2.9,0,3.14)*cf(0,1,.2),.2) | |
1685 | Neck.C0=clerp(Neck.C0,necko*euler(0.4,0,0),.2) | |
1686 | Neck.C1=clerp(Neck.C1,necko2*euler(0,0,0),.2) | |
1687 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.2) | |
1688 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(2,0,1),.2) | |
1689 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
1690 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-0.3,0,-0.2),.2) | |
1691 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
1692 | RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0.4,1.57,0),.2) | |
1693 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(-0.2,-1.57,0),.2) | |
1694 | end | |
1695 | elseif torvel<1 and hitfloor~=nil then | |
1696 | Anim="Idle" | |
1697 | if attack==false then | |
1698 | --wld1.C0=clerp(wld1.C0,euler(1.57,0,3.14)*cf(0,1,0),.15) | |
1699 | wld1.C0=clerp(wld1.C0,euler(2.9+(donum/3),0,3.14)*cf(0,1,.2),.15) | |
1700 | gwld6.C0=clerp(gwld6.C0,euler(0,0,0)*cf(0,-.25,-.1),.15) | |
1701 | gwld1.C0=clerp(gwld1.C0,euler(1.57,0,0)*cf(0,1,0),.15) | |
1702 | Neck.C0=clerp(Neck.C0,necko*euler(.2-(donum/5),0,0),.15) | |
1703 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.15) | |
1704 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1.3+(donum/3),0,.5-(donum/3)),.15) | |
1705 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.15) | |
1706 | LW.C0=clerp(LW.C0,cf(-1.2,0.5,-.4)*euler(.7+(donum/3),0,.4+(donum/3))*euler(0,-.4,0),.15) | |
1707 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.15) | |
1708 | RH.C0=clerp(RH.C0,RHC0,.2) | |
1709 | RH.C1=clerp(RH.C1,RHC1,.2) | |
1710 | LH.C0=clerp(LH.C0,LHC0,.2) | |
1711 | LH.C1=clerp(LH.C1,LHC1,.2) | |
1712 | end | |
1713 | elseif torvel>2 and torvel<22 and hitfloor~=nil then | |
1714 | Anim="Walk" | |
1715 | if attack==false then | |
1716 | gwld6.C0=clerp(gwld6.C0,euler(0,0,0)*cf(0,-.25,-.1),.2) | |
1717 | wld1.C0=clerp(wld1.C0,euler(2.9+(donum/3),0,3.14)*euler(0,.5,0)*cf(0,1,.2),.2) | |
1718 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,.5),.2) | |
1719 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0.1,0,-.5),.2) | |
1720 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1-(donum/3),0,.8-(donum/3)),.2) | |
1721 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
1722 | LW.C0=clerp(LW.C0,cf(-1.2,0.5,-.4)*euler(.5+(donum/3),0,.8+(donum/3))*euler(0,-.7,0),.2) | |
1723 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
1724 | RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(0,.6,0),.2) | |
1725 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,.5,0),.2) | |
1726 | end | |
1727 | elseif torvel>=22 and hitfloor~=nil then | |
1728 | Anim="Run" | |
1729 | if attack==false then | |
1730 | gwld6.C0=clerp(gwld6.C0,euler(0,0,0)*cf(0,-.25,-.1),.2) | |
1731 | wld1.C0=clerp(wld1.C0,euler(2.9+(donum/3),0,3.14)*cf(0,1,.2),.2) | |
1732 | Neck.C0=clerp(Neck.C0,necko*euler(0,0,.5),.2) | |
1733 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0.1,0,-.5),.2) | |
1734 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1-(donum/3),0,.8-(donum/3)),.2) | |
1735 | RW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
1736 | LW.C0=clerp(LW.C0,cf(-1.2,0.5,-.4)*euler(.5+(donum/3),0,.8+(donum/3))*euler(0,-.7,0),.2) | |
1737 | LW.C1=clerp(LW.C1,cf(0,0.5,0)*euler(0,0,0),.2) | |
1738 | RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0,1.57,0)*euler(0,.6,0),.2) | |
1739 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(0,-1.57,0)*euler(0,.5,0),.2) | |
1740 | end | |
1741 | end | |
1742 | end | |
1743 | if #Effects>0 then | |
1744 | --table.insert(Effects,{prt,"Block1",delay}) | |
1745 | for e=1,#Effects do | |
1746 | if Effects[e]~=nil then | |
1747 | --for j=1,#Effects[e] do | |
1748 | local Thing=Effects[e] | |
1749 | if Thing~=nil then | |
1750 | local Part=Thing[1] | |
1751 | local Mode=Thing[2] | |
1752 | local Delay=Thing[3] | |
1753 | local IncX=Thing[4] | |
1754 | local IncY=Thing[5] | |
1755 | local IncZ=Thing[6] | |
1756 | if Thing[2]=="DecreaseStat" then | |
1757 | Thing[5]=Thing[5]-1 | |
1758 | if Thing[5]<=0 then | |
1759 | if Thing[1]:findFirstChild("Stats")~=nil then | |
1760 | Thing[1].Stats[Thing[3]].Value=Thing[1].Stats[Thing[3]].Value+Thing[4] | |
1761 | end | |
1762 | table.remove(Effects,e) | |
1763 | end | |
1764 | end | |
1765 | if Thing[2]=="Shoot" then | |
1766 | local Look=Thing[1] | |
1767 | local hit,pos = rayCast(Thing[4],Look,20,modelzorz) | |
1768 | local mag=(Thing[4]-pos).magnitude | |
1769 | MagicHead(BrickColor.new("Really red"),CFrame.new((Thing[4]+pos)/2,pos)*angles(1.57,0,0),1,mag*5,1,.5,0,.5,0.1) | |
1770 | Thing[4]=Thing[4]+(Look*20) | |
1771 | Thing[3]=Thing[3]-1 | |
1772 | if hit~=nil then | |
1773 | Thing[3]=0 | |
1774 | if Thing[8]==1 then | |
1775 | Damagefunc(hit,Thing[5],Thing[6],Thing[7],"Normal",RootPart,0,2,math.random(1,5),nil,nil,true) | |
1776 | elseif Thing[8]==2 then | |
1777 | Damagefunc(hit,Thing[5],Thing[6],Thing[7],"NormalDecreaseMvmt1",RootPart,0,2,math.random(1,5),nil,nil,true) | |
1778 | end | |
1779 | ref=part(3,workspace,0,1,BrickColor.new("Really red"),"Reference",vt()) | |
1780 | ref.Anchored=true | |
1781 | ref.CFrame=cf(pos) | |
1782 | MagicCircle(BrickColor.new("Really red"),cf(pos),5,5,5,1,1,1,0.03) | |
1783 | game:GetService("Debris"):AddItem(ref,1) | |
1784 | end | |
1785 | if Thing[3]<=0 then | |
1786 | table.remove(Effects,e) | |
1787 | end | |
1788 | end | |
1789 | if Thing[2]=="CylinderClang" then | |
1790 | if Thing[3]<=1 then | |
1791 | Thing[1].CFrame=Thing[1].CFrame*CFrame.new(0,2.5*Thing[5],0)*CFrame.fromEulerAnglesXYZ(Thing[6],0,0) | |
1792 | Thing[7]=Thing[1].CFrame | |
1793 | effect("New Yeller",0,Thing[8],Thing[7]) | |
1794 | Thing[8]=Thing[7] | |
1795 | Thing[3]=Thing[3]+Thing[4] | |
1796 | else | |
1797 | Part.Parent=nil | |
1798 | table.remove(Effects,e) | |
1799 | end | |
1800 | --[[Mesh=Thing[7] | |
1801 | Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6]) | |
1802 | Thing[1].Transparency=Thing[1].Transparency+Thing[3]] | |
1803 | end | |
1804 | if Thing[2]~="Shoot" and Thing[2]~="DecreaseStat" then | |
1805 | if Thing[1].Transparency<=1 then | |
1806 | if Thing[2]=="Block1" then | |
1807 | Thing[1].CFrame=Thing[1].CFrame*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50)) | |
1808 | Mesh=Thing[7] | |
1809 | Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6]) | |
1810 | Thing[1].Transparency=Thing[1].Transparency+Thing[3] | |
1811 | elseif Thing[2]=="Block2" then | |
1812 | Thing[1].CFrame=Thing[1].CFrame | |
1813 | Mesh=Thing[7] | |
1814 | Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6]) | |
1815 | Thing[1].Transparency=Thing[1].Transparency+Thing[3] | |
1816 | elseif Thing[2]=="Cylinder" then | |
1817 | Mesh=Thing[7] | |
1818 | Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6]) | |
1819 | Thing[1].Transparency=Thing[1].Transparency+Thing[3] | |
1820 | elseif Thing[2]=="Blood" then | |
1821 | Mesh=Thing[7] | |
1822 | Thing[1].CFrame=Thing[1].CFrame*cf(0,.5,0) | |
1823 | Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6]) | |
1824 | Thing[1].Transparency=Thing[1].Transparency+Thing[3] | |
1825 | elseif Thing[2]=="Elec" then | |
1826 | Mesh=Thing[7] | |
1827 | Mesh.Scale=Mesh.Scale+vt(Thing[7],Thing[8],Thing[9]) | |
1828 | Thing[1].Transparency=Thing[1].Transparency+Thing[3] | |
1829 | elseif Thing[2]=="Disappear" then | |
1830 | Thing[1].Transparency=Thing[1].Transparency+Thing[3] | |
1831 | end | |
1832 | else | |
1833 | Part.Parent=nil | |
1834 | table.remove(Effects,e) | |
1835 | end | |
1836 | end | |
1837 | end | |
1838 | --end | |
1839 | end | |
1840 | end | |
1841 | end | |
1842 | fenbarmana2:TweenSize(UDim2.new(4*mana/100,0,0.2,0),nil,1,0.4,true) | |
1843 | fenbarmana4.Text="Mana("..mana..")" | |
1844 | gmsh15.Scale=vt(2.21,5*mana/100,.9) | |
1845 | gwld15.C0=euler(0,0,0)*cf(0,0,0)*cf(0,.5/(100/(100-mana)),0) | |
1846 | if mana>=100 then | |
1847 | mana=100 | |
1848 | else | |
1849 | if mananum<=8 then | |
1850 | mananum=mananum+1 | |
1851 | else | |
1852 | mananum=0 | |
1853 | mana=mana+1 | |
1854 | end | |
1855 | end | |
1856 | end | |
1857 | ||
1858 | ||
1859 | --[[ | |
1860 | Copyrighted (C) Fenrier 2014 | |
1861 | ]] |