SHOW:
|
|
- or go back to the newest paste.
1 | - | |
1 | + | local p = game.Players.LocalPlayer |
2 | local char = p.Character | |
3 | local hed = char.Head | |
4 | local LocalPlayer = p | |
5 | ||
6 | local naeeym = Instance.new("BillboardGui",char) | |
7 | naeeym.Size = UDim2.new(0,100,0,40) | |
8 | naeeym.StudsOffset = Vector3.new(0,5,0) | |
9 | naeeym.Adornee = char.Head | |
10 | local tecks = Instance.new("TextLabel",naeeym) | |
11 | tecks.BackgroundTransparency = 1 | |
12 | tecks.BorderSizePixel = 0 | |
13 | tecks.Text = "Engineer" | |
14 | tecks.Font = "ArialBold" | |
15 | tecks.FontSize = "Size36" | |
16 | tecks.TextStrokeTransparency = 0 | |
17 | tecks.TextStrokeColor3 = Color3.new(0,0,0) | |
18 | tecks.TextColor3 = Color3.new(0,191,255) | |
19 | tecks.Size = UDim2.new(1,0,0.5,0) | |
20 | ||
21 | p = game.Players.LocalPlayer | |
22 | char = p.Character | |
23 | torso = char.Torso | |
24 | hed = char.Head | |
25 | neck = char.Torso.Neck | |
26 | hum = char.Humanoid | |
27 | hum.MaxHealth = math.huge | |
28 | local msg = game:GetService("Chat") | |
29 | torso.BrickColor = BrickColor.new("Pastel brown") | |
30 | hed.BrickColor = BrickColor.new("Pastel brown") | |
31 | char["Right Arm"].BrickColor = BrickColor.new("Pastel brown") | |
32 | char["Left Arm"].BrickColor = BrickColor.new("Pastel brown") | |
33 | char["Left Leg"].BrickColor = BrickColor.new("Pastel brown") | |
34 | char["Right Leg"].BrickColor = BrickColor.new("Pastel brown") | |
35 | ypcall(function() | |
36 | shirt = Instance.new("Shirt", char) | |
37 | shirt.Name = "Shirt" | |
38 | pants = Instance.new("Pants", char) | |
39 | pants.Name = "Pants" | |
40 | char.Shirt.ShirtTemplate = "rbxassetid://714339723" | |
41 | char.Pants.PantsTemplate = "rbxassetid://768354873" | |
42 | end) | |
43 | --[[ | |
44 | Made by Fenrier. | |
45 | ]] | |
46 | Player=game:GetService("Players").LocalPlayer | |
47 | Character=Player.Character | |
48 | PlayerGui=Player.PlayerGui | |
49 | Backpack=Player.Backpack | |
50 | Torso=Character.Torso | |
51 | Head=Character.Head | |
52 | Humanoid=Character.Humanoid | |
53 | LeftArm=Character["Left Arm"] | |
54 | LeftLeg=Character["Left Leg"] | |
55 | RightArm=Character["Right Arm"] | |
56 | RightLeg=Character["Right Leg"] | |
57 | LS=Torso["Left Shoulder"] | |
58 | LH=Torso["Left Hip"] | |
59 | RS=Torso["Right Shoulder"] | |
60 | RH=Torso["Right Hip"] | |
61 | Neck=Torso.Neck | |
62 | it=Instance.new | |
63 | vt=Vector3.new | |
64 | cf=CFrame.new | |
65 | euler=CFrame.fromEulerAnglesXYZ | |
66 | angles=CFrame.Angles | |
67 | necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
68 | necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
69 | LHC0=cf(-1,-1,0,-0,-0,-1,0,1,0,1,0,0) | |
70 | LHC1=cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0) | |
71 | RHC0=cf(1,-1,0,0,0,1,0,1,0,-1,-0,-0) | |
72 | RHC1=cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0) | |
73 | RootPart=Character.HumanoidRootPart | |
74 | RootJoint=RootPart.RootJoint | |
75 | RootCF=euler(-1.57,0,3.14) | |
76 | attack=false | |
77 | attackdebounce=false | |
78 | MMouse=nil | |
79 | combo=0 | |
80 | mana=0 | |
81 | heatcooldown=false | |
82 | aimrailgun=false | |
83 | aimcannon=false | |
84 | RailgunTarget=RootPart | |
85 | CannonTarget=RootPart | |
86 | changetarget=false | |
87 | local circle=0 | |
88 | bladeattack=false | |
89 | local con1=nil | |
90 | local con2=nil | |
91 | local con3=nil | |
92 | --player | |
93 | player=nil | |
94 | --save shoulders | |
95 | RSH, LSH=nil, nil | |
96 | --welds | |
97 | RW, LW=Instance.new("Weld"), Instance.new("Weld") | |
98 | RW.Name="Right Shoulder" LW.Name="Left Shoulder" | |
99 | LH=Torso["Left Hip"] | |
100 | RH=Torso["Right Hip"] | |
101 | Asset="http://www.roblox.com/asset/?id=" | |
102 | ||
103 | function swait(num) | |
104 | if num==0 or num==nil then | |
105 | game:service'RunService'.RenderStepped:wait() | |
106 | else | |
107 | for i=0,num do | |
108 | game:service'RunService'.RenderStepped:wait() | |
109 | end | |
110 | end | |
111 | end | |
112 | ||
113 | if Character:findFirstChild("Railgun",true) ~= nil then | |
114 | Character:findFirstChild("Railgun",true).Parent = nil | |
115 | end | |
116 | if Character:findFirstChild("Plasma Cannon",true) ~= nil then | |
117 | Character:findFirstChild("Plasma Cannon",true).Parent = nil | |
118 | end | |
119 | if Character:findFirstChild("Vanguard Blades",true) ~= nil then | |
120 | Character:findFirstChild("Vanguard Blades",true).Parent = nil | |
121 | end | |
122 | if Player.PlayerGui:findFirstChild("WeaponGUI",true) ~= nil then | |
123 | Player.PlayerGui:findFirstChild("WeaponGUI",true).Parent = nil | |
124 | end | |
125 | ||
126 | ||
127 | function NoOutline(Part) | |
128 | Part.TopSurface,Part.BottomSurface,Part.LeftSurface,Part.RightSurface,Part.FrontSurface,Part.BackSurface = 10,10,10,10,10,10 | |
129 | end | |
130 | ||
131 | function part(formfactor,parent,reflectance,transparency,brickcolor,name,size) | |
132 | local fp=it("Part") | |
133 | fp.formFactor=formfactor | |
134 | fp.Parent=parent | |
135 | fp.Reflectance=reflectance | |
136 | fp.Transparency=transparency | |
137 | fp.CanCollide=false | |
138 | fp.Locked=true | |
139 | fp.BrickColor=brickcolor | |
140 | fp.Name=name | |
141 | fp.Size=size | |
142 | fp.Position=Torso.Position | |
143 | NoOutline(fp) | |
144 | fp.Material="SmoothPlastic" | |
145 | fp:BreakJoints() | |
146 | return fp | |
147 | end | |
148 | ||
149 | function mesh(Mesh,part,meshtype,meshid,offset,scale) | |
150 | local mesh=it(Mesh) | |
151 | mesh.Parent=part | |
152 | if Mesh=="SpecialMesh" then | |
153 | mesh.MeshType=meshtype | |
154 | mesh.MeshId=meshid | |
155 | end | |
156 | mesh.Offset=offset | |
157 | mesh.Scale=scale | |
158 | return mesh | |
159 | end | |
160 | ||
161 | function weld(parent,part0,part1,c0) | |
162 | local weld=it("Weld") | |
163 | weld.Parent=parent | |
164 | weld.Part0=part0 | |
165 | weld.Part1=part1 | |
166 | weld.C0=c0 | |
167 | return weld | |
168 | end | |
169 | ||
170 | local fengui=it("GuiMain") | |
171 | fengui.Parent=Player.PlayerGui | |
172 | fengui.Name="WeaponGUI" | |
173 | ||
174 | local Color1=BrickColor.new("White") | |
175 | local Color2=BrickColor.new("Bright blue") | |
176 | local Color3=BrickColor.new("Really black") | |
177 | ||
178 | local model1=Instance.new("Model") | |
179 | model1.Parent=Character | |
180 | model1.Name="Railgun" | |
181 | Railgun={} | |
182 | RailgunWelds={} | |
183 | local model2=Instance.new("Model") | |
184 | model2.Parent=Character | |
185 | model2.Name="Plasma Cannon" | |
186 | Plasma={} | |
187 | PlasmaWelds={} | |
188 | local model3=Instance.new("Model") | |
189 | model3.Parent=Character | |
190 | model3.Name="Vanguard Blades" | |
191 | ||
192 | prt1=part(3,model1,0,0,Color1,"Part1",vt()) | |
193 | prt2=part(3,model1,0,0,Color2,"Part2",vt()) | |
194 | prt3=part(3,model1,0,0,Color2,"Part3",vt()) | |
195 | prt4=part(3,model1,0,0,Color2,"Part4",vt()) | |
196 | prt5=part(3,model1,0,0,Color2,"Part5",vt()) | |
197 | prt6=part(3,model1,0,0,Color2,"Part6",vt()) | |
198 | prt7=part(3,model1,0,0,Color1,"Part7",vt()) | |
199 | prt8=part(3,model1,0,0,Color3,"Part8",vt()) | |
200 | prt9=part(3,model1,0,0,Color1,"Part9",vt()) | |
201 | prt10=part(3,model1,0,0,Color1,"Part10",vt()) | |
202 | prt11=part(3,model1,0,0,Color1,"Part11",vt()) | |
203 | prt12=part(3,model1,0,0,Color1,"Part12",vt()) | |
204 | prt13=part(3,model1,0,0,Color1,"Part13",vt()) | |
205 | prt14=part(3,model1,0,0,Color1,"Part14",vt()) | |
206 | prt15=part(3,model1,0,0,Color1,"Part15",vt()) | |
207 | prt16=part(3,model1,0,0,Color1,"Part16",vt()) | |
208 | prt17=part(3,model1,0,0,Color1,"Part17",vt()) | |
209 | prt18=part(3,model1,0,0,Color2,"Part18",vt()) | |
210 | prt19=part(3,model1,0,0,Color2,"Part19",vt()) | |
211 | prt20=part(3,model1,0.2,0,Color1,"Part20",vt()) | |
212 | prt21=part(3,model1,0.2,0,Color1,"Part21",vt()) | |
213 | prt22=part(3,model1,0.5,0,Color1,"Part22",vt()) | |
214 | prt23=part(3,model1,0.5,0,Color1,"Part23",vt()) | |
215 | prt24=part(3,model1,0,0,Color2,"Part24",vt()) | |
216 | prt25=part(3,model1,0,0,Color2,"Part25",vt()) | |
217 | prt26=part(3,model1,0.2,0,Color1,"Part26",vt()) | |
218 | prt27=part(3,model1,0.2,0,Color1,"Part27",vt()) | |
219 | prt28=part(3,model1,0.5,0,Color1,"Part28",vt()) | |
220 | prt29=part(3,model1,0.5,0,Color1,"Part29",vt()) | |
221 | prt30=part(3,model1,0,0,Color2,"Part30",vt()) | |
222 | prt31=part(3,model1,0,0,Color2,"Part31",vt()) | |
223 | prt32=part(3,model1,0.2,0,Color1,"Part32",vt()) | |
224 | prt33=part(3,model1,0.2,0,Color1,"Part33",vt()) | |
225 | prt34=part(3,model1,0.5,0,Color1,"Part34",vt()) | |
226 | prt35=part(3,model1,0.5,0,Color1,"Part35",vt()) | |
227 | for _,c in pairs(model1:children()) do | |
228 | table.insert(Railgun,c) | |
229 | end | |
230 | -- | |
231 | aprt1=part(3,model2,0,0,Color1,"aPart1",vt()) | |
232 | aprt2=part(3,model2,0,0,Color2,"aPart2",vt()) | |
233 | aprt3=part(3,model2,0,0,Color2,"aPart3",vt()) | |
234 | aprt4=part(3,model2,0,0,Color2,"aPart4",vt()) | |
235 | aprt5=part(3,model2,0,0,Color2,"aPart5",vt()) | |
236 | aprt6=part(3,model2,0,0,Color2,"aPart6",vt()) | |
237 | aprt7=part(3,model2,0,0,Color2,"aPart7",vt()) | |
238 | aprt8=part(3,model2,0,0,Color1,"aPart8",vt()) | |
239 | aprt9=part(3,model2,0,0,Color1,"aPart9",vt()) | |
240 | aprt10=part(3,model2,0,0,Color3,"aPart10",vt()) | |
241 | aprt11=part(3,model2,0,0,Color3,"aPart11",vt()) | |
242 | aprt12=part(3,model2,0,0,Color1,"aPart12",vt()) | |
243 | aprt13=part(3,model2,0,0,Color1,"aPart13",vt()) | |
244 | aprt14=part(3,model2,0,0,Color1,"aPart14",vt()) | |
245 | aprt15=part(3,model2,0,0,Color1,"aPart15",vt()) | |
246 | aprt16=part(3,model2,0,0,Color1,"aPart16",vt()) | |
247 | aprt17=part(3,model2,0,0,Color1,"aPart17",vt()) | |
248 | aprt18=part(3,model2,0,0,Color1,"aPart18",vt()) | |
249 | aprt19=part(3,model2,0,0,Color2,"aPart19",vt()) | |
250 | aprt20=part(3,model2,0,0,Color2,"aPart20",vt()) | |
251 | aprt21=part(3,model2,0.2,0,Color1,"aPart21",vt()) | |
252 | aprt22=part(3,model2,0.2,0,Color1,"aPart22",vt()) | |
253 | aprt23=part(3,model2,0.5,0,Color1,"aPart23",vt()) | |
254 | aprt24=part(3,model2,0.5,0,Color1,"aPart24",vt()) | |
255 | aprt25=part(3,model2,0,0,Color2,"aPart25",vt()) | |
256 | aprt26=part(3,model2,0,0,Color2,"aPart26",vt()) | |
257 | aprt27=part(3,model2,0.2,0,Color1,"aPart27",vt()) | |
258 | aprt28=part(3,model2,0.2,0,Color1,"aPart28",vt()) | |
259 | aprt29=part(3,model2,0.5,0,Color1,"aPart29",vt()) | |
260 | aprt30=part(3,model2,0.5,0,Color1,"aPart30",vt()) | |
261 | aprt31=part(3,model2,0,0,Color2,"aPart31",vt()) | |
262 | aprt32=part(3,model2,0,0,Color2,"aPart32",vt()) | |
263 | aprt33=part(3,model2,0.2,0,Color1,"aPart33",vt()) | |
264 | aprt34=part(3,model2,0.2,0,Color1,"aPart34",vt()) | |
265 | aprt35=part(3,model2,0.5,0,Color1,"aPart35",vt()) | |
266 | aprt36=part(3,model2,0.5,0,Color1,"aPart36",vt()) | |
267 | aprt37=part(3,model2,0,0,Color2,"aPart37",vt()) | |
268 | aprt38=part(3,model1,0,0,Color1,"aPart38",vt()) | |
269 | aprt39=part(3,model1,0,0,Color1,"aPart39",vt()) | |
270 | for _,c in pairs(model2:children()) do | |
271 | table.insert(Plasma,c) | |
272 | end | |
273 | -- | |
274 | bref=part(3,model3,0,1,Color3,"bRef",vt()) | |
275 | bprt1=part(3,model3,0,1,Color1,"bPart1",vt()) | |
276 | bprt2=part(3,model3,0,0,Color1,"bPart2",vt()) | |
277 | bprt3=part(3,model3,0,0,Color2,"bPart3",vt()) | |
278 | bprt4=part(3,model3,0.8,0,Color1,"bPart4",vt()) | |
279 | bprt5=part(3,model3,0.8,0,Color1,"bPart5",vt()) | |
280 | bprt6=part(3,model3,0.8,0,Color1,"bPart6",vt()) | |
281 | bprt7=part(3,model3,0,1,Color1,"bPart7",vt()) | |
282 | bprt8=part(3,model3,0,0,Color1,"bPart8",vt()) | |
283 | bprt9=part(3,model3,0,0,Color2,"bPart9",vt()) | |
284 | bprt10=part(3,model3,0.8,0,Color1,"bPart10",vt()) | |
285 | bprt11=part(3,model3,0.8,0,Color1,"bPart11",vt()) | |
286 | bprt12=part(3,model3,0.8,0,Color1,"bPart12",vt()) | |
287 | bprt13=part(3,model3,0,1,Color1,"bPart13",vt()) | |
288 | bprt14=part(3,model3,0,0,Color1,"bPart14",vt()) | |
289 | bprt15=part(3,model3,0,0,Color2,"bPart15",vt()) | |
290 | bprt16=part(3,model3,0.8,0,Color1,"bPart16",vt()) | |
291 | bprt17=part(3,model3,0.8,0,Color1,"bPart17",vt()) | |
292 | bprt18=part(3,model3,0.8,0,Color1,"bPart18",vt()) | |
293 | ||
294 | msh1=mesh("BlockMesh",prt1,"","",vt(0,0,0),vt(1,1,1)) | |
295 | msh2=mesh("BlockMesh",prt2,"","",vt(0,0,0),vt(1.3,2.5,10)) | |
296 | msh3=mesh("BlockMesh",prt3,"","",vt(0,0,0),vt(1.49,2.5,5)) | |
297 | msh4=mesh("BlockMesh",prt4,"","",vt(0,0,0),vt(1.51,2.5,3)) | |
298 | msh5=mesh("CylinderMesh",prt5,"","",vt(0,0,0),vt(2.5,1,2.5)) | |
299 | msh6=mesh("CylinderMesh",prt6,"","",vt(0,0,0),vt(1.5,16,1.5)) | |
300 | msh7=mesh("CylinderMesh",prt7,"","",vt(0,0,0),vt(1.6,1,1.6)) | |
301 | msh8=mesh("CylinderMesh",prt8,"","",vt(0,0,0),vt(1.4,1.01,1.4)) | |
302 | msh9=mesh("BlockMesh",prt9,"","",vt(0,0,0),vt(1.4,14,2)) | |
303 | msh10=mesh("SpecialMesh",prt10,"Wedge","",vt(0,0,0),vt(1.3,4,3)) | |
304 | msh11=mesh("SpecialMesh",prt11,"Wedge","",vt(0,0,0),vt(1.3,2,3)) | |
305 | msh12=mesh("SpecialMesh",prt12,"Wedge","",vt(0,0,0),vt(1.7,3,3.5)) | |
306 | msh13=mesh("BlockMesh",prt13,"","",vt(0,0,0),vt(1.5,1.5,1.5)) | |
307 | msh14=mesh("BlockMesh",prt14,"","",vt(0,0,0),vt(1.6,4.5,2)) | |
308 | msh15=mesh("BlockMesh",prt15,"","",vt(0,0,0),vt(1.6,3.6,2)) | |
309 | msh16=mesh("SpecialMesh",prt16,"Wedge","",vt(0,0,0),vt(0.5,3,3.5)) | |
310 | msh17=mesh("SpecialMesh",prt17,"Wedge","",vt(0,0,0),vt(0.5,2,4)) | |
311 | msh19=mesh("SpecialMesh",prt19,"Sphere","",vt(0,0,0),vt(1.5,1.5,1.5)) | |
312 | msh20=mesh("SpecialMesh",prt20,"Wedge","",vt(0,0,0),vt(0.2,8,0.5)) | |
313 | msh21=mesh("SpecialMesh",prt21,"Wedge","",vt(0,0,0),vt(0.2,8,0.5)) | |
314 | msh22=mesh("SpecialMesh",prt22,"Wedge","",vt(0,0,0),vt(0.3,7,0.7)) | |
315 | msh23=mesh("SpecialMesh",prt23,"Wedge","",vt(0,0,0),vt(0.3,7,0.7)) | |
316 | msh25=mesh("SpecialMesh",prt25,"Sphere","",vt(0,0,0),vt(1.5,1.5,1.5)) | |
317 | msh26=mesh("SpecialMesh",prt26,"Wedge","",vt(0,0,0),vt(0.2,8,0.5)) | |
318 | msh27=mesh("SpecialMesh",prt27,"Wedge","",vt(0,0,0),vt(0.2,8,0.5)) | |
319 | msh28=mesh("SpecialMesh",prt28,"Wedge","",vt(0,0,0),vt(0.3,7,0.7)) | |
320 | msh29=mesh("SpecialMesh",prt29,"Wedge","",vt(0,0,0),vt(0.3,7,0.7)) | |
321 | msh31=mesh("SpecialMesh",prt31,"Sphere","",vt(0,0,0),vt(1.5,1.5,1.5)) | |
322 | msh32=mesh("SpecialMesh",prt32,"Wedge","",vt(0,0,0),vt(0.2,8,0.5)) | |
323 | msh33=mesh("SpecialMesh",prt33,"Wedge","",vt(0,0,0),vt(0.2,8,0.5)) | |
324 | msh34=mesh("SpecialMesh",prt34,"Wedge","",vt(0,0,0),vt(0.3,7,0.7)) | |
325 | msh35=mesh("SpecialMesh",prt35,"Wedge","",vt(0,0,0),vt(0.3,7,0.7)) | |
326 | -- | |
327 | msh1=mesh("BlockMesh",aprt1,"","",vt(0,0,0),vt(1,1,1)) | |
328 | msh2=mesh("BlockMesh",aprt2,"","",vt(0,0,0),vt(2,1.3,5)) | |
329 | msh3=mesh("SpecialMesh",aprt3,"Wedge","",vt(0,0,0),vt(2,2,1)) | |
330 | msh4=mesh("BlockMesh",aprt4,"","",vt(0,0,0),vt(2,2,6)) | |
331 | msh5=mesh("BlockMesh",aprt5,"","",vt(0,0,0),vt(2,2,2)) | |
332 | msh6=mesh("CylinderMesh",aprt6,"","",vt(0,0,0),vt(2,5,2)) | |
333 | msh7=mesh("CylinderMesh",aprt7,"","",vt(0,0,0),vt(2,5,2)) | |
334 | msh8=mesh("CylinderMesh",aprt8,"","",vt(0,0,0),vt(2.1,1,2.1)) | |
335 | msh9=mesh("CylinderMesh",aprt9,"","",vt(0,0,0),vt(2.1,1,2.1)) | |
336 | msh10=mesh("CylinderMesh",aprt10,"","",vt(0,0,0),vt(1.9,1.01,1.9)) | |
337 | msh11=mesh("CylinderMesh",aprt11,"","",vt(0,0,0),vt(1.9,1.01,1.9)) | |
338 | msh12=mesh("CylinderMesh",aprt12,"","",vt(0,0,0),vt(2.2,5.5,2.2)) | |
339 | msh13=mesh("SpecialMesh",aprt13,"Wedge","",vt(0,0,0),vt(1.7,3,3.5)) | |
340 | msh14=mesh("BlockMesh",aprt14,"","",vt(0,0,0),vt(1.5,1.5,1.5)) | |
341 | msh15=mesh("BlockMesh",aprt15,"","",vt(0,0,0),vt(1.6,4.5,2)) | |
342 | msh16=mesh("BlockMesh",aprt16,"","",vt(0,0,0),vt(1.6,3.6,2)) | |
343 | msh17=mesh("SpecialMesh",aprt17,"Wedge","",vt(0,0,0),vt(0.5,3,3.5)) | |
344 | msh18=mesh("SpecialMesh",aprt18,"Wedge","",vt(0,0,0),vt(0.5,2,4)) | |
345 | msh20=mesh("SpecialMesh",aprt20,"Sphere","",vt(0,0,0),vt(1.5,1.5,1.5)) | |
346 | msh21=mesh("SpecialMesh",aprt21,"Wedge","",vt(0,0,0),vt(0.2,8,0.5)) | |
347 | msh22=mesh("SpecialMesh",aprt22,"Wedge","",vt(0,0,0),vt(0.2,8,0.5)) | |
348 | msh23=mesh("SpecialMesh",aprt23,"Wedge","",vt(0,0,0),vt(0.3,7,0.7)) | |
349 | msh24=mesh("SpecialMesh",aprt24,"Wedge","",vt(0,0,0),vt(0.3,7,0.7)) | |
350 | msh26=mesh("SpecialMesh",aprt26,"Sphere","",vt(0,0,0),vt(1.5,1.5,1.5)) | |
351 | msh27=mesh("SpecialMesh",aprt27,"Wedge","",vt(0,0,0),vt(0.2,8,0.5)) | |
352 | msh28=mesh("SpecialMesh",aprt28,"Wedge","",vt(0,0,0),vt(0.2,8,0.5)) | |
353 | msh29=mesh("SpecialMesh",aprt29,"Wedge","",vt(0,0,0),vt(0.3,7,0.7)) | |
354 | msh30=mesh("SpecialMesh",aprt30,"Wedge","",vt(0,0,0),vt(0.3,7,0.7)) | |
355 | msh32=mesh("SpecialMesh",aprt32,"Sphere","",vt(0,0,0),vt(1.5,1.5,1.5)) | |
356 | msh33=mesh("SpecialMesh",aprt33,"Wedge","",vt(0,0,0),vt(0.2,8,0.5)) | |
357 | msh34=mesh("SpecialMesh",aprt34,"Wedge","",vt(0,0,0),vt(0.2,8,0.5)) | |
358 | msh35=mesh("SpecialMesh",aprt35,"Wedge","",vt(0,0,0),vt(0.3,7,0.7)) | |
359 | msh36=mesh("SpecialMesh",aprt36,"Wedge","",vt(0,0,0),vt(0.3,7,0.7)) | |
360 | msh37=mesh("BlockMesh",aprt37,"","",vt(0,0,0),vt(1.51,2.5,3)) | |
361 | msh38=mesh("SpecialMesh",aprt38,"Wedge","",vt(0,0,0),vt(1.3,4,3)) | |
362 | msh39=mesh("SpecialMesh",aprt39,"Wedge","",vt(0,0,0),vt(1.3,2,3)) | |
363 | -- | |
364 | msh2=mesh("CylinderMesh",bprt2,"","",vt(0,0,0),vt(3,1,3)) | |
365 | msh3=mesh("CylinderMesh",bprt3,"","",vt(0,0,0),vt(2.5,1.01,2.5)) | |
366 | msh4=mesh("BlockMesh",bprt4,"","",vt(0,0,0),vt(7,0.5,1.5)) | |
367 | msh5=mesh("SpecialMesh",bprt5,"Wedge","",vt(0,0,0),vt(0.5,1.5,10)) | |
368 | msh6=mesh("SpecialMesh",bprt6,"Wedge","",vt(0,0,0),vt(0.3,3,4)) | |
369 | msh8=mesh("CylinderMesh",bprt8,"","",vt(0,0,0),vt(3,1,3)) | |
370 | msh9=mesh("CylinderMesh",bprt9,"","",vt(0,0,0),vt(2.5,1.01,2.5)) | |
371 | msh10=mesh("BlockMesh",bprt10,"","",vt(0,0,0),vt(7,0.5,1.5)) | |
372 | msh11=mesh("SpecialMesh",bprt11,"Wedge","",vt(0,0,0),vt(0.5,1.5,10)) | |
373 | msh12=mesh("SpecialMesh",bprt12,"Wedge","",vt(0,0,0),vt(0.3,3,4)) | |
374 | msh14=mesh("CylinderMesh",bprt14,"","",vt(0,0,0),vt(3,1,3)) | |
375 | msh15=mesh("CylinderMesh",bprt15,"","",vt(0,0,0),vt(2.5,1.01,2.5)) | |
376 | msh16=mesh("BlockMesh",bprt16,"","",vt(0,0,0),vt(7,0.5,1.5)) | |
377 | msh17=mesh("SpecialMesh",bprt17,"Wedge","",vt(0,0,0),vt(0.5,1.5,10)) | |
378 | msh18=mesh("SpecialMesh",bprt18,"Wedge","",vt(0,0,0),vt(0.3,3,4)) | |
379 | ||
380 | --wld1=weld(prt1,prt1,Torso,euler(0.5,-3.14,0)*cf(2,-2,-2)) | |
381 | wld1=weld(prt1,prt1,Torso,euler(2.4,0,0)*cf(2,-2,-2)) | |
382 | wld2=weld(prt1,prt2,prt1,euler(0,0,0)*cf(0,0,0)) | |
383 | wld3=weld(prt1,prt3,prt2,euler(-0.3,0,0)*cf(0,0.05,-1)) | |
384 | wld4=weld(prt1,prt4,prt2,euler(-0.5,0,0)*cf(0,0.1,-0.3)) | |
385 | wld5=weld(prt1,prt5,prt4,euler(1.57+0.5,0,0)*cf(0,-0.2,0)) | |
386 | wld6=weld(prt1,prt6,prt2,euler(1.57,0,0)*cf(0,-0.11,1.1)) | |
387 | wld7=weld(prt1,prt7,prt6,euler(0,0,0)*cf(0,-1.6,0)) | |
388 | wld8=weld(prt1,prt8,prt7,euler(0,0,0)*cf(0,0,0)) | |
389 | wld9=weld(prt1,prt9,prt6,euler(0,0,0)*cf(0,-0.3,0.2)) | |
390 | wld10=weld(prt1,prt10,prt9,euler(0,0,0)*cf(0,1.2,0.4)) | |
391 | wld11=weld(prt1,prt11,prt10,euler(0,0,3.14)*cf(0,0.6,0)) | |
392 | wld12=weld(prt1,prt12,prt5,euler(3.14,0,0)*cf(0,-0.2,-0.55)) | |
393 | wld13=weld(prt1,prt13,prt12,euler(0.785,0,0)*cf(0,0.2,-0.4)) | |
394 | wld14=weld(prt1,prt14,prt12,euler(0,0,0)*cf(0,-0.4,-0.2)) | |
395 | wld15=weld(prt1,prt15,prt14,euler(-0.8,0,0)*cf(0,-0.55,-0.2)) | |
396 | wld16=weld(prt1,prt16,prt14,euler(0,0,3.14)*cf(0,-0.15,0.5)) | |
397 | wld17=weld(prt1,prt17,prt16,euler(0,0,3.14)*cf(0,0.5,-0.3)) | |
398 | wld18=weld(prt1,prt18,prt2,euler(0,0,0)*cf(0.2,0,0)) --1 | |
399 | wld19=weld(prt1,prt19,prt18,euler(0,0,0.5)*cf(0,0,0)) | |
400 | wld20=weld(prt1,prt20,prt19,euler(3.14,3.14,0)*cf(0,0.8,0.05)) | |
401 | wld21=weld(prt1,prt21,prt19,euler(3.14,0,0)*cf(0,0.8,-0.05)) | |
402 | wld22=weld(prt1,prt22,prt20,euler(0,0,0)*cf(0,-0.5,0.02)) | |
403 | wld23=weld(prt1,prt23,prt21,euler(0,0,0)*cf(0,-0.5,0.02)) | |
404 | wld24=weld(prt1,prt24,prt2,euler(0,0,0)*cf(0.2,-0.1,-0.3)) --2 | |
405 | wld25=weld(prt1,prt25,prt24,euler(0.3,0,0.6)*cf(0,0,0)) | |
406 | wld26=weld(prt1,prt26,prt25,euler(3.14,3.14,0)*cf(0,0.8,0.05)) | |
407 | wld27=weld(prt1,prt27,prt25,euler(3.14,0,0)*cf(0,0.8,-0.05)) | |
408 | wld28=weld(prt1,prt28,prt26,euler(0,0,0)*cf(0,-0.5,0.02)) | |
409 | wld29=weld(prt1,prt29,prt27,euler(0,0,0)*cf(0,-0.5,0.02)) | |
410 | wld30=weld(prt1,prt30,prt2,euler(0,0,0)*cf(0.2,-0.2,-0.6)) --3 | |
411 | wld31=weld(prt1,prt31,prt30,euler(0.6,0,0.7)*cf(0,0,0)) | |
412 | wld32=weld(prt1,prt32,prt31,euler(3.14,3.14,0)*cf(0,0.8,0.05)) | |
413 | wld33=weld(prt1,prt33,prt31,euler(3.14,0,0)*cf(0,0.8,-0.05)) | |
414 | wld34=weld(prt1,prt34,prt32,euler(0,0,0)*cf(0,-0.5,0.02)) | |
415 | wld35=weld(prt1,prt35,prt33,euler(0,0,0)*cf(0,-0.5,0.02)) | |
416 | for _,c in pairs(prt1:children()) do | |
417 | if c.className=="Weld" then | |
418 | table.insert(RailgunWelds,c) | |
419 | end | |
420 | end | |
421 | -- | |
422 | --awld1=weld(aprt1,aprt1,Torso,euler(0.5,3.14,0)*cf(-2,-2,-2)) | |
423 | awld1=weld(aprt1,aprt1,Torso,euler(2.4,0,0)*cf(-2,-2,-2)) | |
424 | awld2=weld(aprt1,aprt2,aprt1,euler(0,0,0)*cf(0,0,0)) | |
425 | awld3=weld(aprt1,aprt3,aprt2,euler(0,3.14,0)*cf(0,-0.3,-0.4)) | |
426 | awld4=weld(aprt1,aprt4,aprt2,euler(0,0,0)*cf(0,-0.3,0.3)) | |
427 | awld5=weld(aprt1,aprt5,aprt4,euler(0,0,0)*cf(0,-0.3,0.2)) | |
428 | awld6=weld(aprt1,aprt6,aprt4,euler(1.57,0,0)*cf(0,-0.02,0.7)) | |
429 | awld7=weld(aprt1,aprt7,aprt4,euler(1.57,0,0)*cf(0,0.02,0.7)) | |
430 | awld8=weld(aprt1,aprt8,aprt6,euler(0,0,0)*cf(0,-0.5,0)) | |
431 | awld9=weld(aprt1,aprt9,aprt7,euler(0,0,0)*cf(0,-0.5,0)) | |
432 | awld10=weld(aprt1,aprt10,aprt8,euler(0,0,0)*cf(0,0,0)) | |
433 | awld11=weld(aprt1,aprt11,aprt9,euler(0,0,0)*cf(0,0,0)) | |
434 | awld12=weld(aprt1,aprt12,aprt4,euler(1.57,0,0)*cf(0,0.2,0.75)) | |
435 | awld13=weld(aprt1,aprt13,aprt5,euler(-1.57,0,0)*cf(0,-0.3,0)) | |
436 | awld14=weld(aprt1,aprt14,aprt13,euler(0.785,0,0)*cf(0,0.2,-0.4)) | |
437 | awld15=weld(aprt1,aprt15,aprt13,euler(0,0,0)*cf(0,-0.4,-0.2)) | |
438 | awld16=weld(aprt1,aprt16,aprt15,euler(-0.8,0,0)*cf(0,-0.55,-0.2)) | |
439 | awld17=weld(aprt1,aprt17,aprt15,euler(0,0,3.14)*cf(0,-0.15,0.5)) | |
440 | awld18=weld(aprt1,aprt18,aprt17,euler(0,0,3.14)*cf(0,0.5,-0.3)) | |
441 | awld19=weld(aprt1,aprt19,aprt2,euler(0,0,0)*cf(-0.2,-0.2,0.7)) --1 | |
442 | awld20=weld(aprt1,aprt20,aprt19,euler(0,0,-0.5)*cf(0,0,0)) | |
443 | awld21=weld(aprt1,aprt21,aprt20,euler(3.14,3.14,0)*cf(0,0.8,0.05)) | |
444 | awld22=weld(aprt1,aprt22,aprt20,euler(3.14,0,0)*cf(0,0.8,-0.05)) | |
445 | awld23=weld(aprt1,aprt23,aprt21,euler(0,0,0)*cf(0,-0.5,0.02)) | |
446 | awld24=weld(aprt1,aprt24,aprt22,euler(0,0,0)*cf(0,-0.5,0.02)) | |
447 | awld25=weld(aprt1,aprt25,aprt2,euler(0,0,0)*cf(-0.2,-0.3,0.4)) --2 | |
448 | awld26=weld(aprt1,aprt26,aprt25,euler(0.3,0,-0.6)*cf(0,0,0)) | |
449 | awld27=weld(aprt1,aprt27,aprt26,euler(3.14,3.14,0)*cf(0,0.8,0.05)) | |
450 | awld28=weld(aprt1,aprt28,aprt26,euler(3.14,0,0)*cf(0,0.8,-0.05)) | |
451 | awld29=weld(aprt1,aprt29,aprt27,euler(0,0,0)*cf(0,-0.5,0.02)) | |
452 | awld30=weld(aprt1,aprt30,aprt28,euler(0,0,0)*cf(0,-0.5,0.02)) | |
453 | awld31=weld(aprt1,aprt31,aprt2,euler(0,0,0)*cf(-0.2,-0.4,0.1)) --3 | |
454 | awld32=weld(aprt1,aprt32,aprt31,euler(0.6,0,-0.7)*cf(0,0,0)) | |
455 | awld33=weld(aprt1,aprt33,aprt32,euler(3.14,3.14,0)*cf(0,0.8,0.05)) | |
456 | awld34=weld(aprt1,aprt34,aprt32,euler(3.14,0,0)*cf(0,0.8,-0.05)) | |
457 | awld35=weld(aprt1,aprt35,aprt33,euler(0,0,0)*cf(0,-0.5,0.02)) | |
458 | awld36=weld(aprt1,aprt36,aprt34,euler(0,0,0)*cf(0,-0.5,0.02)) | |
459 | awld37=weld(aprt1,aprt37,aprt2,euler(-0.5,0,0)*cf(0,-0.05,-0.1)) | |
460 | awld38=weld(aprt1,aprt38,aprt37,euler(-1.57,3.14,0)*cf(0,0.2,0.15)) | |
461 | awld39=weld(aprt1,aprt339,aprt39,euler(0,0,3.14)*cf(0,0.6,0)) | |
462 | for _,c in pairs(aprt1:children()) do | |
463 | if c.className=="Weld" then | |
464 | table.insert(PlasmaWelds,c) | |
465 | end | |
466 | end | |
467 | -- | |
468 | brefwld=weld(bref,bref,Torso,euler(0,0,0)*cf(0,0,0)) | |
469 | bwld1=weld(bprt1,bprt1,bref,euler(0,0,0)*cf(1,-0.6,-2)) --1 | |
470 | bwld2=weld(bprt1,bprt2,bprt1,euler(0,0.5,1.57+0.4)*cf(0,0,0)) | |
471 | bwld3=weld(bprt1,bprt3,bprt2,euler(0,0,0)*cf(0,0,0)) | |
472 | bwld4=weld(bprt1,bprt4,bprt2,euler(0,0,0)*cf(-0.8,0,0)) | |
473 | bwld5=weld(bprt1,bprt5,bprt2,euler(-1.57,0,1.57)*cf(-0.8,0,-0.35)) | |
474 | bwld6=weld(bprt1,bprt6,bprt4,euler(-1.57,0,1.57)*cf(-1.1,0,-0.15)) | |
475 | bwld7=weld(bprt1,bprt7,bref,euler(0,0,0)*cf(0,-0.6,-2)) --2 | |
476 | bwld8=weld(bprt1,bprt8,bprt7,euler(0,0.5,1.57)*cf(0,0,0)) | |
477 | bwld9=weld(bprt1,bprt9,bprt8,euler(0,0,0)*cf(0,0,0)) | |
478 | bwld10=weld(bprt1,bprt10,bprt8,euler(0,0,0)*cf(-0.8,0,0)) | |
479 | bwld11=weld(bprt1,bprt11,bprt8,euler(-1.57,0,1.57)*cf(-0.8,0,-0.35)) | |
480 | bwld12=weld(bprt1,bprt12,bprt10,euler(-1.57,0,1.57)*cf(-1.1,0,-0.15)) | |
481 | bwld13=weld(bprt1,bprt13,bref,euler(0,0,0)*cf(-1,-0.6,-2)) --3 | |
482 | bwld14=weld(bprt1,bprt14,bprt13,euler(0,0.5,1.57-0.4)*cf(0,0,0)) | |
483 | bwld15=weld(bprt1,bprt15,bprt14,euler(0,0,0)*cf(0,0,0)) | |
484 | bwld16=weld(bprt1,bprt16,bprt14,euler(0,0,0)*cf(-0.8,0,0)) | |
485 | bwld17=weld(bprt1,bprt17,bprt14,euler(-1.57,0,1.57)*cf(-0.8,0,-0.35)) | |
486 | bwld18=weld(bprt1,bprt18,bprt16,euler(-1.57,0,1.57)*cf(-1.1,0,-0.15)) | |
487 | ||
488 | local hitbox1=part(3,nil,0,1,BrickColor.new("Black"),"Hitbox",vt(1,1,1)) | |
489 | local hitbox2=part(3,nil,0,1,BrickColor.new("Black"),"Hitbox",vt(1,1,1)) | |
490 | local hitbox3=part(3,nil,0,1,BrickColor.new("Black"),"Hitbox",vt(1,1,1)) | |
491 | ||
492 | if (script.Parent.className~="HopperBin") then | |
493 | Tool=Instance.new("HopperBin") | |
494 | Tool.Parent=Backpack | |
495 | Tool.Name="Vanguard Gauntlets" | |
496 | script.Parent=Tool | |
497 | end | |
498 | Bin=script.Parent | |
499 | --Bin=Tool | |
500 | ||
501 | local bodvel=Instance.new("BodyVelocity") | |
502 | local bg=Instance.new("BodyGyro") | |
503 | ||
504 | so = function(id,par,vol,pit) | |
505 | coroutine.resume(coroutine.create(function() | |
506 | local sou = Instance.new("Sound",par or workspace) | |
507 | sou.Volume=vol | |
508 | sou.Pitch=pit or 1 | |
509 | sou.SoundId=id | |
510 | swait() | |
511 | sou:play() | |
512 | game:GetService("Debris"):AddItem(sou,6) | |
513 | end)) | |
514 | end | |
515 | ||
516 | function clerp(a,b,t) | |
517 | local qa = {QuaternionFromCFrame(a)} | |
518 | local qb = {QuaternionFromCFrame(b)} | |
519 | local ax, ay, az = a.x, a.y, a.z | |
520 | local bx, by, bz = b.x, b.y, b.z | |
521 | local _t = 1-t | |
522 | return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t)) | |
523 | end | |
524 | ||
525 | function QuaternionFromCFrame(cf) | |
526 | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() | |
527 | local trace = m00 + m11 + m22 | |
528 | if trace > 0 then | |
529 | local s = math.sqrt(1 + trace) | |
530 | local recip = 0.5/s | |
531 | return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5 | |
532 | else | |
533 | local i = 0 | |
534 | if m11 > m00 then | |
535 | i = 1 | |
536 | end | |
537 | if m22 > (i == 0 and m00 or m11) then | |
538 | i = 2 | |
539 | end | |
540 | if i == 0 then | |
541 | local s = math.sqrt(m00-m11-m22+1) | |
542 | local recip = 0.5/s | |
543 | return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip | |
544 | elseif i == 1 then | |
545 | local s = math.sqrt(m11-m22-m00+1) | |
546 | local recip = 0.5/s | |
547 | return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip | |
548 | elseif i == 2 then | |
549 | local s = math.sqrt(m22-m00-m11+1) | |
550 | local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip | |
551 | end | |
552 | end | |
553 | end | |
554 | ||
555 | function QuaternionToCFrame(px, py, pz, x, y, z, w) | |
556 | local xs, ys, zs = x + x, y + y, z + z | |
557 | local wx, wy, wz = w*xs, w*ys, w*zs | |
558 | local xx = x*xs | |
559 | local xy = x*ys | |
560 | local xz = x*zs | |
561 | local yy = y*ys | |
562 | local yz = y*zs | |
563 | local zz = z*zs | |
564 | 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)) | |
565 | end | |
566 | ||
567 | function QuaternionSlerp(a, b, t) | |
568 | local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4] | |
569 | local startInterp, finishInterp; | |
570 | if cosTheta >= 0.0001 then | |
571 | if (1 - cosTheta) > 0.0001 then | |
572 | local theta = math.acos(cosTheta) | |
573 | local invSinTheta = 1/math.sin(theta) | |
574 | startInterp = math.sin((1-t)*theta)*invSinTheta | |
575 | finishInterp = math.sin(t*theta)*invSinTheta | |
576 | else | |
577 | startInterp = 1-t | |
578 | finishInterp = t | |
579 | end | |
580 | else | |
581 | if (1+cosTheta) > 0.0001 then | |
582 | local theta = math.acos(-cosTheta) | |
583 | local invSinTheta = 1/math.sin(theta) | |
584 | startInterp = math.sin((t-1)*theta)*invSinTheta | |
585 | finishInterp = math.sin(t*theta)*invSinTheta | |
586 | else | |
587 | startInterp = t-1 | |
588 | finishInterp = t | |
589 | end | |
590 | end | |
591 | 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 | |
592 | end | |
593 | ||
594 | function hideanim() | |
595 | equipped=false | |
596 | n=2 | |
597 | for i=0,1,0.05 do | |
598 | swait() | |
599 | --[[Torso.Neck.C0=necko*euler(0,0,0) | |
600 | RootJoint.C0=RootCF*euler(0,0,0) | |
601 | RW.C0=cf(1.5,0.5,0)*euler(0,0,0.5-0.5*i*n) | |
602 | RW.C1=cf(0,0.5,0)*euler(0,0,0) | |
603 | LW.C0=cf(-1.5,0.5,0)*euler(0,0,-0.5+0.5*i*n) | |
604 | LW.C1=cf(0,0.5,0)*euler(0,0,0)]] | |
605 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.4) | |
606 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0,0,0),.4) | |
607 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,0),.4) | |
608 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,0),.4) | |
609 | wld1.C0=clerp(wld1.C0,euler(2.4,0,0)*cf(2,-2,-2),.4) | |
610 | awld1.C0=clerp(awld1.C0,euler(2.4,0,0)*cf(-2,-2,-2),.4) | |
611 | bwld1.C0=clerp(bwld1.C0,euler(0,0,0)*cf(1,-0.6,-2),.4) | |
612 | bwld7.C0=clerp(bwld7.C0,euler(0,0,0)*cf(0,-0.6,-2),.4) | |
613 | bwld13.C0=clerp(bwld13.C0,euler(0,0,0)*cf(-1,-0.6,-2),.4) | |
614 | bwld2.C0=clerp(bwld2.C0,euler(0,0.5,1.57+0.4)*cf(0,0,0),.4) | |
615 | bwld8.C0=clerp(bwld8.C0,euler(0,0.5,1.57)*cf(0,0,0),.4) | |
616 | bwld14.C0=clerp(bwld14.C0,euler(0,0.5,1.57-0.4)*cf(0,0,0),.4) | |
617 | brefwld.C0=clerp(brefwld.C0,euler(0,0,0)*cf(0,0,0),.4) | |
618 | n=n-0.1 | |
619 | end | |
620 | Torso.Neck.C0=necko | |
621 | Torso.Neck.C1=necko2 | |
622 | RootJoint.C0=RootCF | |
623 | RW.C0=cf(1.5,0.5,0)*euler(0,0,0) | |
624 | RW.C1=cf(0,0.5,0)*euler(0,0,0) | |
625 | LW.C0=cf(-1.5,0.5,0)*euler(0,0,0) | |
626 | LW.C1=cf(0,0.5,0)*euler(0,0,0) | |
627 | RH.C0=RHC0 | |
628 | RH.C1=RHC1 | |
629 | LH.C0=LHC0 | |
630 | LH.C1=LHC1 | |
631 | end | |
632 | ||
633 | function equipanim() | |
634 | equipped=true | |
635 | circle=0 | |
636 | n=2 | |
637 | for i=0,1,0.1 do | |
638 | swait() | |
639 | --[[Torso.Neck.C0=necko*euler(0,0,0) | |
640 | RootJoint.C0=RootCF*euler(0,0,0) | |
641 | RW.C0=cf(1.5,0.5,0)*euler(0,0,0.5*i*n) | |
642 | RW.C1=cf(0,0.5,0)*euler(0,0,0) | |
643 | LW.C0=cf(-1.5,0.5,0)*euler(0,0,-0.5*i*n) | |
644 | LW.C1=cf(0,0.5,0)*euler(0,0,0)]] | |
645 | ||
646 | wld1.C0=clerp(wld1.C0,euler(-0.2,0,0)*cf(3,-1,-0.2),.4) | |
647 | awld1.C0=clerp(awld1.C0,euler(-0.2,0,0)*cf(-3,-1,-0.2),.4) | |
648 | bwld1.C0=clerp(bwld1.C0,euler(0,0,0)*cf(2,-0.6,-2),.4) | |
649 | bwld7.C0=clerp(bwld7.C0,euler(0,0,0)*cf(0,-0.6,-2),.4) | |
650 | bwld13.C0=clerp(bwld13.C0,euler(0,0,0)*cf(-2,-0.6,-2),.4) | |
651 | bwld2.C0=clerp(bwld2.C0,euler(3.14,-2,1.57-0.4)*cf(0,0,0),.4) | |
652 | bwld8.C0=clerp(bwld8.C0,euler(3.14,-2,1.57)*cf(0,0,0),.4) | |
653 | bwld14.C0=clerp(bwld14.C0,euler(3.14,-2,1.57+0.4)*cf(0,0,0),.4) | |
654 | brefwld.C0=clerp(brefwld.C0,euler(0,0,0)*cf(0,-2,0),.4) | |
655 | n=n-0.1 | |
656 | end | |
657 | --[[Torso.Neck.C0=necko*euler(0,0,0) | |
658 | RootJoint.C0=RootCF*euler(0,0,0) | |
659 | RW.C0=cf(1.5,0.5,0)*euler(0,0,0.5) | |
660 | RW.C1=cf(0,0.5,0)*euler(0,0,0) | |
661 | LW.C0=cf(-1.5,0.5,0)*euler(0,0,-0.5) | |
662 | LW.C1=cf(0,0.5,0)*euler(0,0,0)]] | |
663 | end | |
664 | ||
665 | function AimRailGun() | |
666 | for i=0,1,0.1 do | |
667 | swait() | |
668 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1.57,0,0),.4) | |
669 | end | |
670 | coroutine.resume(coroutine.create(function(Weld) | |
671 | while aimrailgun==true do | |
672 | wait() | |
673 | --[[local pos=Vector3.new(MMouse.Hit.p.x,MMouse.Hit.p.y,MMouse.Hit.p.z) | |
674 | offset=(RootPart.Position.y-MMouse.Hit.p.y)/60 | |
675 | offset2=(RootPart.Position.x-MMouse.Hit.p.x)/60 | |
676 | mag=(RootPart.Position-MMouse.Hit.p).magnitude/80 | |
677 | offset=offset/mag | |
678 | offset2=offset2/mag ]] | |
679 | --[[cff=cf(prt2.CFrame.p,MMouse.Hit.p) | |
680 | local HitPos=cff.p | |
681 | local CJ=cf(HitPos) | |
682 | local C0=cff:inverse() *CJ | |
683 | local C1=prt2.CFrame:inverse() * CJ | |
684 | wld1.Part1=RootPart]] | |
685 | --[[Weld.C0=euler(0,0,0)*cf(3,-1,-0.2) | |
686 | wld2.C0=CFrame.Angles(math.asin(MMouse.Hit.p.x),math.rad(0),math.atan2(MMouse.Hit.p.z,MMouse.Hit.p.x))]] | |
687 | local mpos = prt1.CFrame*euler(0,0,0)--*CFrame.new(3,-1,-0.2) -- thx doogle <3 | |
688 | local cff = CFrame.new(mpos.p,MMouse.Hit.p) * CFrame.Angles(math.pi/2,0,0) | |
689 | local x,y,z = prt1.CFrame:toObjectSpace(cff):toEulerAnglesXYZ() | |
690 | wld1.Part1=RailgunTarget | |
691 | wld1.C0=euler(0,0,0)*cf(3,-1,-0.2) | |
692 | wld2.Part0=prt1 | |
693 | wld2.Part1=prt2 | |
694 | wld2.C0=clerp(wld2.C0,CFrame.Angles(x,y,z)*euler(-1.57,0,0),.3) | |
695 | end | |
696 | end),wld1) | |
697 | end | |
698 | ||
699 | function UnAimRailGun() | |
700 | for i=0,1,0.1 do | |
701 | swait() | |
702 | --LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,-0.5),.4) | |
703 | --[[wld2.Part0=prt2 | |
704 | wld2.Part1=prt1]] | |
705 | wld1.Part1=RailgunTarget.Parent.Torso | |
706 | wld1.C0=clerp(wld1.C0,euler(-0.2,0,0)*cf(3,-1,-0.2),.5) | |
707 | wld2.C0=clerp(wld2.C0,euler(0,0,0)*cf(0,0,0),.5) | |
708 | --wld1.C0=euler(-0.2,-0.3,0)*cf(3,-1,-0.2) | |
709 | end | |
710 | attack=false | |
711 | end | |
712 | ||
713 | function AimCannon() | |
714 | for i=0,1,0.1 do | |
715 | swait() | |
716 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1.57,0,0),.4) | |
717 | end | |
718 | coroutine.resume(coroutine.create(function(Weld) | |
719 | while aimcannon==true do | |
720 | wait() | |
721 | --[[local pos=Vector3.new(MMouse.Hit.p.x,MMouse.Hit.p.y,MMouse.Hit.p.z) | |
722 | offset=(RootPart.Position.y-MMouse.Hit.p.y)/60 | |
723 | offset2=(RootPart.Position.x-MMouse.Hit.p.x)/60 | |
724 | mag=(RootPart.Position-MMouse.Hit.p).magnitude/80 | |
725 | offset=offset/mag | |
726 | offset2=offset2/mag ]] | |
727 | --[[cff=cf(prt2.CFrame.p,MMouse.Hit.p) | |
728 | local HitPos=cff.p | |
729 | local CJ=cf(HitPos) | |
730 | local C0=cff:inverse() *CJ | |
731 | local C1=prt2.CFrame:inverse() * CJ | |
732 | wld1.Part1=RootPart]] | |
733 | --[[Weld.C0=euler(0,0,0)*cf(3,-1,-0.2) | |
734 | wld2.C0=CFrame.Angles(math.asin(MMouse.Hit.p.x),math.rad(0),math.atan2(MMouse.Hit.p.z,MMouse.Hit.p.x))]] | |
735 | local mpos = aprt1.CFrame*euler(0,0,0)--*CFrame.new(3,-1,-0.2) -- thx doogle <3 | |
736 | local cff = CFrame.new(mpos.p,MMouse.Hit.p) * CFrame.Angles(math.pi/2,0,0) | |
737 | local x,y,z = aprt1.CFrame:toObjectSpace(cff):toEulerAnglesXYZ() | |
738 | awld1.Part1=CannonTarget | |
739 | awld1.C0=euler(0,0,0)*cf(-3,-1,-0.2) | |
740 | awld2.Part0=aprt1 | |
741 | awld2.Part1=aprt2 | |
742 | awld2.C0=clerp(awld2.C0,CFrame.Angles(x,y,z)*euler(-1.57,0,0),.3) | |
743 | end | |
744 | end),wld1) | |
745 | end | |
746 | ||
747 | function UnAimCannon() | |
748 | for i=0,1,0.1 do | |
749 | swait() | |
750 | --RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,0.5),.4) | |
751 | --[[awld2.Part0=aprt2 | |
752 | awld2.Part1=aprt1]] | |
753 | awld1.Part1=CannonTarget.Parent.Torso | |
754 | awld1.C0=clerp(awld1.C0,euler(-0.2,0,0)*cf(-3,-1,-0.2),.5) | |
755 | awld2.C0=clerp(awld2.C0,euler(0,0,0)*cf(0,0,0),.5) | |
756 | --awld1.C0=euler(-0.2,0.3,0)*cf(-3,-1,-0.2) | |
757 | end | |
758 | end | |
759 | ||
760 | function ShootRailGun() | |
761 | so(Asset.."169380505",prt8,.5,1) | |
762 | local MouseLook=cf((prt8.Position+MMouse.Hit.p)/2,MMouse.Hit.p) | |
763 | local hit,pos = rayCast(prt8.Position,MouseLook.lookVector,999,RailgunTarget.Parent) | |
764 | local mag=(prt8.Position-pos).magnitude | |
765 | MagicCylinder(BrickColor.new("Cyan"),CFrame.new((prt8.Position+pos)/2,pos)*angles(1.57,0,0),1,mag*5,1,1.2,0,1.2,0.1) | |
766 | if hit~=nil then | |
767 | ref=part(3,workspace,0,1,Color3,"Reference",vt()) | |
768 | ref.Anchored=true | |
769 | ref.CFrame=cf(pos) | |
770 | game:GetService("Debris"):AddItem(ref,1) | |
771 | so(Asset.."153092334",ref,.5,1.5) | |
772 | so(Asset.."169380505",ref,.5,1.5) | |
773 | MagicCircle(BrickColor.new("Cyan"),cf(pos),10,10,10,1,1,1,0.07) | |
774 | Damagefunc(hit,10,15,0,"Normal",RootPart,0) | |
775 | end | |
776 | end | |
777 | ||
778 | function ShootCannon() | |
779 | so(Asset.."161006069",hit,.5,1) | |
780 | local MainPos=aprt8.Position | |
781 | local MainPos2=MMouse.Hit.p | |
782 | local MouseLook=cf((MainPos+MainPos2)/2,MainPos2) | |
783 | --[[local mag=(MainPos-pos).magnitude | |
784 | MagicCylinder(BrickColor.new("Bright blue"),CFrame.new((MainPos+pos)/2,pos)*angles(1.57,0,0),1,mag*5,1,0.5,0,0.5,0.05)]] | |
785 | num=30 | |
786 | coroutine.resume(coroutine.create(function() | |
787 | repeat | |
788 | wait() | |
789 | local hit,pos = rayCast(MainPos,MouseLook.lookVector,10,CannonTarget.Parent) | |
790 | local mag=(MainPos-pos).magnitude | |
791 | MagicCylinder2(BrickColor.new("Bright blue"),CFrame.new((MainPos+pos)/2,pos)*angles(1.57,0,0),3,mag*5,3,1.5,0,1.5,0.1) | |
792 | MainPos=MainPos+(MouseLook.lookVector*10) | |
793 | num=num-1 | |
794 | if hit~=nil then | |
795 | num=0 | |
796 | Damagefunc(hit,20,30,0,"Normal",RootPart,.2) | |
797 | ref=part(3,workspace,0,1,Color3,"Reference",vt()) | |
798 | ref.Anchored=true | |
799 | ref.CFrame=cf(pos) | |
800 | so(Asset.."169445602",ref,1,0.8) | |
801 | so(Asset.."153092334",ref,1,0.8) | |
802 | MagicBlock(BrickColor.new("Bright blue"),cf(pos),20,20,20,5,5,5,0.05) | |
803 | game:GetService("Debris"):AddItem(ref,1) | |
804 | MagniDamage(ref,15,10,20,0,"Normal") | |
805 | end | |
806 | until num<=0 | |
807 | end)) | |
808 | end | |
809 | ||
810 | function ChangeTargetPose() | |
811 | for i=0,1,0.05 do | |
812 | swait() | |
813 | wld1.C0=clerp(wld1.C0,euler(-0.2,0,-0.3)*cf(4,-1,-0.2),.4) | |
814 | awld1.C0=clerp(awld1.C0,euler(-0.2,0,0.3)*cf(-4,-1,-0.2),.4) | |
815 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0.2,0,0),.3) | |
816 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,1.57),.3) | |
817 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,-1.57),.3) | |
818 | end | |
819 | end | |
820 | ||
821 | function ChangeRailgunTarget() | |
822 | Targ=MMouse.Target | |
823 | if Targ~=nil and Targ.Parent:findFirstChild("Humanoid")~=nil and Targ.Parent:findFirstChild("Torso")~=nil and Targ.Parent:findFirstChild("HumanoidRootPart")~=nil then | |
824 | RailgunTarget=Targ.Parent.HumanoidRootPart | |
825 | wld1.Part1=RailgunTarget.Parent.Torso | |
826 | local Dur=RailgunTarget | |
827 | local Hum=RailgunTarget.Parent.Humanoid | |
828 | local WalkSpeed=16 | |
829 | if Hum.WalkSpeed>16 then | |
830 | WalkSpeed=WalkSpeed*1.2 | |
831 | else | |
832 | WalkSpeed=Hum.WalkSpeed*1.2 | |
833 | end | |
834 | coroutine.resume(coroutine.create(function(Model) | |
835 | while RailgunTarget==Model do | |
836 | if Hum.WalkSpeed>5 then | |
837 | Hum.WalkSpeed=WalkSpeed | |
838 | end | |
839 | MagicCircle(BrickColor.new("White"),cf(Model.Parent.HumanoidRootPart.Position)*cf(math.random(-200,200)/100,-2.5,math.random(-200,200)/100),.5,1,.5,.3,4,.3,0.05) | |
840 | wait(.8) | |
841 | end | |
842 | Hum.WalkSpeed=16 | |
843 | end),Dur) | |
844 | end | |
845 | end | |
846 | ||
847 | function ChangeCannonTarget() | |
848 | Targ=MMouse.Target | |
849 | if Targ~=nil and Targ.Parent:findFirstChild("Humanoid")~=nil and Targ.Parent:findFirstChild("Torso")~=nil and Targ.Parent:findFirstChild("HumanoidRootPart")~=nil then | |
850 | CannonTarget=Targ.Parent.HumanoidRootPart | |
851 | awld1.Part1=CannonTarget.Parent.Torso | |
852 | local Dur=CannonTarget | |
853 | local Hum=CannonTarget.Parent.Humanoid | |
854 | Hum.MaxHealth=Hum.MaxHealth+50 | |
855 | Hum.Health=Hum.Health+50 | |
856 | coroutine.resume(coroutine.create(function(Model) | |
857 | while CannonTarget==Model do | |
858 | MagicCircle(BrickColor.new("White"),cf(Model.Parent.HumanoidRootPart.Position)*cf(math.random(-200,200)/100,-2.5,math.random(-200,200)/100),.5,1,.5,.3,4,.3,0.05) | |
859 | wait(1) | |
860 | end | |
861 | if Hum.MaxHealth>150 then | |
862 | Hum.MaxHealth=Hum.MaxHealth-50 | |
863 | Hum.Health=Hum.Health-50 | |
864 | else | |
865 | Hum.MaxHealth=100 | |
866 | end | |
867 | end),Dur) | |
868 | end | |
869 | end | |
870 | ||
871 | function BackToMe() | |
872 | model1.Parent=Character | |
873 | model2.Parent=Character | |
874 | for i=1,#Railgun do | |
875 | Railgun[i].Parent=model1 | |
876 | RailgunWelds[i].Parent=Railgun[1] | |
877 | end | |
878 | for i=1,#Plasma do | |
879 | Plasma[i].Parent=model2 | |
880 | PlasmaWelds[i].Parent=Plasma[1] | |
881 | end | |
882 | RailgunTarget=RootPart | |
883 | CannonTarget=RootPart | |
884 | wld1.Part1=RailgunTarget.Parent.Torso | |
885 | awld1.Part1=CannonTarget.Parent.Torso | |
886 | end | |
887 | ||
888 | function attackone() | |
889 | attack=true bladeattack=true | |
890 | --bprt4, bprt10, bprt16 | |
891 | for i=0,1,0.1 do | |
892 | swait() | |
893 | brefwld.C0=clerp(brefwld.C0,euler(0,0,0)*cf(0,-2.5,2),.4) | |
894 | bwld1.C0=clerp(bwld1.C0,euler(0,0,0)*cf(3,-0.6,-2),.4) | |
895 | bwld7.C0=clerp(bwld7.C0,euler(0,0,0)*cf(0,-0.6,-2),.4) | |
896 | bwld13.C0=clerp(bwld13.C0,euler(0,0,0)*cf(-3,-0.6,-2),.4) | |
897 | bwld2.C0=clerp(bwld2.C0,euler(3.14,-1.5,1)*cf(0,0,0),.4) | |
898 | bwld8.C0=clerp(bwld8.C0,euler(3.14,-1.5,1.57)*cf(0,0,0),.4) | |
899 | bwld14.C0=clerp(bwld14.C0,euler(3.14,-1.5,2)*cf(0,0,0),.4) | |
900 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(-0.3,0,0),.4) | |
901 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(3,0,-0.2),.4) | |
902 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(3,0,0.2),.4) | |
903 | end | |
904 | BladesDamage(math.random(100,200)/100) | |
905 | for i=0,1,0.2 do | |
906 | swait() | |
907 | brefwld.C0=clerp(brefwld.C0,euler(1.57,0,0)*cf(0,1.5,3),i) | |
908 | bwld2.C0=clerp(bwld2.C0,euler(3.14,-1.5,1.57)*cf(0,0,0),i) | |
909 | bwld8.C0=clerp(bwld8.C0,euler(3.14,-1.5,1.57)*cf(0,0,0),i) | |
910 | bwld14.C0=clerp(bwld14.C0,euler(3.14,-1.5,1.57)*cf(0,0,0),i) | |
911 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0.3,0,0),i) | |
912 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(1,0,0.2),i) | |
913 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(1,0,-0.2),i) | |
914 | end | |
915 | for i=0,1,0.1 do | |
916 | swait() | |
917 | brefwld.C0=clerp(brefwld.C0,euler(1.7,0,0)*cf(0,2,3),.3) | |
918 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0.4,0,0),.3) | |
919 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(.5,0,0.2),.3) | |
920 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(.5,0,-0.2),.3) | |
921 | end | |
922 | attack=false bladeattack=false | |
923 | --equipanim() | |
924 | end | |
925 | ||
926 | function attacktwo() | |
927 | attack=true bladeattack=true | |
928 | for i=0,1,0.1 do | |
929 | swait() | |
930 | brefwld.C0=clerp(brefwld.C0,euler(0,-1,0)*cf(6,1,3),.4) | |
931 | bwld1.C0=clerp(bwld1.C0,euler(0,-0.5,0)*cf(2,-0.6,-2),.4) | |
932 | bwld7.C0=clerp(bwld7.C0,euler(0,0,0)*cf(0,-0.6,-2),.4) | |
933 | bwld13.C0=clerp(bwld13.C0,euler(0,0.5,0)*cf(-2,-0.6,-2),.4) | |
934 | bwld2.C0=clerp(bwld2.C0,euler(4.71,-1.57,1.57)*cf(0,0,0),.4) | |
935 | bwld8.C0=clerp(bwld8.C0,euler(4.71,-1.57,1.57)*cf(0,0,0),.4) | |
936 | bwld14.C0=clerp(bwld14.C0,euler(4.71,-1.57,1.57)*cf(0,0,0),.4) | |
937 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0.6),.4) | |
938 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0,0,-0.6),.4) | |
939 | RW.C0=clerp(RW.C0,cf(1,0.5,-0.5)*euler(1.57,0,-1),.4) | |
940 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0.1,-1.57),.4) | |
941 | end | |
942 | BladesDamage(math.random(80,150)/100) | |
943 | for i=0,1,0.15 do | |
944 | swait() | |
945 | brefwld.C0=clerp(brefwld.C0,euler(0,1,0)*cf(-6,1,3),i) | |
946 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,-0.6),.4) | |
947 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0,0,0.6),.4) | |
948 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,-0.1,1.57),.4) | |
949 | LW.C0=clerp(LW.C0,cf(-1,0.5,-0.5)*euler(1.57,0,1),.4) | |
950 | end | |
951 | for i=0,1,0.1 do | |
952 | swait() | |
953 | brefwld.C0=clerp(brefwld.C0,euler(0,1.7,0)*cf(-6,1,-1),.3) | |
954 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,-0.3,1.57),.3) | |
955 | LW.C0=clerp(LW.C0,cf(-1,0.5,-0.5)*euler(1.57,0,1.3),.3) | |
956 | end | |
957 | attack=false bladeattack=false | |
958 | end | |
959 | ||
960 | function attackthree() | |
961 | attack=true bladeattack=true | |
962 | for i=0,1,0.09 do | |
963 | swait() | |
964 | bwld1.C0=clerp(bwld1.C0,cf(0,-4,-2)*euler(0,0,2.09),.4) | |
965 | bwld7.C0=clerp(bwld7.C0,cf(0,-4,-2)*euler(0,0,2.09*2),.4) | |
966 | bwld13.C0=clerp(bwld13.C0,cf(0,-4,-2)*euler(0,0,2.09*3),.4) | |
967 | bwld2.C0=clerp(bwld2.C0,euler(3.14,-1.3,1.57)*cf(0,0,0),.4) | |
968 | bwld8.C0=clerp(bwld8.C0,euler(3.14,-1.3,1.57)*cf(0,0,0),.4) | |
969 | bwld14.C0=clerp(bwld14.C0,euler(3.14,-1.3,1.57)*cf(0,0,0),.4) | |
970 | brefwld.C0=clerp(brefwld.C0,euler(0,0,0)*cf(0,0,-2),.4) | |
971 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.4) | |
972 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,1.57),.3) | |
973 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,-1.57),.3) | |
974 | end | |
975 | BladesDamage(math.random(100,200)/100) | |
976 | n=math.random(-50,50) | |
977 | for i=0,1,0.2 do | |
978 | swait() | |
979 | bwld1.C0=clerp(bwld1.C0,cf(0,-1.2,-2)*euler(0,0,2.09),.4) | |
980 | bwld7.C0=clerp(bwld7.C0,cf(0,-1.2,-2)*euler(0,0,2.09*2),.4) | |
981 | bwld13.C0=clerp(bwld13.C0,cf(0,-1.2,-2)*euler(0,0,2.09*3),.4) | |
982 | bwld2.C0=clerp(bwld2.C0,euler(3.14,-1.3,1.57)*cf(0,0,0),.4) | |
983 | bwld8.C0=clerp(bwld8.C0,euler(3.14,-1.3,1.57)*cf(0,0,0),.4) | |
984 | bwld14.C0=clerp(bwld14.C0,euler(3.14,-1.3,1.57)*cf(0,0,0),.4) | |
985 | brefwld.C0=clerp(brefwld.C0,euler(0,0,n)*cf(0,0,6),.4) | |
986 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,2,1.57),.4) | |
987 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,-2,-1.57),.4) | |
988 | end | |
989 | n=math.random(-50,50) | |
990 | for i=0,1,0.1 do | |
991 | swait() | |
992 | bwld1.C0=clerp(bwld1.C0,cf(0,-1,-2)*euler(0,0,2.09),.3) | |
993 | bwld7.C0=clerp(bwld7.C0,cf(0,-1,-2)*euler(0,0,2.09*2),.3) | |
994 | bwld13.C0=clerp(bwld13.C0,cf(0,-1,-2)*euler(0,0,2.09*3),.3) | |
995 | brefwld.C0=clerp(brefwld.C0,euler(0,0,n)*cf(0,0,7),.3) | |
996 | end | |
997 | attack=false bladeattack=false | |
998 | end | |
999 | ||
1000 | function attackfour() | |
1001 | attack=true bladeattack=true | |
1002 | for i=0,1,0.09 do | |
1003 | swait() | |
1004 | bwld1.C0=clerp(bwld1.C0,cf(0,-1,0)*euler(0,0,2.09),.4) | |
1005 | bwld7.C0=clerp(bwld7.C0,cf(0,-1,0)*euler(0,0,2.09*2),.4) | |
1006 | bwld13.C0=clerp(bwld13.C0,cf(0,-1,0)*euler(0,0,2.09*3),.4) | |
1007 | bwld2.C0=clerp(bwld2.C0,euler(1.57,0,-1.57)*cf(0,0,0),.4) | |
1008 | bwld8.C0=clerp(bwld8.C0,euler(1.57,0,-1.57)*cf(0,0,0),.4) | |
1009 | bwld14.C0=clerp(bwld14.C0,euler(1.57,0,-1.57)*cf(0,0,0),.4) | |
1010 | brefwld.C0=clerp(brefwld.C0,euler(-1.57,0,0)*cf(-5,-0.5,0),.4) | |
1011 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,-1),.4) | |
1012 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0,0,1),.4) | |
1013 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,1.57),.3) | |
1014 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-0.4,0,0),.3) | |
1015 | end | |
1016 | BladesDamage(math.random(40,80)/100) | |
1017 | for i=0,1,0.25 do | |
1018 | swait() | |
1019 | bwld1.C0=clerp(bwld1.C0,cf(0,-1,0)*euler(0,0,(2.09)+3.1),.3) | |
1020 | bwld7.C0=clerp(bwld7.C0,cf(0,-1,0)*euler(0,0,(2.09*2)+3.1),.3) | |
1021 | bwld13.C0=clerp(bwld13.C0,cf(0,-1,0)*euler(0,0,(2.09*3)+3.1),.3) | |
1022 | brefwld.C0=clerp(brefwld.C0,euler(-1.57,0,0)*cf(0,-0.5,8),.5) | |
1023 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.5) | |
1024 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0,0,0),.5) | |
1025 | RW.C0=clerp(RW.C0,cf(1,0.5,-0.5)*euler(0,2,1.57),.5) | |
1026 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-0.4,0,-0.2),.5) | |
1027 | end | |
1028 | for i=0,1,0.2 do | |
1029 | swait() | |
1030 | bwld1.C0=clerp(bwld1.C0,cf(0,-1,0)*euler(0,0,(2.09)+5),.3) | |
1031 | bwld7.C0=clerp(bwld7.C0,cf(0,-1,0)*euler(0,0,(2.09*2)+5),.3) | |
1032 | bwld13.C0=clerp(bwld13.C0,cf(0,-1,0)*euler(0,0,(2.09*3)+5),.3) | |
1033 | brefwld.C0=clerp(brefwld.C0,euler(-1.57,0,0)*cf(0,-0.5,20),.3) | |
1034 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.3) | |
1035 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0,0,0),.3) | |
1036 | RW.C0=clerp(RW.C0,cf(1,0.5,-0.5)*euler(0,2.5,1.57),.3) | |
1037 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-0.4,0,-0.2),.3) | |
1038 | end | |
1039 | for i=0,1,0.2 do | |
1040 | swait() | |
1041 | brefwld.C0=clerp(brefwld.C0,euler(-1.57,0,0)*cf(0,-2,0),.5) | |
1042 | bwld1.C0=clerp(bwld1.C0,cf(0,-1,0)*euler(0,0,(2.09)),.3) | |
1043 | bwld7.C0=clerp(bwld7.C0,cf(0,-1,0)*euler(0,0,(2.09*2)),.3) | |
1044 | bwld13.C0=clerp(bwld13.C0,cf(0,-1,0)*euler(0,0,(2.09*3)),.3) | |
1045 | end | |
1046 | attack=false bladeattack=false | |
1047 | end | |
1048 | ||
1049 | function BladesDamage(pitch) | |
1050 | so("http://www.roblox.com/asset/?id=161006195",bprt1,.6,pitch) | |
1051 | so("http://www.roblox.com/asset/?id=161006195",bprt7,.6,pitch) | |
1052 | so("http://www.roblox.com/asset/?id=161006195",bprt13,.6,pitch) | |
1053 | hitbox1.Parent=Character | |
1054 | hitbox1.Size=vt(1,2,1) | |
1055 | hitbox1.CFrame=bprt4.CFrame*euler(0,0,1.57) | |
1056 | hitbox1.Transparency=1 | |
1057 | hitbox2.Parent=Character | |
1058 | hitbox2.Size=vt(1,2,1) | |
1059 | hitbox2.CFrame=bprt10.CFrame*euler(0,0,1.57) | |
1060 | hitbox3.Parent=Character | |
1061 | hitbox3.Size=vt(1,2,1) | |
1062 | hitbox3.CFrame=bprt16.CFrame*euler(0,0,1.57) | |
1063 | con1=hitbox1.Touched:connect(function(hit) Damagefunc(hit,10,20,math.random(1,5),"Normal",RootPart,.5,1) end) | |
1064 | con2=hitbox2.Touched:connect(function(hit) Damagefunc(hit,10,20,math.random(1,5),"Normal",RootPart,.5,1) end) | |
1065 | con3=hitbox3.Touched:connect(function(hit) Damagefunc(hit,10,20,math.random(1,5),"Normal",RootPart,.5,1) end) | |
1066 | coroutine.resume(coroutine.create(function() | |
1067 | while attack==true do | |
1068 | swait() | |
1069 | hitbox1.CFrame=bprt4.CFrame*euler(0,0,1.57) | |
1070 | hitbox2.CFrame=bprt10.CFrame | |
1071 | hitbox3.CFrame=bprt16.CFrame | |
1072 | end | |
1073 | con1:disconnect() | |
1074 | con2:disconnect() | |
1075 | con3:disconnect() | |
1076 | hitbox1.Parent=nil | |
1077 | hitbox2.Parent=nil | |
1078 | hitbox3.Parent=nil | |
1079 | end)) | |
1080 | end | |
1081 | ||
1082 | function MagniDamage(Part,magni,mindam,maxdam,knock,Type) | |
1083 | for _,c in pairs(workspace:children()) do | |
1084 | local hum=c:findFirstChild("Humanoid") | |
1085 | if hum~=nil then | |
1086 | local head=c:findFirstChild("Torso") | |
1087 | if head~=nil then | |
1088 | local targ=head.Position-Part.Position | |
1089 | local mag=targ.magnitude | |
1090 | if mag<=magni and c.Name~=Player.Name then | |
1091 | if c~=CannonTarget.Parent or c~=RailgunTarget.Parent then | |
1092 | Damagefunc(head,mindam,maxdam,knock,Type,RootPart,.2,1,nil,1) | |
1093 | end | |
1094 | end | |
1095 | end | |
1096 | end | |
1097 | end | |
1098 | end | |
1099 | ||
1100 | function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants | |
1101 | return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore) | |
1102 | end | |
1103 | ||
1104 | local Point=Torso.CFrame*cf(0,Torso.Size.Y,0) | |
1105 | LastPoint=Point | |
1106 | function effect(Color,Ref,LP,P1,returnn) | |
1107 | local effectsmsh=Instance.new("CylinderMesh") | |
1108 | effectsmsh.Scale=Vector3.new(0.2,1,0.2) | |
1109 | effectsmsh.Name="Mesh" | |
1110 | local effectsg=Instance.new("Part") | |
1111 | effectsg.formFactor=3 | |
1112 | effectsg.CanCollide=false | |
1113 | effectsg.Name="Eff" | |
1114 | effectsg.Locked=true | |
1115 | effectsg.Anchored=true | |
1116 | effectsg.Size=Vector3.new(0.5,1,0.5) | |
1117 | effectsg.Parent=workspace | |
1118 | effectsmsh.Parent=effectsg | |
1119 | effectsg.BrickColor=BrickColor.new(Color) | |
1120 | effectsg.Reflectance=Ref | |
1121 | local point1=P1 | |
1122 | local mg=(LP.p - point1.p).magnitude | |
1123 | effectsg.Size=Vector3.new(0.5,mg,0.5) | |
1124 | effectsg.CFrame=cf((LP.p+point1.p)/2,point1.p) * CFrame.Angles(math.rad(90),0,0) | |
1125 | effectsmsh.Scale=Vector3.new(0.2,1,0.2) | |
1126 | game:GetService("Debris"):AddItem(effectsg,2) | |
1127 | if returnn then return effectsg end | |
1128 | coroutine.resume(coroutine.create(function(Part,Mesh) | |
1129 | if not returnn then | |
1130 | for i=0,1,0.05 do | |
1131 | wait() | |
1132 | Part.Transparency=1*i | |
1133 | Mesh.Scale=Vector3.new(0.5-0.5*i,1,0.5-0.5*i) | |
1134 | end | |
1135 | Part.Parent=nil | |
1136 | end | |
1137 | end),effectsg,effectsmsh) | |
1138 | end | |
1139 | ||
1140 | local function CFrameFromTopBack(at, top, back) | |
1141 | local right = top:Cross(back) | |
1142 | return CFrame.new(at.x, at.y, at.z, | |
1143 | right.x, top.x, back.x, | |
1144 | right.y, top.y, back.y, | |
1145 | right.z, top.z, back.z) | |
1146 | end | |
1147 | ||
1148 | function Triangle(a, b, c) | |
1149 | local edg1 = (c-a):Dot((b-a).unit) | |
1150 | local edg2 = (a-b):Dot((c-b).unit) | |
1151 | local edg3 = (b-c):Dot((a-c).unit) | |
1152 | if edg1 <= (b-a).magnitude and edg1 >= 0 then | |
1153 | a, b, c = a, b, c | |
1154 | elseif edg2 <= (c-b).magnitude and edg2 >= 0 then | |
1155 | a, b, c = b, c, a | |
1156 | elseif edg3 <= (a-c).magnitude and edg3 >= 0 then | |
1157 | a, b, c = c, a, b | |
1158 | else | |
1159 | assert(false, "unreachable") | |
1160 | end | |
1161 | ||
1162 | local len1 = (c-a):Dot((b-a).unit) | |
1163 | local len2 = (b-a).magnitude - len1 | |
1164 | local width = (a + (b-a).unit*len1 - c).magnitude | |
1165 | ||
1166 | local maincf = CFrameFromTopBack(a, (b-a):Cross(c-b).unit, -(b-a).unit) | |
1167 | ||
1168 | local list = {} | |
1169 | ||
1170 | if len1 > 0.01 then | |
1171 | local w1 = Instance.new('WedgePart', m) | |
1172 | w1.Material = "SmoothPlastic" | |
1173 | w1.FormFactor = 'Custom' | |
1174 | w1.BrickColor = BrickColor.new("White") | |
1175 | w1.Transparency = 0 | |
1176 | w1.Reflectance = 0 | |
1177 | w1.Material = "SmoothPlastic" | |
1178 | w1.CanCollide = false | |
1179 | NoOutline(w1) | |
1180 | local sz = Vector3.new(0.2, width, len1) | |
1181 | w1.Size = sz | |
1182 | local sp = Instance.new("SpecialMesh",w1) | |
1183 | sp.MeshType = "Wedge" | |
1184 | sp.Scale = Vector3.new(0,1,1) * sz/w1.Size | |
1185 | w1:BreakJoints() | |
1186 | w1.Anchored = true | |
1187 | w1.Parent = workspace | |
1188 | w1.Transparency = 0.7 | |
1189 | coroutine.resume(coroutine.create(function(Part) | |
1190 | for i=0,1,0.1 do | |
1191 | wait() | |
1192 | Part.Transparency=Part.Transparency+0.03 | |
1193 | end | |
1194 | end),w1) | |
1195 | w1.CFrame = maincf*CFrame.Angles(math.pi,0,math.pi/2)*CFrame.new(0,width/2,len1/2) | |
1196 | table.insert(list,w1) | |
1197 | end | |
1198 | ||
1199 | if len2 > 0.01 then | |
1200 | local w2 = Instance.new('WedgePart', m) | |
1201 | w2.Material = "SmoothPlastic" | |
1202 | w2.FormFactor = 'Custom' | |
1203 | w2.BrickColor = BrickColor.new("White") | |
1204 | w2.Transparency = 0 | |
1205 | w2.Reflectance = 0 | |
1206 | w2.Material = "SmoothPlastic" | |
1207 | w2.CanCollide = false | |
1208 | NoOutline(w2) | |
1209 | local sz = Vector3.new(0.2, width, len2) | |
1210 | w2.Size = sz | |
1211 | local sp = Instance.new("SpecialMesh",w2) | |
1212 | sp.MeshType = "Wedge" | |
1213 | sp.Scale = Vector3.new(0,1,1) * sz/w2.Size | |
1214 | w2:BreakJoints() | |
1215 | w2.Anchored = true | |
1216 | w2.Parent = workspace | |
1217 | w2.Transparency = 0.7 | |
1218 | coroutine.resume(coroutine.create(function(Part) | |
1219 | for i=0,1,0.1 do | |
1220 | wait() | |
1221 | Part.Transparency=Part.Transparency+0.03 | |
1222 | end | |
1223 | end),w2) | |
1224 | w2.CFrame = maincf*CFrame.Angles(math.pi,math.pi,-math.pi/2)*CFrame.new(0,width/2,-len1 - len2/2) | |
1225 | table.insert(list,w2) | |
1226 | end | |
1227 | return unpack(list) | |
1228 | end | |
1229 | ||
1230 | --[[ | |
1231 | Things for effects | |
1232 | put the variables in one table | |
1233 | like effect={brick,interval,i} | |
1234 | ]] | |
1235 | local Effects={} | |
1236 | function MagicBlock(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay) | |
1237 | local prt=part(3,workspace,0,0,brickcolor,"Effect",vt()) | |
1238 | prt.Anchored=true | |
1239 | prt.CFrame=cframe | |
1240 | msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1)) | |
1241 | game:GetService("Debris"):AddItem(prt,5) | |
1242 | table.insert(Effects,{prt,"Block1",delay,x3,y3,z3}) --part, type, delay | |
1243 | --[[coroutine.resume(coroutine.create(function(Part,Mesh,dur) | |
1244 | for i=0,1,delay do | |
1245 | wait() | |
1246 | Part.CFrame=Part.CFrame*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50)) | |
1247 | Part.Transparency=i | |
1248 | Mesh.Scale=Mesh.Scale+vt(x3,y3,z3) | |
1249 | end | |
1250 | Part.Parent=nil | |
1251 | end),prt,msh)]] | |
1252 | end | |
1253 | ||
1254 | function MagicCircle(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay) | |
1255 | local prt=part(3,workspace,0,0,brickcolor,"Effect",vt()) | |
1256 | prt.Anchored=true | |
1257 | prt.CFrame=cframe | |
1258 | local msh=mesh("SpecialMesh",prt,"Sphere","",vt(0,0,0),vt(x1,y1,z1)) | |
1259 | game:GetService("Debris"):AddItem(prt,5) | |
1260 | table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3}) | |
1261 | --[[coroutine.resume(coroutine.create(function(Part,Mesh) | |
1262 | local wld=nil | |
1263 | for i=0,1,delay do | |
1264 | wait() | |
1265 | Part.CFrame=Part.CFrame | |
1266 | Part.Transparency=i | |
1267 | Mesh.Scale=Mesh.Scale+vt(x3,y3,z3) | |
1268 | end | |
1269 | Part.Parent=nil | |
1270 | end),prt,msh)]] | |
1271 | end | |
1272 | ||
1273 | function MagicRing(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay,Type,parent) | |
1274 | local prt=part(3,workspace,0,0,brickcolor,"Effect",vt()) | |
1275 | if Type~=2 then | |
1276 | prt.Anchored=true | |
1277 | end | |
1278 | prt.CFrame=cframe | |
1279 | local msh=mesh("SpecialMesh",prt,"FileMesh","http://www.roblox.com/asset/?id=3270017",vt(0,0,0),vt(x1,y1,z1)) | |
1280 | game:GetService("Debris"):AddItem(prt,5) | |
1281 | coroutine.resume(coroutine.create(function(Part,Mesh,dur) | |
1282 | local wld=nil | |
1283 | if dur==2 then | |
1284 | wld=weld(Part,Part,parent,euler(0,0,0)*cf(0,0,0)) | |
1285 | end | |
1286 | for i=0,1,delay do | |
1287 | wait() | |
1288 | if dur==1 then | |
1289 | Part.CFrame=Part.CFrame | |
1290 | elseif dur==2 then | |
1291 | wld.C0=cframe | |
1292 | end | |
1293 | Part.Transparency=i | |
1294 | Mesh.Scale=Mesh.Scale+vt(x3,y3,z3) | |
1295 | end | |
1296 | Part.Parent=nil | |
1297 | end),prt,msh,Type) | |
1298 | end | |
1299 | ||
1300 | function MagicWaveThing(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay) | |
1301 | local prt=part(3,workspace,0,0,brickcolor,"Effect",vt()) | |
1302 | prt.Anchored=true | |
1303 | prt.CFrame=cframe | |
1304 | msh=mesh("SpecialMesh",prt,"FileMesh","http://www.roblox.com/asset/?id=1051557",vt(0,0,0),vt(x1,y1,z1)) | |
1305 | game:GetService("Debris"):AddItem(prt,5) | |
1306 | coroutine.resume(coroutine.create(function(Part,Mesh) | |
1307 | for i=0,1,delay do | |
1308 | wait() | |
1309 | Part.CFrame=Part.CFrame*euler(0,0.7,0) | |
1310 | Part.Transparency=i | |
1311 | Mesh.Scale=Mesh.Scale+vt(x3,y3,z3) | |
1312 | end | |
1313 | Part.Parent=nil | |
1314 | end),prt,msh) | |
1315 | end | |
1316 | ||
1317 | function WaveEffect(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay,mshtype) | |
1318 | local prt=part(3,workspace,0,0,brickcolor,"Effect",vt()) | |
1319 | prt.Anchored=true | |
1320 | prt.CFrame=cframe | |
1321 | local thetype="" | |
1322 | if mshtype==1 then | |
1323 | thetype="http://www.roblox.com/asset/?id=20329976" | |
1324 | elseif mshtype==2 then | |
1325 | thetype="http://www.roblox.com/asset/?id=1323306" | |
1326 | end | |
1327 | msh=mesh("SpecialMesh",prt,"FileMesh",thetype,vt(0,0,0),vt(x1,y1,z1)) | |
1328 | game:GetService("Debris"):AddItem(prt,2) | |
1329 | coroutine.resume(coroutine.create(function(Part,Mesh) | |
1330 | for i=0,1,delay do | |
1331 | wait() | |
1332 | Part.CFrame=Part.CFrame*cf(0,y3/2,0) | |
1333 | Part.Transparency=i | |
1334 | Mesh.Scale=Mesh.Scale+vt(x3,y3,z3) | |
1335 | end | |
1336 | Part.Parent=nil | |
1337 | end),prt,msh) | |
1338 | end | |
1339 | ||
1340 | function MagicCylinder(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay) | |
1341 | local prt=part(3,Character,0,0,brickcolor,"Effect",vt(0.2,0.2,0.2)) | |
1342 | prt.Anchored=true | |
1343 | prt.CFrame=cframe | |
1344 | msh=mesh("SpecialMesh",prt,"Head","",vt(0,0,0),vt(x1,y1,z1)) | |
1345 | game:GetService("Debris"):AddItem(prt,5) | |
1346 | --table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3}) | |
1347 | Effects[#Effects+1]={prt,"Cylinder",delay,x3,y3,z3} --part, type, delay | |
1348 | --[[coroutine.resume(coroutine.create(function(Part,Mesh) | |
1349 | for i=0,1,delay do | |
1350 | wait() | |
1351 | Part.CFrame=Part.CFrame | |
1352 | Part.Transparency=i | |
1353 | Mesh.Scale=Mesh.Scale+vt(x3,y3,z3) | |
1354 | end | |
1355 | Part.Parent=nil | |
1356 | end),prt,msh)]] | |
1357 | end | |
1358 | ||
1359 | function MagicCylinder2(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay) | |
1360 | local prt=part(3,Character,0,0,brickcolor,"Effect",vt(0.2,0.2,0.2)) | |
1361 | prt.Anchored=true | |
1362 | prt.CFrame=cframe | |
1363 | msh=mesh("CylinderMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1)) | |
1364 | game:GetService("Debris"):AddItem(prt,5) | |
1365 | --table.insert(Effects,{prt,"Cylinder",delay,x3,y3,z3}) | |
1366 | Effects[#Effects+1]={prt,"Cylinder",delay,x3,y3,z3} --part, type, delay | |
1367 | --[[coroutine.resume(coroutine.create(function(Part,Mesh) | |
1368 | for i=0,1,delay do | |
1369 | wait() | |
1370 | Part.CFrame=Part.CFrame | |
1371 | Part.Transparency=i | |
1372 | Mesh.Scale=Mesh.Scale+vt(x3,y3,z3) | |
1373 | end | |
1374 | Part.Parent=nil | |
1375 | end),prt,msh)]] | |
1376 | end | |
1377 | ||
1378 | function ElecEffect(cff,x,y,z) | |
1379 | local prt=part(3,workspace,0,0,BrickColor.new("White"),"Part",vt(1,1,1)) | |
1380 | prt.Anchored=true | |
1381 | prt.CFrame=cf(cff)*cf(math.random(-x,x),math.random(-y,y),math.random(-z,z)) | |
1382 | game:GetService("Debris"):AddItem(prt,2) | |
1383 | xval=math.random()/2 | |
1384 | yval=math.random()/2 | |
1385 | zval=math.random()/2 | |
1386 | msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(xval,yval,zval)) | |
1387 | Effects[#Effects+1]={prt,"Elec",0.1,x,y,z,xval,yval,zval} --part, type, delay | |
1388 | --[[coroutine.resume(coroutine.create(function(Part,Mesh,Frame,xvaal,yvaal,zvaal) | |
1389 | Part.CFrame=cf(Frame)*cf(math.random(-x,x),math.random(-y,y),math.random(-z,z)) | |
1390 | for i=0,1,0.05 do | |
1391 | swait() | |
1392 | xvaal=xvaal-0.1 | |
1393 | yvaal=yvaal-0.1 | |
1394 | zvaal=zvaal-0.1 | |
1395 | Mesh.Scale=vt(xvaal,yvaal,zvaal) | |
1396 | Part.Transparency=i | |
1397 | end | |
1398 | Part.Parent=nil | |
1399 | end),prt,msh,cff,xval,yval,zval)]] | |
1400 | end | |
1401 | ||
1402 | Damagefunc=function(hit,minim,maxim,knockback,Type,Property,Delay,KnockbackType,decreaseblock) | |
1403 | if hit.Parent==nil then | |
1404 | return | |
1405 | end | |
1406 | h=hit.Parent:FindFirstChild("Humanoid") | |
1407 | for _,v in pairs(hit.Parent:children()) do | |
1408 | if v:IsA("Humanoid") then | |
1409 | h=v | |
1410 | end | |
1411 | end | |
1412 | if hit.Parent.Parent:FindFirstChild("Torso")~=nil then | |
1413 | h=hit.Parent.Parent:FindFirstChild("Humanoid") | |
1414 | end | |
1415 | if hit.Parent.className=="Hat" then | |
1416 | hit=hit.Parent.Parent:findFirstChild("Head") | |
1417 | end | |
1418 | -- and hit.Parent~=CannonTarget.Parent or hit.Parent~=RailgunTarget.Parent | |
1419 | if h~=nil and hit.Parent.Name~=Character.Name and hit.Parent:FindFirstChild("Torso")~=nil then | |
1420 | if hit.Parent~=CannonTarget.Parent and hit.Parent~=RailgunTarget.Parent then | |
1421 | if hit.Parent:findFirstChild("DebounceHit")~=nil then if hit.Parent.DebounceHit.Value==true then return end end | |
1422 | --[[ if game.Players:GetPlayerFromCharacter(hit.Parent)~=nil then | |
1423 | return | |
1424 | end]] | |
1425 | -- hs(hit,1.2) | |
1426 | c=Instance.new("ObjectValue") | |
1427 | c.Name="creator" | |
1428 | c.Value=game:service("Players").LocalPlayer | |
1429 | c.Parent=h | |
1430 | game:GetService("Debris"):AddItem(c,.5) | |
1431 | Damage=math.random(minim,maxim) | |
1432 | -- h:TakeDamage(Damage) | |
1433 | blocked=false | |
1434 | block=hit.Parent:findFirstChild("Block") | |
1435 | if block~=nil then | |
1436 | print(block.className) | |
1437 | if block.className=="NumberValue" then | |
1438 | if block.Value>0 then | |
1439 | blocked=true | |
1440 | if decreaseblock==nil then | |
1441 | block.Value=block.Value-1 | |
1442 | end | |
1443 | end | |
1444 | end | |
1445 | if block.className=="IntValue" then | |
1446 | if block.Value>0 then | |
1447 | blocked=true | |
1448 | if decreaseblock~=nil then | |
1449 | block.Value=block.Value-1 | |
1450 | end | |
1451 | end | |
1452 | end | |
1453 | end | |
1454 | if blocked==false then | |
1455 | -- h:TakeDamage(Damage) | |
1456 | h.Health=h.Health-Damage | |
1457 | showDamage(hit.Parent,Damage,.5,BrickColor:Red()) | |
1458 | else | |
1459 | h.Health=h.Health-(Damage/2) | |
1460 | showDamage(hit.Parent,Damage/2,.5,BrickColor.new("Bright blue")) | |
1461 | end | |
1462 | if Type=="Knockdown" then | |
1463 | hum=hit.Parent.Humanoid | |
1464 | hum.PlatformStand=true | |
1465 | coroutine.resume(coroutine.create(function(HHumanoid) | |
1466 | swait(1) | |
1467 | HHumanoid.PlatformStand=false | |
1468 | end),hum) | |
1469 | local angle=(hit.Position-(Property.Position+Vector3.new(0,0,0))).unit | |
1470 | --hit.CFrame=cf(hit.Position,Vector3.new(angle.x,hit.Position.y,angle.z))*CFrame.fromEulerAnglesXYZ(math.pi/4,0,0) | |
1471 | local bodvol=Instance.new("BodyVelocity") | |
1472 | bodvol.velocity=angle*knockback | |
1473 | bodvol.P=5000 | |
1474 | bodvol.maxForce=Vector3.new(8e+003, 8e+003, 8e+003) | |
1475 | bodvol.Parent=hit | |
1476 | rl=Instance.new("BodyAngularVelocity") | |
1477 | rl.P=3000 | |
1478 | rl.maxTorque=Vector3.new(500000,500000,500000)*50000000000000 | |
1479 | rl.angularvelocity=Vector3.new(math.random(-10,10),math.random(-10,10),math.random(-10,10)) | |
1480 | rl.Parent=hit | |
1481 | game:GetService("Debris"):AddItem(bodvol,.5) | |
1482 | game:GetService("Debris"):AddItem(rl,.5) | |
1483 | elseif Type=="Normal" then | |
1484 | vp=Instance.new("BodyVelocity") | |
1485 | vp.P=500 | |
1486 | vp.maxForce=Vector3.new(math.huge,0,math.huge) | |
1487 | -- vp.velocity=Character.Torso.CFrame.lookVector*Knockback | |
1488 | if KnockbackType==1 then | |
1489 | vp.velocity=Property.CFrame.lookVector*knockback+Property.Velocity/1.05 | |
1490 | elseif KnockbackType==2 then | |
1491 | vp.velocity=Property.CFrame.lookVector*knockback | |
1492 | end | |
1493 | if knockback>0 then | |
1494 | vp.Parent=hit.Parent.Torso | |
1495 | end | |
1496 | game:GetService("Debris"):AddItem(vp,.5) | |
1497 | elseif Type=="Up" then | |
1498 | local bodyVelocity=Instance.new("BodyVelocity") | |
1499 | bodyVelocity.velocity=vt(0,30,0) | |
1500 | bodyVelocity.P=5000 | |
1501 | bodyVelocity.maxForce=Vector3.new(8e+003, 8e+003, 8e+003) | |
1502 | bodyVelocity.Parent=hit | |
1503 | game:GetService("Debris"):AddItem(bodyVelocity,1) | |
1504 | rl=Instance.new("BodyAngularVelocity") | |
1505 | rl.P=3000 | |
1506 | rl.maxTorque=Vector3.new(500000,500000,500000)*50000000000000 | |
1507 | rl.angularvelocity=Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5)) | |
1508 | rl.Parent=hit | |
1509 | game:GetService("Debris"):AddItem(rl,.5) | |
1510 | elseif Type=="Snare" then | |
1511 | bp=Instance.new("BodyPosition") | |
1512 | bp.P=2000 | |
1513 | bp.D=100 | |
1514 | bp.maxForce=Vector3.new(math.huge,math.huge,math.huge) | |
1515 | bp.position=hit.Parent.Torso.Position | |
1516 | bp.Parent=hit.Parent.Torso | |
1517 | game:GetService("Debris"):AddItem(bp,1) | |
1518 | elseif Type=="Charge" then | |
1519 | Charge=Charge+1 | |
1520 | coroutine.resume(coroutine.create(function(Part) | |
1521 | swait(30) | |
1522 | for i=1,5 do | |
1523 | swait(5) | |
1524 | so("rbxasset://sounds\\unsheath.wav",hit,1,2) | |
1525 | MagicCircle(BrickColor.new("Bright red"),hit.CFrame*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50)),.2,2,.1,.2,8,.1,0.05) | |
1526 | newdam=math.random(1,5) | |
1527 | if blocked==false then | |
1528 | h:TakeDamage(newdam) | |
1529 | showDamage(hit.Parent,newdam,.5,BrickColor:Red()) | |
1530 | else | |
1531 | h:TakeDamage(newdam/2) | |
1532 | showDamage(hit.Parent,newdam,.5,BrickColor.new("Bright blue")) | |
1533 | end | |
1534 | end | |
1535 | end),hit) | |
1536 | end | |
1537 | debounce=Instance.new("BoolValue") | |
1538 | debounce.Name="DebounceHit" | |
1539 | debounce.Parent=hit.Parent | |
1540 | debounce.Value=true | |
1541 | game:GetService("Debris"):AddItem(debounce,Delay) | |
1542 | c=Instance.new("ObjectValue") | |
1543 | c.Name="creator" | |
1544 | c.Value=Player | |
1545 | c.Parent=h | |
1546 | game:GetService("Debris"):AddItem(c,.5) | |
1547 | CRIT=false | |
1548 | hitDeb=true | |
1549 | AttackPos=6 | |
1550 | end | |
1551 | end | |
1552 | end | |
1553 | ||
1554 | showDamage=function(Char,Dealt,du,Color) | |
1555 | m=Instance.new("Model") | |
1556 | m.Name=tostring(Dealt) | |
1557 | h=Instance.new("Humanoid") | |
1558 | h.Health=0 | |
1559 | h.MaxHealth=0 | |
1560 | h.Parent=m | |
1561 | c=Instance.new("Part") | |
1562 | c.Transparency=0 | |
1563 | c.BrickColor=Color | |
1564 | c.Name="Head" | |
1565 | c.TopSurface=0 | |
1566 | c.BottomSurface=0 | |
1567 | c.formFactor="Plate" | |
1568 | c.Size=Vector3.new(1,.4,1) | |
1569 | ms=Instance.new("CylinderMesh") | |
1570 | ms.Scale=Vector3.new(.8,.8,.8) | |
1571 | if CRIT==true then | |
1572 | ms.Scale=Vector3.new(1,1.25,1) | |
1573 | end | |
1574 | ms.Parent=c | |
1575 | c.Reflectance=0 | |
1576 | Instance.new("BodyGyro").Parent=c | |
1577 | c.Parent=m | |
1578 | if Char:findFirstChild("Head")~=nil then | |
1579 | c.CFrame=cf(Char["Head"].CFrame.p+Vector3.new(0,1.5,0)) | |
1580 | elseif Char.Parent:findFirstChild("Head")~=nil then | |
1581 | c.CFrame=cf(Char.Parent["Head"].CFrame.p+Vector3.new(0,1.5,0)) | |
1582 | end | |
1583 | f=Instance.new("BodyPosition") | |
1584 | f.P=2000 | |
1585 | f.D=100 | |
1586 | f.maxForce=Vector3.new(math.huge,math.huge,math.huge) | |
1587 | f.position=c.Position+Vector3.new(0,3,0) | |
1588 | f.Parent=c | |
1589 | game:GetService("Debris"):AddItem(m,.5+du) | |
1590 | c.CanCollide=false | |
1591 | m.Parent=workspace | |
1592 | c.CanCollide=false | |
1593 | end | |
1594 | ||
1595 | combo=0 | |
1596 | local hold=false | |
1597 | local railgunshoot=true | |
1598 | local cannonshoot=true | |
1599 | function ob1d(mouse) | |
1600 | hold=true | |
1601 | if attack==true then return end | |
1602 | coroutine.resume(coroutine.create(function() | |
1603 | while hold==true do | |
1604 | wait() | |
1605 | if aimrailgun==true and railgunshoot==true then | |
1606 | railgunshoot=false | |
1607 | coroutine.resume(coroutine.create(function() | |
1608 | wait(.8) | |
1609 | railgunshoot=true | |
1610 | end)) | |
1611 | ShootRailGun() | |
1612 | end | |
1613 | if aimcannon==true and cannonshoot==true then | |
1614 | cannonshoot=false | |
1615 | coroutine.resume(coroutine.create(function() | |
1616 | wait(2.1) | |
1617 | cannonshoot=true | |
1618 | end)) | |
1619 | ShootCannon() | |
1620 | end | |
1621 | end | |
1622 | end)) | |
1623 | if aimrailgun==true or aimcannon==true then return end | |
1624 | if bladeattack==true then return end | |
1625 | --attackfour() | |
1626 | if combo==0 then | |
1627 | combo=1 | |
1628 | attackone() | |
1629 | elseif combo==1 then | |
1630 | combo=2 | |
1631 | attacktwo() | |
1632 | elseif combo==2 then | |
1633 | combo=3 | |
1634 | attackthree() | |
1635 | elseif combo==3 then | |
1636 | combo=4 | |
1637 | attackfour() | |
1638 | elseif combo==4 then | |
1639 | combo=0 | |
1640 | end | |
1641 | coroutine.resume(coroutine.create(function() | |
1642 | for i=1,20 do | |
1643 | if attack==false then | |
1644 | swait() | |
1645 | end | |
1646 | end | |
1647 | if attack==false then | |
1648 | combo=0 | |
1649 | equipanim() | |
1650 | end | |
1651 | end)) | |
1652 | end | |
1653 | ||
1654 | function ob1u(mouse) | |
1655 | hold = false | |
1656 | end | |
1657 | ||
1658 | buttonhold = false | |
1659 | ||
1660 | eul=0 | |
1661 | holdx=false | |
1662 | equipped=false | |
1663 | function key(key) | |
1664 | if key=="g" and aimrailgun==false and aimcannon==false and equipped==true then | |
1665 | if changetarget==false then | |
1666 | attack=true | |
1667 | changetarget=true | |
1668 | coroutine.resume(coroutine.create(function() | |
1669 | while changetarget==true do | |
1670 | ElecEffect(prt1.Position,1,1,1) | |
1671 | wait(.1) | |
1672 | ElecEffect(aprt1.Position,1,1,1) | |
1673 | wait(.1) | |
1674 | end | |
1675 | end)) | |
1676 | ChangeTargetPose() | |
1677 | else | |
1678 | attack=false | |
1679 | changetarget=false | |
1680 | for i=0,1,0.05 do | |
1681 | swait() | |
1682 | wld1.C0=clerp(wld1.C0,euler(-0.2,0,0)*cf(3,-1,-0.2),.4) | |
1683 | awld1.C0=clerp(awld1.C0,euler(-0.2,0,0)*cf(-3,-1,-0.2),.4) | |
1684 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0,0,0),.3) | |
1685 | --[[RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,0.5),.3) | |
1686 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,-0.5),.3)]] | |
1687 | --[[Torso.Neck.C0=necko*euler(0,0,0) | |
1688 | RootJoint.C0=RootCF*euler(0,0,0) | |
1689 | RW.C0=cf(1.5,0.5,0)*euler(0,0,0.5) | |
1690 | RW.C1=cf(0,0.5,0)*euler(0,0,0) | |
1691 | LW.C0=cf(-1.5,0.5,0)*euler(0,0,-0.5) | |
1692 | LW.C1=cf(0,0.5,0)*euler(0,0,0)]] | |
1693 | end | |
1694 | end | |
1695 | end | |
1696 | if changetarget==true and aimrailgun==false and aimcannon==false then | |
1697 | if key=="z" then | |
1698 | ChangeRailgunTarget() | |
1699 | end | |
1700 | if key=="x" then | |
1701 | ChangeCannonTarget() | |
1702 | end | |
1703 | if key=="c" then | |
1704 | BackToMe() | |
1705 | end | |
1706 | end | |
1707 | if attack==true then return end | |
1708 | if key=="f" then | |
1709 | attack=true | |
1710 | if equipped==false then | |
1711 | equipped=true | |
1712 | RSH=ch.Torso["Right Shoulder"] | |
1713 | LSH=ch.Torso["Left Shoulder"] | |
1714 | -- | |
1715 | RSH.Parent=nil | |
1716 | LSH.Parent=nil | |
1717 | -- | |
1718 | RW.Name="Right Shoulder" | |
1719 | RW.Part0=ch.Torso | |
1720 | RW.C0=cf(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5) | |
1721 | RW.C1=cf(0, 0.5, 0) | |
1722 | RW.Part1=ch["Right Arm"] | |
1723 | RW.Parent=ch.Torso | |
1724 | -- | |
1725 | LW.Name="Left Shoulder" | |
1726 | LW.Part0=ch.Torso | |
1727 | LW.C0=cf(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8) | |
1728 | LW.C1=cf(0, 0.5, 0) | |
1729 | LW.Part1=ch["Left Arm"] | |
1730 | LW.Parent=ch.Torso | |
1731 | -- | |
1732 | equipanim() | |
1733 | else | |
1734 | changetarget=false | |
1735 | equipped=false | |
1736 | hideanim() | |
1737 | swait(0) | |
1738 | RW.Parent=nil | |
1739 | LW.Parent=nil | |
1740 | RSH.Parent=player.Character.Torso | |
1741 | LSH.Parent=player.Character.Torso | |
1742 | end | |
1743 | attack=false | |
1744 | end | |
1745 | if equipped==false then return end | |
1746 | if changetarget==true then return end | |
1747 | if key=="0" then | |
1748 | Humanoid.WalkSpeed=(16*1.5) | |
1749 | end | |
1750 | if key=="z" then | |
1751 | if aimrailgun==false then | |
1752 | aimrailgun=true | |
1753 | AimRailGun() | |
1754 | else | |
1755 | aimrailgun=false | |
1756 | UnAimRailGun() | |
1757 | end | |
1758 | end | |
1759 | if key=="x" then | |
1760 | if aimcannon==false then | |
1761 | aimcannon=true | |
1762 | AimCannon() | |
1763 | else | |
1764 | aimcannon=false | |
1765 | UnAimCannon() | |
1766 | end | |
1767 | end | |
1768 | end | |
1769 | ||
1770 | function key2(key) | |
1771 | if key=="0" then | |
1772 | Humanoid.WalkSpeed=16 | |
1773 | end | |
1774 | end | |
1775 | ||
1776 | function s(mouse) | |
1777 | mouse.Button1Down:connect(function() ob1d(mouse) end) | |
1778 | mouse.Button1Up:connect(function() ob1u(mouse) end) | |
1779 | mouse.KeyDown:connect(key) | |
1780 | mouse.KeyUp:connect(key2) | |
1781 | ||
1782 | player=Player | |
1783 | ch=Character | |
1784 | MMouse=mouse | |
1785 | end | |
1786 | ||
1787 | function ds(mouse) | |
1788 | end | |
1789 | ||
1790 | Bin.Selected:connect(s) | |
1791 | Bin.Deselected:connect(ds) | |
1792 | print("Vanguard Gauntlet loaded.") | |
1793 | ||
1794 | local Anim="Idle" | |
1795 | local idleanim=0 | |
1796 | local idleanim2=false | |
1797 | while true do | |
1798 | swait() | |
1799 | local torvel=(RootPart.Velocity*Vector3.new(1,0,1)).magnitude | |
1800 | if equipped==true then | |
1801 | if idleanim>=0.5 then | |
1802 | idleanim2=true | |
1803 | elseif idleanim<=0 then | |
1804 | idleanim2=false | |
1805 | end | |
1806 | if idleanim2==false then | |
1807 | idleanim=idleanim+0.002 | |
1808 | else | |
1809 | idleanim=idleanim-0.002 | |
1810 | end | |
1811 | if bladeattack==false then | |
1812 | brefwld.C0=clerp(brefwld.C0,euler(0,0,0)*cf(0,-2+idleanim,0),.4) | |
1813 | bwld1.C0=clerp(bwld1.C0,euler(0,0,0)*cf(2,-0.6,-2),.4) | |
1814 | bwld7.C0=clerp(bwld7.C0,euler(0,0,0)*cf(0,-0.6,-2),.4) | |
1815 | bwld13.C0=clerp(bwld13.C0,euler(0,0,0)*cf(-2,-0.6,-2),.4) | |
1816 | bwld2.C0=clerp(bwld2.C0,euler(3.14,-2-(idleanim/2),1.57-0.4)*cf(0,0,0),.4) | |
1817 | bwld8.C0=clerp(bwld8.C0,euler(3.14,-2-(idleanim/2),1.57)*cf(0,0,0),.4) | |
1818 | bwld14.C0=clerp(bwld14.C0,euler(3.14,-2-(idleanim/2),1.57+0.4)*cf(0,0,0),.4) | |
1819 | end | |
1820 | if RootPart.Velocity.y > 2 then | |
1821 | Anim="Jump" | |
1822 | if changetarget==false and bladeattack==false then | |
1823 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0.1,0,0),.2) | |
1824 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(-0.4,0,0),.2) | |
1825 | RH.C0=clerp(RH.C0,cf(1,-0.5,-1)*euler(-0.5,1.57,0),.2) | |
1826 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(-0.7,-1.57,0),.2) | |
1827 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-0.2,0,0.3),.2) | |
1828 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-0.2,0,-0.3),.2) | |
1829 | end | |
1830 | elseif RootPart.Velocity.y < -2 then | |
1831 | Anim="Fall" | |
1832 | if changetarget==false and bladeattack==false then | |
1833 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(-0.1,0,0),.2) | |
1834 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0.4,0,0),.2) | |
1835 | RH.C0=clerp(RH.C0,cf(1,-1,0)*euler(0.4,1.57,0),.2) | |
1836 | LH.C0=clerp(LH.C0,cf(-1,-1,0)*euler(-0.2,-1.57,0),.2) | |
1837 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0.4,0,0.1),.2) | |
1838 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0.4,0,-0.1),.2) | |
1839 | end | |
1840 | elseif torvel<1 then | |
1841 | Anim="Idle" | |
1842 | --idleanim=idleanim+0.005 | |
1843 | --[[if idleanim>=0.5 then | |
1844 | idleanim=0 | |
1845 | end]] | |
1846 | RH.C0=clerp(RH.C0,RHC0,.2) | |
1847 | LH.C0=clerp(LH.C0,LHC0,.2) | |
1848 | --[[RH.C0=RHC0 | |
1849 | RH.C1=RHC1 | |
1850 | LH.C0=LHC0 | |
1851 | LH.C1=LHC1]] | |
1852 | if changetarget==false and bladeattack==false then | |
1853 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.2) | |
1854 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0,0,0),.2) | |
1855 | end | |
1856 | if aimcannon==false and attack==false then | |
1857 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(idleanim,0,0.5-idleanim),.2) | |
1858 | end | |
1859 | if aimrailgun==false and attack==false then | |
1860 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(idleanim,0,-0.5+idleanim),.2) | |
1861 | end | |
1862 | --elseif torvel>=22 then | |
1863 | elseif torvel>2 and torvel<22 then | |
1864 | Anim="Walk" | |
1865 | if changetarget==false and bladeattack==false then | |
1866 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0),.2) | |
1867 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0,0,0),.2) | |
1868 | end | |
1869 | --RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0,0,0.5),.4) | |
1870 | if aimcannon==false and changetarget==false and bladeattack==false then | |
1871 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-0.5,0,0),.2) | |
1872 | end | |
1873 | if aimrailgun==false and changetarget==false and bladeattack==false then | |
1874 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-0.5,0,0),.2) | |
1875 | end | |
1876 | elseif torvel>=22 then | |
1877 | --elseif torvel>2 and torvel<22 then | |
1878 | Anim="Run" | |
1879 | --print("runnin'") | |
1880 | ||
1881 | if changetarget==false and bladeattack==false then | |
1882 | RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0.5,0,0),.3) | |
1883 | Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(-0.3,0,0),.3) | |
1884 | end | |
1885 | if aimcannon==false and changetarget==false and bladeattack==false then | |
1886 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-1,0,0),.3) | |
1887 | end | |
1888 | if aimrailgun==false and changetarget==false and bladeattack==false then | |
1889 | LW.C0=clerp(LW.C0,cf(-1,0.5,-0.5)*euler(1.57,0,1),.3) | |
1890 | end | |
1891 | end | |
1892 | end | |
1893 | --[[if torvel<19 then | |
1894 | Anim="Walk" | |
1895 | coroutine.resume(coroutine.create(function() | |
1896 | for i=0,1,0.1 do | |
1897 | swait() | |
1898 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-0.2,0,0),.4) | |
1899 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(-0.2,0,0),.4) | |
1900 | end | |
1901 | end)) | |
1902 | elseif torvel<1 then | |
1903 | Anim="Idle" | |
1904 | coroutine.resume(coroutine.create(function() | |
1905 | for i=0,1,0.1 do | |
1906 | swait() | |
1907 | RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(0,0,0.5),.4) | |
1908 | LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*euler(0,0,-0.5),.4) | |
1909 | end | |
1910 | end)) | |
1911 | end]] | |
1912 | --[[if equipped==true and bladeattack==false then | |
1913 | brefwld.C0=clerp(brefwld.C0,euler(0,0,circle)*cf(0,-2,-2),.4) | |
1914 | circle=circle-0.1 | |
1915 | end]] | |
1916 | if #Effects>0 then | |
1917 | --table.insert(Effects,{prt,"Block1",delay}) | |
1918 | for e=1,#Effects do | |
1919 | if Effects[e]~=nil then | |
1920 | --for j=1,#Effects[e] do | |
1921 | local Thing=Effects[e] | |
1922 | if Thing~=nil then | |
1923 | local Part=Thing[1] | |
1924 | local Mode=Thing[2] | |
1925 | local Delay=Thing[3] | |
1926 | local IncX=Thing[4] | |
1927 | local IncY=Thing[5] | |
1928 | local IncZ=Thing[6] | |
1929 | if Thing[1].Transparency<=1 then | |
1930 | if Thing[2]=="Block1" then | |
1931 | Thing[1].CFrame=Thing[1].CFrame*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50)) | |
1932 | Mesh=Thing[1].Mesh | |
1933 | Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6]) | |
1934 | Thing[1].Transparency=Thing[1].Transparency+Thing[3] | |
1935 | elseif Thing[2]=="Cylinder" then | |
1936 | --local TheCF=Thing[1].CFrame | |
1937 | --Thing[1].CFrame=TheCF | |
1938 | Mesh=Thing[1].Mesh | |
1939 | Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6]) | |
1940 | Thing[1].Transparency=Thing[1].Transparency+Thing[3] | |
1941 | elseif Thing[2]=="Elec" then | |
1942 | Mesh=Thing[1].Mesh | |
1943 | Mesh.Scale=Mesh.Scale+vt(Thing[7],Thing[8],Thing[9]) | |
1944 | --Thing[3]=Thing[3]+Delay | |
1945 | Thing[1].Transparency=Thing[1].Transparency+Thing[3] | |
1946 | --print(Thing[1].Transparency) | |
1947 | ||
1948 | --[[local prt=part(3,workspace,0,0,BrickColor.new("White"),"Part",vt(1,1,1)) | |
1949 | prt.Anchored=true | |
1950 | game:GetService("Debris"):AddItem(prt,2) | |
1951 | xval=math.random() | |
1952 | yval=math.random() | |
1953 | zval=math.random() | |
1954 | msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(xval,yval,zval)) | |
1955 | Effects[#Effects+1]={prt,"Elec",0.05,x,y,z,xval,yval,zval}]] | |
1956 | --[[coroutine.resume(coroutine.create(function(Part,Mesh,Frame,xvaal,yvaal,zvaal) | |
1957 | Part.CFrame=cf(Frame)*cf(math.random(-x,x),math.random(-y,y),math.random(-z,z)) | |
1958 | for i=0,1,0.05 do | |
1959 | swait() | |
1960 | xvaal=xvaal-0.1 | |
1961 | yvaal=yvaal-0.1 | |
1962 | zvaal=zvaal-0.1 | |
1963 | Mesh.Scale=vt(xvaal,yvaal,zvaal) | |
1964 | Part.Transparency=i | |
1965 | end | |
1966 | Part.Parent=nil | |
1967 | end),prt,msh,cff,xval,yval,zval)]] | |
1968 | end | |
1969 | else | |
1970 | Part.Parent=nil | |
1971 | table.remove(Effects,e) | |
1972 | end | |
1973 | end | |
1974 | --end | |
1975 | end | |
1976 | end | |
1977 | end | |
1978 | end | |
1979 | --[[ | |
1980 | Copyrighted (C) Fenrier 2014 | |
1981 | ]] |