SHOW:
|
|
- or go back to the newest paste.
1 | --https://github.com/Mokiros/roblox-FE-compatibility | |
2 | - | Player = game.Players.LocalPlayer |
2 | + | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end |
3 | local Player,game,owner = owner,game | |
4 | local RealPlayer = Player | |
5 | do print("FE Compatibility code V2 by Mokiros")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end Player = game.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 | PlayerGui = Player.PlayerGui | |
17 | Backpack = Player.Backpack | |
18 | Torso = Character.Torso | |
19 | Head = Character.Head | |
20 | Humanoid = Character.Humanoid | |
21 | LeftArm = Character["Left Arm"] | |
22 | LeftLeg = Character["Left Leg"] | |
23 | RightArm = Character["Right Arm"] | |
24 | RightLeg = Character["Right Leg"] | |
25 | LS = Torso["Left Shoulder"] | |
26 | RS = Torso["Right Shoulder"] | |
27 | Neck = Torso.Neck | |
28 | attacktype = 1 | |
29 | vt = Vector3.new | |
30 | cf = CFrame.new | |
31 | euler = CFrame.fromEulerAnglesXYZ | |
32 | angles = CFrame.Angles | |
33 | necko = cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
34 | necko2 = cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
35 | LHC0 = cf(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
36 | LHC1 = cf(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
37 | RHC0 = cf(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
38 | RHC1 = cf(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
39 | RootPart = Character.HumanoidRootPart | |
40 | RootJoint = RootPart.RootJoint | |
41 | RootCF = euler(-1.57, 0, 3.14) | |
42 | attack = false | |
43 | equipped = false | |
44 | local Anim = "Idle" | |
45 | local Effects = {} | |
46 | cam = workspace.CurrentCamera | |
47 | ZTarget = nil | |
48 | RocketTarget = nil | |
49 | local RbxUtility = LoadLibrary("RbxUtility") | |
50 | local Create = RbxUtility.Create | |
51 | local m = Create("Model"){ | |
52 | Parent = Character, | |
53 | Name = "WeaponModel", | |
54 | } | |
55 | mouse = Player:GetMouse() | |
56 | RSH = Torso["Right Shoulder"] | |
57 | LSH = Torso["Left Shoulder"] | |
58 | RHP = Character.Torso["Right Hip"] | |
59 | LHP = Character.Torso["Left Hip"] | |
60 | ||
61 | function NoOutline(Part) | |
62 | Part.TopSurface, Part.BottomSurface, Part.LeftSurface, Part.RightSurface, Part.FrontSurface, Part.BackSurface = 10, 10, 10, 10, 10, 10 | |
63 | end | |
64 | function swait(num) | |
65 | if num == 0 or num == nil then | |
66 | game:service'RunService'.Heartbeat:wait() | |
67 | else | |
68 | for i = 0, num do | |
69 | game:service'RunService'.Heartbeat:wait() | |
70 | end | |
71 | end | |
72 | end | |
73 | ||
74 | function nooutline(part) | |
75 | part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10 | |
76 | end | |
77 | ||
78 | function part(formfactor, parent, material, reflectance, transparency, brickcolor, name, size) | |
79 | local fp = Create("Part"){ | |
80 | formFactor = formfactor, | |
81 | Parent = parent, | |
82 | Reflectance = reflectance, | |
83 | Transparency = transparency, | |
84 | CanCollide = false, | |
85 | Locked = true, | |
86 | BrickColor = BrickColor.new(tostring(brickcolor)), | |
87 | Name = name, | |
88 | Size = size, | |
89 | Position = Character.Torso.Position, | |
90 | Material = material, | |
91 | } | |
92 | nooutline(fp) | |
93 | return fp | |
94 | end | |
95 | ||
96 | function mesh(Mesh, part, meshtype, meshid, offset, scale) | |
97 | local Msh = Create(Mesh){ | |
98 | Parent = part, | |
99 | Offset = offset, | |
100 | Scale = scale, | |
101 | } | |
102 | if Mesh == "SpecialMesh" then | |
103 | Msh.MeshType = meshtype | |
104 | Msh.MeshId = meshid | |
105 | end | |
106 | return Msh | |
107 | end | |
108 | ||
109 | function weld(parent, part0, part1, c0, c1) | |
110 | local Weld = Create("Weld"){ | |
111 | Parent = parent, | |
112 | Part0 = part0, | |
113 | Part1 = part1, | |
114 | C0 = c0, | |
115 | C1 = c1, | |
116 | } | |
117 | return Weld | |
118 | end | |
119 | ||
120 | ||
121 | local function CFrameFromTopBack(at, top, back) | |
122 | local right = top:Cross(back) | |
123 | return CFrame.new(at.x, at.y, at.z, | |
124 | right.x, top.x, back.x, | |
125 | right.y, top.y, back.y, | |
126 | right.z, top.z, back.z) | |
127 | end | |
128 | ||
129 | function Triangle(a, b, c) | |
130 | local edg1 = (c - a):Dot((b - a).unit) | |
131 | local edg2 = (a - b):Dot((c - b).unit) | |
132 | local edg3 = (b - c):Dot((a - c).unit) | |
133 | if edg1 <= (b - a).magnitude and edg1 >= 0 then | |
134 | a, b, c = a, b, c | |
135 | elseif edg2 <= (c - b).magnitude and edg2 >= 0 then | |
136 | a, b, c = b, c, a | |
137 | elseif edg3 <= (a - c).magnitude and edg3 >= 0 then | |
138 | a, b, c = c, a, b | |
139 | else | |
140 | assert(false, "unreachable") | |
141 | end | |
142 | ||
143 | local len1 = (c - a):Dot((b - a).unit) | |
144 | local len2 = (b - a).magnitude - len1 | |
145 | local width = (a + (b - a).unit * len1 - c).magnitude | |
146 | ||
147 | local maincf = CFrameFromTopBack(a, (b - a):Cross(c - b).unit, -(b - a).unit) | |
148 | ||
149 | local list = {} | |
150 | ||
151 | local Color = BrickColor.new("Dark stone grey") | |
152 | ||
153 | if len1 > 0.01 then | |
154 | local w1 = Create('WedgePart', m){ | |
155 | Material = "SmoothPlastic", | |
156 | FormFactor = 'Custom', | |
157 | BrickColor = Color, | |
158 | Transparency = 0, | |
159 | Reflectance = 0, | |
160 | Material = "SmoothPlastic", | |
161 | CanCollide = false, | |
162 | Anchored = true, | |
163 | Parent = workspace, | |
164 | Transparency = 0.3, | |
165 | } | |
166 | game:GetService("Debris"):AddItem(w1, 5) | |
167 | NoOutline(w1) | |
168 | local sz = Vector3.new(0.2, width, len1) | |
169 | w1.Size = sz | |
170 | local sp = Create("SpecialMesh"){ | |
171 | Parent = w1, | |
172 | MeshType = "Wedge", | |
173 | Scale = Vector3.new(0, 1, 1) * sz / w1.Size, | |
174 | } | |
175 | w1:BreakJoints() | |
176 | table.insert(Effects, { | |
177 | w1, | |
178 | "Disappear", | |
179 | .03 | |
180 | }) | |
181 | w1.CFrame = maincf * CFrame.Angles(math.pi, 0, math.pi / 2) * CFrame.new(0, width / 2, len1 / 2) | |
182 | table.insert(list, w1) | |
183 | end | |
184 | if len2 > 0.01 then | |
185 | local w2 = Create('WedgePart', m){ | |
186 | Material = "SmoothPlastic", | |
187 | FormFactor = 'Custom', | |
188 | BrickColor = Color, | |
189 | Transparency = 0, | |
190 | Reflectance = 0, | |
191 | Material = "SmoothPlastic", | |
192 | CanCollide = false, | |
193 | Anchored = true, | |
194 | Parent = workspace, | |
195 | Transparency = 0.3, | |
196 | } | |
197 | game:GetService("Debris"):AddItem(w2, 5) | |
198 | NoOutline(w2) | |
199 | local sz = Vector3.new(0.2, width, len2) | |
200 | w2.Size = sz | |
201 | local sp = Create("SpecialMesh"){ | |
202 | Parent = w2, | |
203 | MeshType = "Wedge", | |
204 | Scale = Vector3.new(0, 1, 1) * sz / w2.Size, | |
205 | } | |
206 | w2:BreakJoints() | |
207 | table.insert(Effects, { | |
208 | w2, | |
209 | "Disappear", | |
210 | .03 | |
211 | }) | |
212 | w2.CFrame = maincf * CFrame.Angles(math.pi, math.pi, -math.pi / 2) * CFrame.new(0, width / 2, -len1 - len2 / 2) | |
213 | table.insert(list, w2) | |
214 | end | |
215 | return unpack(list) | |
216 | end | |
217 | ||
218 | function so(id, par, vol, pit) | |
219 | coroutine.resume(coroutine.create(function() | |
220 | local sou = Instance.new("Sound", par or workspace) | |
221 | sou.Volume = vol | |
222 | sou.Pitch = pit or 1 | |
223 | sou.SoundId = id | |
224 | swait() | |
225 | sou:play() | |
226 | swait(6) | |
227 | sou:Remove() | |
228 | end)) | |
229 | end | |
230 | ||
231 | function clerp(a, b, t) | |
232 | ||
233 | local function QuaternionFromCFrame(cf) | |
234 | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() | |
235 | local trace = m00 + m11 + m22 | |
236 | if trace > 0 then | |
237 | local s = math.sqrt(1 + trace) | |
238 | local recip = 0.5 / s | |
239 | return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5 | |
240 | else | |
241 | local i = 0 | |
242 | if m11 > m00 then | |
243 | i = 1 | |
244 | end | |
245 | if m22 > (i == 0 and m00 or m11) then | |
246 | i = 2 | |
247 | end | |
248 | if i == 0 then | |
249 | local s = math.sqrt(m00 - m11 - m22 + 1) | |
250 | local recip = 0.5 / s | |
251 | return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip | |
252 | elseif i == 1 then | |
253 | local s = math.sqrt(m11 - m22 - m00 + 1) | |
254 | local recip = 0.5 / s | |
255 | return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip | |
256 | elseif i == 2 then | |
257 | local s = math.sqrt(m22 - m00 - m11 + 1) | |
258 | local recip = 0.5 / s | |
259 | return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip | |
260 | end | |
261 | end | |
262 | end | |
263 | ||
264 | local function QuaternionToCFrame(px, py, pz, x, y, z, w) | |
265 | local xs, ys, zs = x + x, y + y, z + z | |
266 | local wx, wy, wz = w * xs, w * ys, w * zs | |
267 | local xx = x * xs | |
268 | local xy = x * ys | |
269 | local xz = x * zs | |
270 | local yy = y * ys | |
271 | local yz = y * zs | |
272 | local zz = z * zs | |
273 | 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)) | |
274 | end | |
275 | ||
276 | local function QuaternionSlerp(a, b, t) | |
277 | local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4] | |
278 | local startInterp, finishInterp; | |
279 | if cosTheta >= 0.0001 then | |
280 | if (1 - cosTheta) > 0.0001 then | |
281 | local theta = math.acos(cosTheta) | |
282 | local invSinTheta = 1 / math.sin(theta) | |
283 | startInterp = math.sin((1 - t) * theta) * invSinTheta | |
284 | finishInterp = math.sin(t * theta) * invSinTheta | |
285 | else | |
286 | startInterp = 1 - t | |
287 | finishInterp = t | |
288 | end | |
289 | else | |
290 | if (1 + cosTheta) > 0.0001 then | |
291 | local theta = math.acos(-cosTheta) | |
292 | local invSinTheta = 1 / math.sin(theta) | |
293 | startInterp = math.sin((t - 1) * theta) * invSinTheta | |
294 | finishInterp = math.sin(t * theta) * invSinTheta | |
295 | else | |
296 | startInterp = t - 1 | |
297 | finishInterp = t | |
298 | end | |
299 | end | |
300 | 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 | |
301 | end | |
302 | ||
303 | local qa = { | |
304 | QuaternionFromCFrame(a) | |
305 | } | |
306 | local qb = { | |
307 | QuaternionFromCFrame(b) | |
308 | } | |
309 | local ax, ay, az = a.x, a.y, a.z | |
310 | local bx, by, bz = b.x, b.y, b.z | |
311 | ||
312 | local _t = 1 - t | |
313 | return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t)) | |
314 | end | |
315 | ||
316 | function rayCast(Pos, Dir, Max, Ignore) | |
317 | return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore) | |
318 | end | |
319 | ||
320 | Damagefunc = function(Part, hit, minim, maxim, knockback, Type, Property, Delay, HitSound, HitPitch) | |
321 | if hit.Parent == nil then | |
322 | return | |
323 | end | |
324 | local h = hit.Parent:FindFirstChild("Humanoid") | |
325 | for _, v in pairs(hit.Parent:children()) do | |
326 | if v:IsA("Humanoid") then | |
327 | h = v | |
328 | end | |
329 | end | |
330 | if h ~= nil and hit.Parent.Name ~= Character.Name and hit.Parent:FindFirstChild("Torso") ~= nil then | |
331 | if hit.Parent:findFirstChild("DebounceHit") ~= nil then | |
332 | if hit.Parent.DebounceHit.Value == true then | |
333 | return | |
334 | end | |
335 | end | |
336 | if h.MaxHealth >= math.huge then | |
337 | hit:BreakJoints() | |
338 | end | |
339 | local c = Create("ObjectValue"){ | |
340 | Name = "creator", | |
341 | Value = game:service("Players").LocalPlayer, | |
342 | Parent = h, | |
343 | } | |
344 | game:GetService("Debris"):AddItem(c, .5) | |
345 | if HitSound ~= nil and HitPitch ~= nil then | |
346 | so(HitSound, hit, 1, HitPitch) | |
347 | end | |
348 | local Damage = math.random(minim, maxim) | |
349 | local blocked = false | |
350 | local block = hit.Parent:findFirstChild("Block") | |
351 | if block ~= nil then | |
352 | if block.className == "IntValue" then | |
353 | if block.Value > 0 then | |
354 | blocked = true | |
355 | block.Value = block.Value - 1 | |
356 | print(block.Value) | |
357 | end | |
358 | end | |
359 | end | |
360 | if blocked == false then | |
361 | h.Health = h.Health - Damage | |
362 | ShowDamage((Part.CFrame * CFrame.new(0, 0, (Part.Size.Z / 2)).p + Vector3.new(0, 1.5, 0)), -Damage, 1.5, Part.BrickColor.Color, Handle.BrickColor.Color) | |
363 | else | |
364 | h.Health = h.Health - (Damage / 2) | |
365 | ShowDamage((Part.CFrame * CFrame.new(0, 0, (Part.Size.Z / 2)).p + Vector3.new(0, 1.5, 0)), -Damage, 1.5, Part.BrickColor.Color, Handle.BrickColor.Color) | |
366 | end | |
367 | if Type == "Knockdown" then | |
368 | local hum = hit.Parent.Humanoid | |
369 | hum.PlatformStand = true | |
370 | coroutine.resume(coroutine.create(function(HHumanoid) | |
371 | swait(1) | |
372 | HHumanoid.PlatformStand = false | |
373 | end), hum) | |
374 | local angle = (hit.Position - (Property.Position + Vector3.new(0, 0, 0))).unit | |
375 | local bodvol = Create("BodyVelocity"){ | |
376 | velocity = angle * knockback, | |
377 | P = 5000, | |
378 | maxForce = Vector3.new(8e+003, 8e+003, 8e+003), | |
379 | Parent = hit, | |
380 | } | |
381 | local rl = Create("BodyAngularVelocity"){ | |
382 | P = 3000, | |
383 | maxTorque = Vector3.new(500000, 500000, 500000) * 50000000000000, | |
384 | angularvelocity = Vector3.new(math.random(-10, 10), math.random(-10, 10), math.random(-10, 10)), | |
385 | Parent = hit, | |
386 | } | |
387 | game:GetService("Debris"):AddItem(bodvol, .5) | |
388 | game:GetService("Debris"):AddItem(rl, .5) | |
389 | elseif Type == "Normal" then | |
390 | local vp = Create("BodyVelocity"){ | |
391 | P = 500, | |
392 | maxForce = Vector3.new(math.huge, 0, math.huge), | |
393 | velocity = Property.CFrame.lookVector * knockback + Property.Velocity / 1.05, | |
394 | } | |
395 | if knockback > 0 then | |
396 | vp.Parent = hit.Parent.Torso | |
397 | end | |
398 | game:GetService("Debris"):AddItem(vp, .5) | |
399 | elseif Type == "Up" then | |
400 | local bodyVelocity = Create("BodyVelocity"){ | |
401 | velocity = vt(0, 20, 0), | |
402 | P = 5000, | |
403 | maxForce = Vector3.new(8e+003, 8e+003, 8e+003), | |
404 | Parent = hit, | |
405 | } | |
406 | game:GetService("Debris"):AddItem(bodyVelocity, .5) | |
407 | elseif Type == "Snare" then | |
408 | local bp = Create("BodyPosition"){ | |
409 | P = 2000, | |
410 | D = 100, | |
411 | maxForce = Vector3.new(math.huge, math.huge, math.huge), | |
412 | position = hit.Parent.Torso.Position, | |
413 | Parent = hit.Parent.Torso, | |
414 | } | |
415 | game:GetService("Debris"):AddItem(bp, 1) | |
416 | elseif Type == "Freeze" then | |
417 | local BodPos = Create("BodyPosition"){ | |
418 | P = 50000, | |
419 | D = 1000, | |
420 | maxForce = Vector3.new(math.huge, math.huge, math.huge), | |
421 | position = hit.Parent.Torso.Position, | |
422 | Parent = hit.Parent.Torso, | |
423 | } | |
424 | local BodGy = Create("BodyGyro") { | |
425 | maxTorque = Vector3.new(4e+005, 4e+005, 4e+005) * math.huge , | |
426 | P = 20e+003, | |
427 | Parent = hit.Parent.Torso, | |
428 | cframe = hit.Parent.Torso.CFrame, | |
429 | } | |
430 | hit.Parent.Torso.Anchored = true | |
431 | coroutine.resume(coroutine.create(function(Part) | |
432 | swait(1.5) | |
433 | Part.Anchored = false | |
434 | end), hit.Parent.Torso) | |
435 | game:GetService("Debris"):AddItem(BodPos, 3) | |
436 | game:GetService("Debris"):AddItem(BodGy, 3) | |
437 | end | |
438 | local debounce = Create("BoolValue"){ | |
439 | Name = "DebounceHit", | |
440 | Parent = hit.Parent, | |
441 | Value = true, | |
442 | } | |
443 | game:GetService("Debris"):AddItem(debounce, Delay) | |
444 | c = Instance.new("ObjectValue") | |
445 | c.Name = "creator" | |
446 | c.Value = Player | |
447 | c.Parent = h | |
448 | game:GetService("Debris"):AddItem(c, .5) | |
449 | end | |
450 | end | |
451 | ||
452 | function ShowDamage(Pos, Text, Time, Color, Color2) | |
453 | local Rate = (1 / 30) | |
454 | local Pos = (Pos or Vector3.new(0, 0, 0)) | |
455 | local Text = (Text or "") | |
456 | local Time = (Time or 2) | |
457 | local Color = (Color or Color3.new(1, 0, 0)) | |
458 | local EffectPart = part("Custom", workspace, "SmoothPlastic", 0, 1, BrickColor.new(Color), "Effect", vt(0, 0, 0)) | |
459 | EffectPart.Anchored = true | |
460 | local BillboardGui = Create("BillboardGui"){ | |
461 | Size = UDim2.new(3, 0, 3, 0), | |
462 | Adornee = EffectPart, | |
463 | Parent = EffectPart, | |
464 | } | |
465 | local TextLabel = Create("TextLabel"){ | |
466 | BackgroundTransparency = 1, | |
467 | Size = UDim2.new(1, 0, 1, 0), | |
468 | Text = Text, | |
469 | TextColor3 = Color, | |
470 | TextScaled = true, | |
471 | Font = Enum.Font.ArialBold, | |
472 | FontSize = Enum.FontSize.Size10, | |
473 | TextStrokeColor3 = Color2, | |
474 | TextStrokeTransparency = 0.8, | |
475 | Parent = BillboardGui, | |
476 | } | |
477 | game.Debris:AddItem(EffectPart, (Time + 0.1)) | |
478 | EffectPart.Parent = game:GetService("Workspace") | |
479 | delay(0, function() | |
480 | local Frames = (Time / Rate) | |
481 | for Frame = 1, Frames do | |
482 | wait(Rate) | |
483 | local Percent = (Frame / Frames) | |
484 | EffectPart.CFrame = CFrame.new(Pos) + Vector3.new(0, Percent, 0) | |
485 | TextLabel.TextTransparency = Percent | |
486 | end | |
487 | if EffectPart and EffectPart.Parent then | |
488 | EffectPart:Destroy() | |
489 | end | |
490 | end) | |
491 | end | |
492 | ||
493 | Handle=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Handle",Vector3.new(0.280000031, 0.699999988, 0.280000001)) | |
494 | Handleweld=weld(m,Character["Right Arm"],Handle,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.0860519409, -0.159469604, 1.00696373, 1, -1.72803976e-011, 1.90765604e-006, 1.90764786e-006, 4.44081707e-006, -1, 9.09494702e-012, 0.999999881, 4.44081707e-006)) | |
495 | FakeHandle=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","FakeHandle",Vector3.new(0.280000031, 0.699999988, 0.280000001)) | |
496 | FakeHandleweld=weld(m,Handle,FakeHandle,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-1.90734863e-006, 0.0707168579, 0.0574593544, 1, -8.18545232e-012, 2.86099269e-013, -8.18545232e-012, 1, 4.54747351e-013, 2.86099269e-013, 4.54747351e-013, 1)) | |
497 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003)) | |
498 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.000375747681, -1.18781972, 0.839702606, -1, -1.02313925e-006, -2.56240446e-006, 2.56240173e-006, 1.79690323e-006, -1, 1.02317256e-006, -1, -1.79690414e-006)) | |
499 | mesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(0.699999988, 0.699999988, 0.699999988)) | |
500 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.200000003, 0.420000017, 0.200000003)) | |
501 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.889633477, -0.979663849, 0.0548973083, -0.258811921, -5.54403186e-006, -0.96592772, -3.15453076e-006, 1, -4.89435752e-006, 0.96592778, 1.78029984e-006, -0.258811951)) | |
502 | mesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=111896510",Vector3.new(0, 0, 0),Vector3.new(0.349999994, 0.349999994, 0.349999994)) | |
503 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.200000003, 0.200000003, 0.280000001)) | |
504 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.279872894, 0.209986687, -1.33514404e-005, -3.935309e-006, 1, -2.90573007e-006, 1.08481819e-008, 2.90573598e-006, 1, 1, 3.93527625e-006, -1.08583693e-008)) | |
505 | mesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=3270017",Vector3.new(0, 0, 0),Vector3.new(0.519399941, 0.557200074, 1.74439991)) | |
506 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.200000003, 0.420000017, 0.200000003)) | |
507 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.889616966, -0.979663849, -0.0549716949, 0.258811742, -5.84206009e-006, -0.96592778, -1.50227504e-006, 1, -6.45063938e-006, 0.965927839, 3.12056136e-006, 0.258811772)) | |
508 | mesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=111896510",Vector3.new(0, 0, 0),Vector3.new(0.349999994, 0.349999994, 0.349999994)) | |
509 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.420000046, 0.280000061, 0.560000002)) | |
510 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.419868469, 7.62939453e-006, 2.7179718e-005, 3.83001225e-006, -1, 2.54809993e-006, 1, 3.82997496e-006, 3.03872399e-010, -3.12454534e-010, 2.54810584e-006, 1)) | |
511 | mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1)) | |
512 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.280000031, 0.700000048, 0.280000001)) | |
513 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-1.14440918e-005, 0.552843094, 0.296955109, 1, -2.22826202e-011, 1.80189787e-011, -7.95807864e-013, 0.707115233, -0.707098365, -1.73940862e-011, 0.707098365, 0.707115233)) | |
514 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.420000046, 0.28700006, 0.280000031)) | |
515 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.41986084, 0.00234603882, 2.14576721e-005, 3.74060505e-006, -1, 2.30967612e-006, 1, 3.74057413e-006, -7.42010826e-008, 7.41938067e-008, 2.30968203e-006, 1)) | |
516 | mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1)) | |
517 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.287, 0.560000062, 0.200000003)) | |
518 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.00273132324, 0.622810364, 0.296985626, 1, -2.22826202e-011, 1.80189787e-011, -7.95807864e-013, 0.707115233, -0.707098365, -1.73940862e-011, 0.707098365, 0.707115233)) | |
519 | mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 0.699999988)) | |
520 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.420000046, 0.280000061, 0.420000017)) | |
521 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.839817047, -1.90734863e-005, -0.489821672, 3.8300077e-006, -1, 2.53319945e-006, 1, 3.82997496e-006, 3.04327147e-010, -3.12426113e-010, 2.53320582e-006, 1)) | |
522 | mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1)) | |
523 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.420000046, 0.28700006, 0.280000031)) | |
524 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.839794159, 0.00254631042, -0.49509263, 3.8300077e-006, -1, 2.53319945e-006, 1, 3.82997496e-006, 3.04327147e-010, -3.12426113e-010, 2.53320582e-006, 1)) | |
525 | mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1)) | |
526 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.280000031, 0.420000046, 0.980000079)) | |
527 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(1.90734863e-006, -0.559818268, 0.0699512959, 1, -2.04636308e-011, 7.38572398e-013, -1.63709046e-011, 1, 2.6823227e-007, 7.82044568e-013, -2.68225904e-007, 1)) | |
528 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.280000001)) | |
529 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.279872894, 0.209986687, -1.33514404e-005, -3.935309e-006, 1, -2.90573007e-006, 1.08481819e-008, 2.90573598e-006, 1, 1, 3.93527625e-006, -1.08583693e-008)) | |
530 | mesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=3270017",Vector3.new(0, 0, 0),Vector3.new(0.491399914, 0.557200074, 1.74439991)) | |
531 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.280000031, 0.200000003, 0.560000062)) | |
532 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-2.0980835e-005, -0.419818878, 0.839810848, 1, -2.13731255e-011, -1.65118821e-011, -1.54614099e-011, 1, 2.62222466e-006, 1.80325338e-011, -2.62221829e-006, 1)) | |
533 | mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 1)) | |
534 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.420000017, 0.420000017, 0.560000002)) | |
535 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559810638, -0.769824028, -3.43322754e-005, 1.45437184e-007, -1, -1.29630371e-006, -2.08639904e-007, 1.29629734e-006, -1, 1, 1.45400691e-007, -2.08638184e-007)) | |
536 | mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1)) | |
537 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.280000061, 0.280000061, 0.280000031)) | |
538 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.209846497, -3.81469727e-006, 0.559957266, 1.49184416e-008, -1, -6.10877123e-007, 1, 1.48816071e-008, 2.96593194e-010, -2.95063474e-010, -6.10870757e-007, 1)) | |
539 | mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1)) | |
540 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.287, 0.840000033, 0.200000003)) | |
541 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.00215530396, -0.0698623657, 0.000190734863, 1, -2.22826202e-011, 1.80189787e-011, -1.43245416e-011, 1, 2.69661223e-006, -1.68107646e-011, -2.69660586e-006, 1)) | |
542 | mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 0.699999988)) | |
543 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.287, 0.200000003, 0.560000002)) | |
544 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.0021572113, -0.559833527, -0.0698022842, 1, -5.50244295e-011, 1.91965506e-011, -4.70663508e-011, 1, 2.69661314e-006, -1.56331059e-011, -2.69659495e-006, 1)) | |
545 | mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 1)) | |
546 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.287, 0.427000016, 0.200000003)) | |
547 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.000122070313, -0.560840607, 0.27643466, 1, -2.22826202e-011, 1.80189787e-011, -1.43245416e-011, 1, 8.19589786e-007, -1.68107889e-011, -8.1958342e-007, 1)) | |
548 | mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 0.699999988)) | |
549 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.420000017, 0.420000017, 0.280000031)) | |
550 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.55978775, -2.44724131, -0.000165939331, 1.45490276e-007, -1, -2.49798723e-005, -2.08999595e-007, 2.49798668e-005, -1, 1, 1.45458671e-007, -2.08994436e-007)) | |
551 | mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1)) | |
552 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.420000017, 0.280000001, 0.560000062)) | |
553 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.559822083, 0, -0.419999123, 5.95878191e-008, 1, 1.94764652e-007, -1, 5.9624881e-008, 3.44258311e-008, 3.44273339e-008, -1.94758286e-007, 1)) | |
554 | mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1)) | |
555 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.280000031, 0.200000003, 0.200000003)) | |
556 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0, 0.279838562, 0.21000886, 1, 4.46839294e-008, 1.44186561e-006, 4.47196271e-008, -1, 7.78919912e-007, 1.44186413e-006, -7.78926278e-007, -1)) | |
557 | mesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 0.699999988)) | |
558 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.420000017, 0.560000002, 0.420000017)) | |
559 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559791565, -0.55984664, 3.81469727e-005, 1.4543707e-007, -1, -5.08004541e-006, -2.08696321e-007, 5.08003723e-006, -1, 1, 1.45401373e-007, -2.08694047e-007)) | |
560 | mesh("SpecialMesh",Part,Enum.MeshType.Sphere,"",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1)) | |
561 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.280000031, 0.200000003, 0.200000003)) | |
562 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(5.91278076e-005, 0.279800415, 1.04951167, -1, -2.53198436e-007, 1.49545034e-008, 2.53235044e-007, -1, -7.584179e-006, 1.49579638e-008, -7.58417036e-006, 1)) | |
563 | mesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 0.699999988)) | |
564 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.420000017, 0.560000062, 0.200000003)) | |
565 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559768677, -2.37841272, -0.000438690186, 1.45475724e-007, -1, -2.01288749e-005, -2.08974669e-007, 2.01288676e-005, -1, 1, 1.45443096e-007, -2.08970206e-007)) | |
566 | mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 0.699999988)) | |
567 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.420000017, 0.280000001, 0.420000017)) | |
568 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.55979538, -0.979748011, 7.62939453e-006, 1.45442073e-007, -1, -6.30070645e-006, -2.08722611e-007, 6.30070008e-006, -1, 1, 1.45406489e-007, -2.08720166e-007)) | |
569 | mesh("SpecialMesh",Part,Enum.MeshType.Sphere,"",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1)) | |
570 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.280000031, 0.200000003, 0.560000002)) | |
571 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(1.90734863e-006, -0.27980423, 0.699883938, 1, -2.04636308e-011, 1.10889423e-012, -1.63709046e-011, 1, 2.11572933e-006, 4.11753964e-013, -2.11572296e-006, 1)) | |
572 | mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 1)) | |
573 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.280000031, 0.200000003, 0.560000062)) | |
574 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-3.24249268e-005, -0.699771881, 0.839804649, 1, -2.13731255e-011, -1.66693187e-011, -1.54614099e-011, 1, 4.23093024e-006, 1.81899929e-011, -4.23092433e-006, 1)) | |
575 | mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 1)) | |
576 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.280000031, 0.200000003, 0.200000003)) | |
577 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-4.76837158e-005, -0.559803009, 1.0495255, 1, -1.56887836e-011, 3.45319641e-011, -2.09183781e-011, 1, 5.48155458e-006, -3.30136751e-011, -5.48154867e-006, 1)) | |
578 | mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 0.699999988)) | |
579 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003)) | |
580 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.000427246094, -2.58794498, 0.839736938, -1, -1.49499328e-008, -2.52553122e-007, 2.52551388e-007, 1.52605935e-005, -1, 1.49906327e-008, -1, -1.52605971e-005)) | |
581 | mesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(0.699999988, 0.699999988, 0.699999988)) | |
582 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003)) | |
583 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.83972168, -2.44782782, -0.000438690186, 1.45468562e-007, -1, -2.04852658e-005, -2.09350546e-007, 2.04852604e-005, -1, 1, 1.45436047e-007, -2.09346027e-007)) | |
584 | mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.699999988, 0.699999988, 0.699999988)) | |
585 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003)) | |
586 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.000421524048, 2.30780578, 0.83972168, 1, 5.67174197e-007, 2.54727388e-006, -2.54726456e-006, -1.37063362e-005, 1, 5.67245934e-007, -1, -1.37063407e-005)) | |
587 | mesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(0.699999988, 0.699999988, 0.699999988)) | |
588 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003)) | |
589 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.00043296814, 2.30763364, -0.27973938, -1, 1.49386779e-008, 2.53097255e-007, 2.53098563e-007, -1.32949481e-005, 1, 1.49050265e-008, 1, 1.32949544e-005)) | |
590 | mesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(0.699999988, 0.699999988, 0.699999988)) | |
591 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003)) | |
592 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.279750824, 2.44781303, -0.000444412231, 1.45382273e-007, 1, 2.08481797e-005, -2.08853876e-007, -2.08481761e-005, 1, 1, -1.45423428e-007, 2.08852413e-007)) | |
593 | mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.699999988, 0.699999988, 0.699999988)) | |
594 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003)) | |
595 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.00043296814, -2.58781743, -0.279773712, 1, -5.67145435e-007, -2.54751899e-006, -2.54751376e-006, 1.19385704e-005, -1, 5.67138841e-007, 1, 1.19385777e-005)) | |
596 | mesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(0.699999988, 0.699999988, 0.699999988)) | |
597 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.231000006, 0.200000003, 0.280000031)) | |
598 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.560119629, -2.59035707, -0.000175476074, 3.96057294e-006, -1, -2.42740825e-005, -2.09122135e-007, 2.42740789e-005, -1, 1, 3.96054475e-006, -2.09025103e-007)) | |
599 | mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 1)) | |
600 | Barrel=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Barrel",Vector3.new(0.200000003, 0.200000003, 0.280000031)) | |
601 | Barrelweld=weld(m,FakeHandle,Barrel,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.562404633, -2.59142828, -0.000175476074, 3.96057203e-006, -1, -2.4095265e-005, -2.09117701e-007, 2.40952577e-005, -1, 1, 3.96054384e-006, -2.09021465e-007)) | |
602 | mesh("CylinderMesh",Barrel,"","",Vector3.new(0, 0, 0),Vector3.new(0.945000052, 0.699999988, 1)) | |
603 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.420000017, 0.200000003, 0.280000031)) | |
604 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559753418, -1.60731864, -0.000179290771, 1.45490958e-007, -1, -2.51584643e-005, -2.09002877e-007, 2.51584588e-005, -1, 1, 1.45459353e-007, -2.0899769e-007)) | |
605 | mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 1)) | |
606 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.420000017, 0.200000003, 0.280000031)) | |
607 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559776306, -2.16727662, -0.000164031982, 1.45485501e-007, -1, -2.33735591e-005, -2.08965247e-007, 2.33735518e-005, -1, 1, 1.45453555e-007, -2.08960316e-007)) | |
608 | mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 1)) | |
609 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.420000017, 0.420000046, 0.280000031)) | |
610 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559776306, -1.88730073, -0.000165939331, 1.45485956e-007, -1, -2.35518892e-005, -2.08967805e-007, 2.35518837e-005, -1, 1, 1.4545401e-007, -2.08962845e-007)) | |
611 | mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1)) | |
612 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.420000017, 0.280000061, 0.280000031)) | |
613 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559753418, -1.39711809, -0.000173568726, 1.45514491e-007, -1, -2.24795003e-005, -2.08946716e-007, 2.24794821e-005, -1, 1, 1.45416834e-007, -2.08939554e-007)) | |
614 | mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1)) | |
615 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.420000017, 0.420000046, 0.200000003)) | |
616 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559764862, -1.88847375, -0.000436782837, 1.45466288e-007, -1, -1.8521725e-005, -2.08988865e-007, 1.85217195e-005, -1, 1, 1.45433319e-007, -2.08984645e-007)) | |
617 | mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 0.699999988)) | |
618 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.420000017, 0.560000062, 0.200000003)) | |
619 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559757233, -1.39839482, -0.000442504883, 1.45464355e-007, -1, -1.69149826e-005, -2.08905689e-007, 1.69149753e-005, -1, 1, 1.45431045e-007, -2.08901696e-007)) | |
620 | mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 0.699999988)) | |
621 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.420000046, 0.287, 0.420000017)) | |
622 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559772491, 0.00134277344, -0.0700860023, -7.44953468e-008, -1, -4.73725959e-006, 1, -7.45317266e-008, -7.42083941e-008, 7.42095523e-008, -4.73725368e-006, 1)) | |
623 | mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1)) | |
624 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.420000046, 0.287, 0.280000031)) | |
625 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559783936, 0.00134277344, -0.420075655, -7.44639692e-008, -1, -5.6308827e-006, 1, -7.45658326e-008, -7.42004715e-008, 7.42039248e-008, -5.63086405e-006, 1)) | |
626 | mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1)) | |
627 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.420000017, 0.280000001, 0.560000062)) | |
628 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.5598526, 1.52587891e-005, 1.11974049, 5.9590775e-008, 1, 2.51883012e-006, -1, 5.96276095e-008, 3.44174609e-008, 3.441885e-008, -2.51882193e-006, 1)) | |
629 | mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1)) | |
630 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003)) | |
631 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.00018119812, -0.844371796, 0.276464224, 1, -2.20552465e-011, 1.82033399e-011, -1.47792889e-011, 1, 1.78784603e-006, -1.66827021e-011, -1.78783966e-006, 1)) | |
632 | mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.735000134, 0.699999988, 0.699999988)) | |
633 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.280000001, 0.200000003, 0.280000091)) | |
634 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.769760132, 0.000406265259, -0.279969931, 5.95582605e-008, 1, 2.26564134e-006, -1, 5.96603513e-008, 3.44175426e-008, 3.44209745e-008, -2.26562315e-006, 1)) | |
635 | mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 1)) | |
636 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.700000048, 0.200000003)) | |
637 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.839698792, -0.0692727566, -0.000392913818, 1.45439344e-007, -1, -9.2651635e-006, -2.0875224e-007, 9.26515713e-006, -1, 1, 1.45404442e-007, -2.0874937e-007)) | |
638 | mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.699999988, 1, 0.699999988)) | |
639 | Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.699999988, 0.200000003)) | |
640 | Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.839668274, -0.768940926, -0.000394821167, 1.45451168e-007, -1, -1.17661502e-005, -2.08743202e-007, 1.17661421e-005, -1, 1, 1.45416834e-007, -2.08739948e-007)) | |
641 | mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.699999988, 1, 0.699999988)) | |
642 | ||
643 | Handleweld.Part0 = LeftLeg | |
644 | Handleweld.C0 = angles(-2, 0, 0) * cf(-.5, 1.3, 1) | |
645 | ||
646 | local PE1 = Create("ParticleEmitter"){ | |
647 | Parent = Barrel, | |
648 | Color = ColorSequence.new(BrickColor.new("New Yeller").Color), | |
649 | Transparency = NumberSequence.new(0), | |
650 | Size = NumberSequence.new(.5), | |
651 | Texture = "rbxassetid://257430870", | |
652 | Lifetime = NumberRange.new(.1), | |
653 | Rate = 100, | |
654 | VelocitySpread = 180, | |
655 | Rotation = NumberRange.new(0), | |
656 | Speed = NumberRange.new(0), | |
657 | LightEmission = .6, | |
658 | LockedToPart = true, | |
659 | Enabled = false | |
660 | } | |
661 | ||
662 | local PE2 = PE1:Clone() | |
663 | PE2.Size = NumberSequence.new(.7) | |
664 | PE2.LightEmission = 1 | |
665 | PE2.Texture = "rbxassetid://87729590" | |
666 | ||
667 | local Lite = Create("PointLight"){ | |
668 | Parent = Barrel, | |
669 | Color = BrickColor.new("New Yeller").Color, | |
670 | Shadows = true, | |
671 | Range = 10, | |
672 | Brightness = 0.5, | |
673 | Enabled = false | |
674 | } | |
675 | ||
676 | function Equip() | |
677 | attack = true | |
678 | equipped = true | |
679 | RSH.Parent = nil | |
680 | LSH.Parent = nil | |
681 | ||
682 | RHP.Parent = nil | |
683 | LHP.Parent = nil | |
684 | ||
685 | RW = Create("Weld"){ | |
686 | Name = "Right Shoulder", | |
687 | Part0 = Torso , | |
688 | C0 = cf(1.5, 0.5, 0), | |
689 | C1 = cf(0, 0.5, 0), | |
690 | Part1 = RightArm , | |
691 | Parent = Torso , | |
692 | } | |
693 | ||
694 | LW = Create("Weld"){ | |
695 | Name = "Left Shoulder", | |
696 | Part0 = Torso , | |
697 | C0 = cf(-1.5, 0.5, 0), | |
698 | C1 = cf(0, 0.5, 0) , | |
699 | Part1 = LeftArm , | |
700 | Parent = Torso , | |
701 | } | |
702 | ||
703 | RH = Create("Weld"){ | |
704 | Part0 = Torso, | |
705 | C0 = cf(0, -1.5, 0), --* euler(1.3, 0, -0.5) | |
706 | C1 = cf(-0.5, 0.5, 0) , | |
707 | Part1 = Character["Right Leg"], | |
708 | Parent = Torso, | |
709 | } | |
710 | ||
711 | LH = Create("Weld"){ | |
712 | Part0 = Torso, | |
713 | C0 = cf(0, -1.5, 0), --* euler(1.3, 0, -0.5) | |
714 | C1 = cf(0.5, 0.5, 0) , | |
715 | Part1 = Character["Left Leg"], | |
716 | Parent = Torso, | |
717 | } | |
718 | ||
719 | for i = 0, 1, 0.1 do | |
720 | swait() | |
721 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
722 | Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(30), math.rad(0), math.rad(30)), .3) | |
723 | RW.C0 = clerp(RW.C0, CFrame.new(0, 0.2, -.5) * angles(math.rad(20), math.rad(0), math.rad(-50)), 0.3) | |
724 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-5), math.rad(0), math.rad(-10)), 0.3) | |
725 | RH.C0 = clerp(RH.C0, cf(0.03, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(2)), .3) | |
726 | LH.C0 = clerp(LH.C0, cf(-0.03, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-2)), .3) | |
727 | end | |
728 | Handleweld.Part0 = RightArm | |
729 | Handleweld.C0 = euler(0, 0, 0) * cf(0, 0, 0) | |
730 | attack = false | |
731 | end | |
732 | ||
733 | function Unequip() | |
734 | equipped = false | |
735 | attack = true | |
736 | for i = 0, 1, 0.1 do | |
737 | swait() | |
738 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
739 | Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(30), math.rad(0), math.rad(30)), .3) | |
740 | RW.C0 = clerp(RW.C0, CFrame.new(.5, 0.2, -.7) * angles(math.rad(20), math.rad(0), math.rad(-50)), 0.3) | |
741 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-30), math.rad(0), math.rad(-30)), 0.3) | |
742 | RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(5)), .3) | |
743 | LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .3) | |
744 | FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) *euler(6*i,0,0), .5) | |
745 | end | |
746 | FakeHandleweld.C0 = angles(0, 0, 0) * cf(0, 0, 0) | |
747 | Handleweld.Part0 = LeftLeg | |
748 | Handleweld.C0 = angles(-2, 0, 0) * cf(-.5, 1.3, 1) | |
749 | RW.Parent = nil | |
750 | LW.Parent = nil | |
751 | RH.Parent = nil | |
752 | LH.Parent = nil | |
753 | RSH.Parent = Torso | |
754 | LSH.Parent = Torso | |
755 | RHP.Parent = Torso | |
756 | LHP.Parent = Torso | |
757 | Torso.Neck.C0 = necko | |
758 | RootJoint.C0 = RootCF | |
759 | RW.C0 = cf(1.5, 0.5, 0) * euler(0, 0, 0) | |
760 | RW.C1 = cf(0, 0.5, 0) * euler(0, 0, 0) | |
761 | LW.C0 = cf(-1.5, 0.5, 0) * euler(0, 0, 0) | |
762 | LW.C1 = cf(0, 0.5, 0) * euler(0, 0, 0) | |
763 | attack = false | |
764 | end | |
765 | ||
766 | function CylinderEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay) | |
767 | local prt = part(3, Character, "Neon", 0, 0, brickcolor, "Effect", vt(0.2, 0.2, 0.2)) | |
768 | prt.Anchored = true | |
769 | prt.CFrame = cframe | |
770 | local msh = mesh("CylinderMesh", prt, "", "", vt(0, 0, 0), vt(x1, y1, z1)) | |
771 | game:GetService("Debris"):AddItem(prt, 5) | |
772 | Effects[#Effects + 1] = { | |
773 | prt, | |
774 | "Cylinder", | |
775 | delay, | |
776 | x3, | |
777 | y3, | |
778 | z3 | |
779 | } --part, type, delay | |
780 | end | |
781 | ||
782 | function MagnitudeDamage(Hit, Part, magni, mindam, maxdam, knock, Type) | |
783 | for _, c in pairs(workspace:children()) do | |
784 | local hum = c:findFirstChild("Humanoid") | |
785 | if hum ~= nil then | |
786 | local head = c:findFirstChild("Torso") | |
787 | if head ~= nil then | |
788 | local targ = head.Position - Part.Position | |
789 | local mag = targ.magnitude | |
790 | if mag <= magni and c.Name ~= Player.Name then | |
791 | Damagefunc(Hit, head, mindam, maxdam, knock, Type, RootPart, 0, "rbxassetid://199149186", 1) | |
792 | end | |
793 | end | |
794 | end | |
795 | end | |
796 | end | |
797 | ||
798 | RailgunTarget = RootPart | |
799 | function Laser(asd) | |
800 | local MouseLook=cf((asd.Position+mouse.Hit.p)/2,mouse.Hit.p) | |
801 | local hit,pos = rayCast(asd.Position,MouseLook.lookVector,999,RailgunTarget.Parent) | |
802 | local mag=(asd.Position-pos).magnitude | |
803 | CylinderEffect(BrickColor.new("New Yeller"),CFrame.new((asd.Position+pos)/2,pos)*angles(1.57,0,0),1,mag*5,1,1.2,0,1.2,0.1) | |
804 | CylinderEffect(BrickColor.new("Institutional white"),CFrame.new((asd.Position+pos)/2,pos)*angles(1.57,0,0),1,mag*5,.5,1,0,.5,0.1) | |
805 | if hit~=nil then | |
806 | local ref=part(3,workspace,"SmoothPlastic",0,1,BrickColor.new("New Yeller"),"Reference",vt()) | |
807 | ref.Anchored=true | |
808 | ref.CFrame=cf(pos) | |
809 | game:GetService("Debris"):AddItem(ref,1) | |
810 | Damagefunc(ref,hit,20,90,0,"Normal",RootPart,0) | |
811 | end | |
812 | end | |
813 | ||
814 | RocketTarget = RootPart | |
815 | function Shoot(asd, spread1, spread2) | |
816 | local MainPos = asd.Position | |
817 | local MainPos2 = mouse.Hit.p | |
818 | local spread = vt((math.random(-spread1, 0) + math.random()) * spread2, (math.random(-spread1, 0) + math.random()) * spread2, (math.random(-spread1, 0) + math.random()) * spread2) * (asd.Position - mouse.Hit.p).magnitude / 100 | |
819 | local MouseLook = cf((MainPos + MainPos2) / 2, MainPos2 + spread) | |
820 | num = 30 | |
821 | coroutine.resume(coroutine.create(function(Spreaded) | |
822 | repeat | |
823 | wait() | |
824 | local hit, pos = rayCast(MainPos, MouseLook.lookVector, 10, RocketTarget.Parent) | |
825 | local TheHit = mouse.Hit.p | |
826 | local mag = (MainPos - pos).magnitude | |
827 | CylinderEffect(BrickColor.new("New Yeller"), CFrame.new((MainPos + pos) / 2, pos) * angles(1.57, 0, 0), 3, mag * 5, 3, .5, 0, 1.5, 0.1) | |
828 | MainPos = MainPos + (MouseLook.lookVector * 10) | |
829 | num = num - 1 | |
830 | if hit ~= nil then | |
831 | num = 0 | |
832 | local ref = part(3, workspace, "Neon", 0, 1, BrickColor.new("New Yeller"), "Reference", vt()) | |
833 | ref.Anchored = true | |
834 | ref.CFrame = cf(pos) | |
835 | MagnitudeDamage(ref, hit, 5, 10, 20, 1, "Normal") | |
836 | game:GetService("Debris"):AddItem(ref, 5) | |
837 | end | |
838 | until num <= 0 | |
839 | end)) | |
840 | end | |
841 | ||
842 | function ChargeEffect(part, x1, y1, z1, x2, y2, z2, x3, y3, z3, color) | |
843 | local S = Create("Part"){ | |
844 | Material = "SmoothPlastic", | |
845 | Name = "Effect", | |
846 | formFactor = 0, | |
847 | Size = vt(x1, y1, z1), | |
848 | BrickColor = color, | |
849 | Reflectance = 0, | |
850 | TopSurface = 0, | |
851 | BottomSurface = 0, | |
852 | Transparency = 0, | |
853 | Anchored = false, | |
854 | CanCollide = false, | |
855 | Material = "Neon", | |
856 | CFrame = part.CFrame * cf(x2, y2, z2) * euler(x3, y3, z3), | |
857 | Parent = m, | |
858 | } | |
859 | local msh1 = Create("SpecialMesh"){ | |
860 | Scale = vt(0.5, 0.5, 0.5) , | |
861 | MeshType = "Sphere", | |
862 | Parent = S, | |
863 | } | |
864 | coroutine.resume(coroutine.create(function(Part, CF) | |
865 | local f = Instance.new("BodyPosition") | |
866 | f.P = 800 | |
867 | f.D = 100 | |
868 | f.maxForce = vt(math.huge, math.huge, math.huge) | |
869 | f.position = part.Position | |
870 | f.Parent = Part | |
871 | for i = 0, 1, 0.1 do | |
872 | wait() | |
873 | Part.Transparency = Part.Transparency + 0.1 | |
874 | end | |
875 | Part.Parent = nil | |
876 | end), S, S.CFrame) | |
877 | end | |
878 | ||
879 | local lasrs = {} | |
880 | local lasrspd = 3 | |
881 | local maxTravelDistance = 500 | |
882 | local maxRebounds = 20 | |
883 | ||
884 | function RAY(pos, dir, collidedlist, startpos, endpos, distleft) | |
885 | collidedlist = collidedlist or {Character} | |
886 | startpos = startpos or pos | |
887 | distleft = distleft or dir.unit * dir.magnitude | |
888 | endpos = endpos or pos + distleft | |
889 | local ray = Ray.new(pos, distleft) | |
890 | local hitz,enz = workspace:FindPartOnRayWithIgnoreList(ray, collidedlist) | |
891 | if hitz ~= nil and not hitz.Parent:findFirstChild("Humanoid") then | |
892 | if hitz.CanCollide == false then | |
893 | table.insert(collidedlist, hitz) | |
894 | local newpos = enz | |
895 | local newdistleft = distleft - (dir.unit * (pos - newpos).magnitude) | |
896 | if newdistleft then | |
897 | return RAY(newpos-(dir*0.01), dir, collidedlist, startpos, endpos, newdistleft+(dir*0.01)) | |
898 | end | |
899 | end | |
900 | end | |
901 | return hitz, enz, ray | |
902 | end | |
903 | ||
904 | function FindSurface(part, position) | |
905 | local obj = part.CFrame:pointToObjectSpace(position) | |
906 | local siz = part.Size/2 | |
907 | so("rbxassetid://199144144", workspace, 1, .9) | |
908 | for i,v in pairs(Enum.NormalId:GetEnumItems()) do | |
909 | local vec = Vector3.FromNormalId(v) | |
910 | local wvec = part.CFrame:vectorToWorldSpace(vec) | |
911 | local vz = (obj)/(siz*vec) | |
912 | if (math.abs(vz.X-1) < 0.001 or math.abs(vz.Y-1) < 0.001 or math.abs(vz.Z-1) < 0.001) then | |
913 | return wvec,vec | |
914 | end | |
915 | end | |
916 | if part.className == "WedgePart" then | |
917 | local pos = (part.CFrame * CFrame.new(0,part.Size.y/2,part.Size.z/2)).p | |
918 | local apos = (part.CFrame * CFrame.Angles(-math.atan2(part.CFrame:pointToObjectSpace(pos).y,part.CFrame:pointToObjectSpace(pos).z),0,0) * CFrame.new(0,1,0)).p | |
919 | local wvec,vec = (apos - part.Position).unit, part.CFrame:pointToObjectSpace(apos) | |
920 | return wvec,vec | |
921 | elseif part.className == "Part" and (part.Shape.Name == "Ball" or part.Shape.Name == "Cylinder") then | |
922 | return (position - part.Position).unit, part.CFrame:vectorToObjectSpace((position - part.Position).unit) | |
923 | end | |
924 | end | |
925 | ||
926 | function Reflect(direction, normal) | |
927 | return direction - 2 * normal:Dot(direction) * normal | |
928 | end | |
929 | ||
930 | function ReflectShot(mouse) | |
931 | local dir = (mouse.Hit.p - Torso.Position).unit | |
932 | local tabl | |
933 | local tablnum = 0 | |
934 | for i, v in pairs(lasrs) do | |
935 | if not v[1] then | |
936 | tabl = v | |
937 | tablnum = i | |
938 | break | |
939 | end | |
940 | end | |
941 | if not tabl then | |
942 | tablnum = #lasrs + 1 | |
943 | tabl = {false,nil,nil,0,0,1,{},{},{},{}} | |
944 | for i = 1, 2 do | |
945 | for j = 1, 6 do | |
946 | local p = Instance.new("Part") | |
947 | p.FormFactor = "Custom" | |
948 | p.CanCollide = false | |
949 | p.Anchored = true | |
950 | p.Locked = true | |
951 | p.BrickColor = BrickColor.new("New Yeller") | |
952 | p.TopSurface = 10 | |
953 | p.BottomSurface = 10 | |
954 | p.RightSurface = 10 | |
955 | p.LeftSurface = 10 | |
956 | p.FrontSurface = 10 | |
957 | p.BackSurface = 10 | |
958 | p.Size = Vector3.new(1,1,1) | |
959 | p.Material = "Neon" | |
960 | p.Transparency = i == 1 and 0 or 0.6 | |
961 | p.Touched:connect(function(hit) | |
962 | hit.Parent.Humanoid:TakeDamage(30) | |
963 | end) | |
964 | local mesh = Instance.new("CylinderMesh",p) | |
965 | table.insert(tabl[6+i],p) | |
966 | table.insert(tabl[8+i],mesh) | |
967 | end | |
968 | end | |
969 | table.insert(lasrs,tabl) | |
970 | end | |
971 | -- isMoving,direction,lastPosition,rebounds,distance,recycleCount,middleLayer,outerLayer | |
972 | tabl[4],tabl[5] = 0,0 | |
973 | tabl[3] = Barrel.Position | |
974 | tabl[2] = dir | |
975 | tabl[1] = true | |
976 | ||
977 | end | |
978 | ||
979 | local MultiShoot = false | |
980 | local gun = false | |
981 | local shoot = false | |
982 | local Obliterate = false | |
983 | local LaserMode = false | |
984 | function Aim() | |
985 | attack = true | |
986 | gun = true | |
987 | for i = 0, 1, 0.2 do | |
988 | swait() | |
989 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), .5) | |
990 | Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(0), math.rad(0), math.rad(-90)), .5) | |
991 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(90)), 0.5) | |
992 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-10), math.rad(0), math.rad(-20)), 0.5) | |
993 | RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(5), math.rad(0), math.rad(5)), .5) | |
994 | LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .5) | |
995 | end | |
996 | RootJoint.C0 = RootCF * cf(0, 0, 0) * euler(0, 0, 1.57) | |
997 | RW.C0 = cf(1.5, 0.5, 0) * euler(1.57, 0, 1.57) | |
998 | local gairo = Create("BodyGyro"){ | |
999 | Parent = RootPart, | |
1000 | maxTorque = Vector3.new(4e+005, 4e+005, 4e+005) * math.huge , | |
1001 | P = 20e+003 , | |
1002 | cframe = RootPart.CFrame, | |
1003 | } | |
1004 | local offset = nil | |
1005 | while gun == true do | |
1006 | swait() | |
1007 | local gunpos = vt(mouse.Hit.p.x, Head.Position.Y, mouse.Hit.p.z) | |
1008 | offset = (Torso.Position.y - mouse.Hit.p.y) / 60 | |
1009 | local mag = (Torso.Position - mouse.Hit.p).magnitude / 80 | |
1010 | offset = offset / mag | |
1011 | gairo.cframe = cf(Head.Position, gunpos) | |
1012 | Neck.C0 = clerp(Neck.C0, necko * euler(0, 0, -1.57), .3) | |
1013 | RW.C1 = clerp(RW.C1, cf(0, 0.5, 0) * euler(offset, 0, 0), .5) | |
1014 | end | |
1015 | if shoot == true then | |
1016 | gairo.Parent = nil | |
1017 | PE1.Enabled,PE2.Enabled = true,true | |
1018 | Lite.Enabled = true | |
1019 | for i = 0, 1, 0.1 do | |
1020 | swait() | |
1021 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), .3) | |
1022 | Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(0), math.rad(5), math.rad(-90)), .3) | |
1023 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(50), math.rad(90)), 0.3) | |
1024 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(-40)), 0.3) | |
1025 | RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(5), math.rad(0), math.rad(5)), .3) | |
1026 | LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .3) | |
1027 | FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(30), math.rad(0), math.rad(0)), .3) | |
1028 | end | |
1029 | Lite.Enabled = false | |
1030 | PE1.Enabled,PE2.Enabled = false,false | |
1031 | elseif MultiShoot == true then | |
1032 | gairo.Parent = nil | |
1033 | for i = 1,5 do | |
1034 | so("rbxassetid://199144089", Barrel, 1, 1.1) | |
1035 | Shoot(Barrel, .2, 1) | |
1036 | PE1.Enabled,PE2.Enabled = true,true | |
1037 | Lite.Enabled = true | |
1038 | for i = 0,1,1 do | |
1039 | swait() | |
1040 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), .5) | |
1041 | Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(0), math.rad(2), math.rad(-90)), .5) | |
1042 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(50), math.rad(90)), 0.5) | |
1043 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(-40)), 0.5) | |
1044 | RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(5), math.rad(0), math.rad(5)), .5) | |
1045 | LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .5) | |
1046 | FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(30), math.rad(0), math.rad(0)), .3) | |
1047 | end | |
1048 | PE1.Enabled,PE2.Enabled = false,false | |
1049 | Lite.Enabled = false | |
1050 | for i = 0,1,1 do | |
1051 | swait() | |
1052 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), .5) | |
1053 | Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(0), math.rad(0), math.rad(-90)), .5) | |
1054 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(90)), 0.5) | |
1055 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-10), math.rad(0), math.rad(-20)), 0.5) | |
1056 | RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(5), math.rad(0), math.rad(5)), .5) | |
1057 | LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .5) | |
1058 | FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
1059 | end | |
1060 | end | |
1061 | elseif LaserMode == true then | |
1062 | gairo.Parent = nil | |
1063 | so("rbxassetid://161006157", Barrel, 1, .9) | |
1064 | so("rbxassetid://161006131", Barrel, 1, 1.2) | |
1065 | for i = 1, 30 do | |
1066 | swait() | |
1067 | ChargeEffect(Barrel, 2, 2, 2, math.random(-10, 10), math.random(-10, 10), math.random(-10, 10), 0, 0, 0, BrickColor.new("New Yeller")) | |
1068 | end | |
1069 | so("rbxassetid://199144089", Barrel, 1, .8) | |
1070 | so("rbxassetid://199144089", Barrel, 1, .5) | |
1071 | Laser(Barrel) | |
1072 | PE1.Enabled,PE2.Enabled = true,true | |
1073 | Lite.Enabled = true | |
1074 | for i = 0, 1, 0.1 do | |
1075 | swait() | |
1076 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), .3) | |
1077 | Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(0), math.rad(5), math.rad(-90)), .3) | |
1078 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(50), math.rad(90)), 0.3) | |
1079 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(-40)), 0.3) | |
1080 | RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(5), math.rad(0), math.rad(5)), .3) | |
1081 | LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .3) | |
1082 | FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(30), math.rad(0), math.rad(0)), .3) | |
1083 | end | |
1084 | PE1.Enabled,PE2.Enabled = false,false | |
1085 | Lite.Enabled = false | |
1086 | elseif Obliterate == true then | |
1087 | gairo.Parent = nil | |
1088 | so("rbxassetid://161006157", Barrel, 1, .7) | |
1089 | so("rbxassetid://161006131", Barrel, 1, 1) | |
1090 | for i = 1, 60 do | |
1091 | swait() | |
1092 | ChargeEffect(Barrel, 2, 2, 2, math.random(-10, 10), math.random(-10, 10), math.random(-10, 10), 0, 0, 0, BrickColor.new("New Yeller")) | |
1093 | end | |
1094 | for i = 1, 5 do | |
1095 | so("rbxassetid://199144089", Barrel, 1, .8) | |
1096 | for i = 1, 5 do | |
1097 | Shoot(Barrel, 1, 3) | |
1098 | end | |
1099 | PE1.Enabled,PE2.Enabled = true,true | |
1100 | Lite.Enabled = true | |
1101 | for i = 0, 1, 0.2 do | |
1102 | swait() | |
1103 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), .5) | |
1104 | Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(0), math.rad(5), math.rad(-90)), .5) | |
1105 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.8, 0) * angles(math.rad(90), math.rad(50), math.rad(90)), 0.5) | |
1106 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(-40)), 0.5) | |
1107 | RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(5), math.rad(0), math.rad(5)), .5) | |
1108 | LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .5) | |
1109 | FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(30), math.rad(0), math.rad(0)), .3) | |
1110 | end | |
1111 | PE1.Enabled,PE2.Enabled = false,false | |
1112 | Lite.Enabled = false | |
1113 | for i = 0, 1, 0.2 do | |
1114 | swait() | |
1115 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), .3) | |
1116 | Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(0), math.rad(0), math.rad(-90)), .3) | |
1117 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(90)), 0.3) | |
1118 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-10), math.rad(0), math.rad(-20)), 0.3) | |
1119 | RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(5), math.rad(0), math.rad(5)), .3) | |
1120 | LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .3) | |
1121 | FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
1122 | end | |
1123 | end | |
1124 | ||
1125 | for i = 0, 1, 0.1 do | |
1126 | swait() | |
1127 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(50)), .3) | |
1128 | Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(5), math.rad(-5), math.rad(-55)), .3) | |
1129 | RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5, -.5) * angles(math.rad(0), math.rad(130), math.rad(80)), 0.3) | |
1130 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-10), math.rad(0), math.rad(-20)), 0.3) | |
1131 | RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(5), math.rad(0), math.rad(5)), .3) | |
1132 | LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .3) | |
1133 | FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(10), math.rad(0), math.rad(0)), .3) | |
1134 | end | |
1135 | so("rbxassetid://161006157", Barrel, 1, .9) | |
1136 | so("rbxassetid://161006131", Barrel, 1, 1.2) | |
1137 | for i = 1, 30 do | |
1138 | swait() | |
1139 | ChargeEffect(Barrel, 2, 2, 2, math.random(-10, 10), math.random(-10, 10), math.random(-10, 10), 0, 0, 0, BrickColor.new("New Yeller")) | |
1140 | end | |
1141 | for i = 0, 1, 0.05 do | |
1142 | swait() | |
1143 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), .3) | |
1144 | Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(0), math.rad(1), math.rad(-85)), .3) | |
1145 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), 0.3) | |
1146 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-10), math.rad(0), math.rad(-20)), 0.3) | |
1147 | RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(5), math.rad(0), math.rad(5)), .3) | |
1148 | LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .3) | |
1149 | FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(20), math.rad(0), math.rad(0)), .3) | |
1150 | end | |
1151 | so("rbxassetid://199144089", Barrel, 1, .8) | |
1152 | so("rbxassetid://199144089", Barrel, 1, .9) | |
1153 | so("rbxassetid://199144089", Barrel, 1, .6) | |
1154 | for i = 1, 20 do | |
1155 | Shoot(Barrel, 1.5, 5) | |
1156 | end | |
1157 | PE1.Enabled,PE2.Enabled = true,true | |
1158 | Lite.Enabled = true | |
1159 | for i = 0, 1, 0.05 do | |
1160 | swait() | |
1161 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), .5) | |
1162 | Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(0), math.rad(10), math.rad(-90)), .5) | |
1163 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.8, 0) * angles(math.rad(0), math.rad(50), math.rad(120)), 0.5) | |
1164 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-10), math.rad(0), math.rad(-20)), 0.5) | |
1165 | RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(5), math.rad(0), math.rad(5)), .5) | |
1166 | LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .5) | |
1167 | end | |
1168 | PE1.Enabled,PE2.Enabled = false,false | |
1169 | Lite.Enabled = false | |
1170 | end | |
1171 | gairo.Parent = nil | |
1172 | shoot = false | |
1173 | attack = false | |
1174 | end | |
1175 | ||
1176 | mouse.Button1Down:connect(function() | |
1177 | if gun == true then | |
1178 | shoot = true | |
1179 | so("rbxassetid://199144089", Barrel, 1, 1) | |
1180 | Shoot(Barrel, 0, 0) | |
1181 | gun = false | |
1182 | end | |
1183 | end) | |
1184 | ||
1185 | ||
1186 | ||
1187 | mouse.KeyDown:connect(function(k) | |
1188 | k = k:lower() | |
1189 | if attack == false and equipped == false and k == 'e' then | |
1190 | Equip() | |
1191 | elseif attack == false and equipped == true and k == 'e' then | |
1192 | Unequip() | |
1193 | elseif attack == false and equipped == true and k == 'f' then | |
1194 | Aim() | |
1195 | elseif equipped == true and k == 'f' then | |
1196 | shoot = false | |
1197 | elseif equipped == true and gun == true and k == 'q' then | |
1198 | shoot = true | |
1199 | so("rbxassetid://199144089", Barrel, 1, .8) | |
1200 | for i = 1, 5 do | |
1201 | Shoot(Barrel, 1, 3) | |
1202 | gun = false | |
1203 | end | |
1204 | elseif equipped == true and gun == true and k == 'e' then | |
1205 | MultiShoot = true | |
1206 | gun = false | |
1207 | elseif equipped == true and gun == true and k == 'r' then | |
1208 | MultiShoot = false | |
1209 | LaserMode = true | |
1210 | gun = false | |
1211 | elseif equipped == true and attack == true and gun == true and k == 't' then | |
1212 | MultiShoot = false | |
1213 | Obliterate = true | |
1214 | LaserMode = false | |
1215 | gun = false | |
1216 | elseif equipped == true and attack == true and gun == true and k == 'g' then | |
1217 | shoot = true | |
1218 | ReflectShot(mouse) | |
1219 | so("rbxassetid://199144089", Barrel, 1, .8) | |
1220 | so("rbxassetid://199144089", Barrel, 1, .5) | |
1221 | gun = false | |
1222 | end | |
1223 | end) | |
1224 | ||
1225 | game:GetService("RunService").Stepped:connect(function() | |
1226 | for _, lasr in pairs(lasrs) do | |
1227 | for i, v in pairs(lasr[9]) do | |
1228 | if lasr[7][i].Parent then | |
1229 | v.Scale = v.Scale + Vector3.new(-0.1,0,-0.1) | |
1230 | lasr[10][i].Scale = lasr[10][i].Scale + Vector3.new(-0.1,0,-0.1) | |
1231 | if v.Scale.x < 0.1 then | |
1232 | lasr[7][i].Parent = nil | |
1233 | lasr[8][i].Parent = nil | |
1234 | end | |
1235 | end | |
1236 | end | |
1237 | ||
1238 | if lasr[1] then | |
1239 | local hitz, enz = RAY(lasr[3],lasr[2]*lasrspd) | |
1240 | lasr[5] = lasr[5] + (lasr[3] - enz).magnitude | |
1241 | ||
1242 | lasr[7][lasr[6]].Parent = m | |
1243 | lasr[7][lasr[6]].CFrame = CFrame.new((lasr[3] + enz)/2,enz) * CFrame.Angles(math.pi/2,0,0) | |
1244 | lasr[9][lasr[6]].Scale = Vector3.new(0.7,(lasr[3] - enz).magnitude*5,0.7) | |
1245 | ||
1246 | lasr[8][lasr[6]].Parent = m | |
1247 | lasr[8][lasr[6]].CFrame = lasr[7][lasr[6]].CFrame | |
1248 | lasr[10][lasr[6]].Scale = Vector3.new(1.3,(lasr[3] - enz).magnitude*5 + 0.02,1.3) | |
1249 | ||
1250 | lasr[3] = enz | |
1251 | lasr[6] = lasr[6]%#lasr[7] + 1 | |
1252 | ||
1253 | if hitz then | |
1254 | lasr[4] = lasr[4] + 1 | |
1255 | if lasr[4] == maxRebounds then | |
1256 | lasr[1] = false | |
1257 | else | |
1258 | local norm = FindSurface(hitz,enz) | |
1259 | lasr[2] = Reflect(lasr[2],norm) | |
1260 | end | |
1261 | end | |
1262 | if lasr[5] > maxTravelDistance then | |
1263 | lasr[1] = false | |
1264 | end | |
1265 | end | |
1266 | end | |
1267 | end) | |
1268 | ||
1269 | local sine = 0 | |
1270 | local change = 1 | |
1271 | local val = 0 | |
1272 | local idle = 0 | |
1273 | local donum = 0 | |
1274 | ||
1275 | while true do | |
1276 | swait() | |
1277 | sine = sine + change | |
1278 | mouse.Icon = "http://www.roblox.com/asset/?id=296383647" | |
1279 | local torvel = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude | |
1280 | local velderp = RootPart.Velocity.y | |
1281 | hitfloor, posfloor = rayCast(RootPart.Position, (CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0))).lookVector, 4, Character) | |
1282 | if equipped == true then | |
1283 | if attack == false then | |
1284 | idle = idle + 1 | |
1285 | else | |
1286 | idle = 0 | |
1287 | end | |
1288 | if idle >= 500 then | |
1289 | if attack == false then | |
1290 | end | |
1291 | end | |
1292 | if donum >= .5 then | |
1293 | handidle = true | |
1294 | elseif donum <= 0 then | |
1295 | handidle = false | |
1296 | end | |
1297 | if handidle == false then | |
1298 | donum = donum + 0.003 | |
1299 | else | |
1300 | donum = donum - 0.003 | |
1301 | end | |
1302 | if RootPart.Velocity.y > 1 and hitfloor == nil then | |
1303 | Anim = "Jump" | |
1304 | if attack == false then | |
1305 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(-5), math.rad(0), math.rad(0)), .3) | |
1306 | Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(10), math.rad(0), math.rad(0)), .3) | |
1307 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(30)), 0.3) | |
1308 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-10), math.rad(0), math.rad(-20)), 0.3) | |
1309 | RH.C0 = clerp(RH.C0, cf(.05, -1.5, .5) * angles(math.rad(-20), math.rad(0), math.rad(5)), .3) | |
1310 | LH.C0 = clerp(LH.C0, cf(-.05, -1.5, .5) * angles(math.rad(-20), math.rad(0), math.rad(-5)), .3) | |
1311 | FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
1312 | RW.C1 = clerp(RW.C1, cf(0, 0.5, 0) * euler(0, 0, 0), .3) | |
1313 | end | |
1314 | elseif RootPart.Velocity.y < -1 and hitfloor == nil then | |
1315 | Anim = "Fall" | |
1316 | if attack == false then | |
1317 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
1318 | Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(20), math.rad(0), math.rad(0)), .3) | |
1319 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-30), math.rad(0), math.rad(40)), 0.3) | |
1320 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(-30)), 0.3) | |
1321 | RH.C0 = clerp(RH.C0, cf(0.05, -1.5, -.2) * angles(math.rad(10), math.rad(0), math.rad(5)), .3) | |
1322 | LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, -.2) * angles(math.rad(10), math.rad(0), math.rad(-5)), .3) | |
1323 | FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
1324 | RW.C1 = clerp(RW.C1, cf(0, 0.5, 0) * euler(0, 0, 0), .3) | |
1325 | end | |
1326 | elseif torvel < 1 and hitfloor ~= nil then | |
1327 | Anim = "Idle" | |
1328 | if attack == false then | |
1329 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(5) + donum / 3, math.rad(0), math.rad(30)), .3) | |
1330 | Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(.5) - donum / 3, math.rad(.5) + donum / 3, math.rad(-30)), .3) | |
1331 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(50), math.rad(0), math.rad(5) + donum / 2), 0.3) | |
1332 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-5) + donum / 2, math.rad(0), math.rad(-10)), 0.3) | |
1333 | RH.C0 = clerp(RH.C0, cf(.2, -1.5, -.5) * angles(math.rad(5) + donum / 2, math.rad(-30), math.rad(5) + donum / 5), .3) | |
1334 | LH.C0 = clerp(LH.C0, cf(0, -1.5 - donum / 3.5, 0) * angles(math.rad(5) + donum / 3, math.rad(-10), math.rad(0)), .3) | |
1335 | FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
1336 | RW.C1 = clerp(RW.C1, cf(0, 0.5, 0) * euler(0, 0, 0), .3) | |
1337 | end | |
1338 | elseif torvel > 2 and hitfloor ~= nil then | |
1339 | Anim = "Walk" | |
1340 | if attack == false then | |
1341 | change = 3 | |
1342 | RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(20) + donum / 2, math.rad(0), math.rad(0)), .3) | |
1343 | Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(-10) - donum / 2, math.rad(0), math.rad(0)), .3) | |
1344 | RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-50) + donum / 2, math.rad(0), math.rad(5) + donum / 2), 0.3) | |
1345 | LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(20) + donum / 2, math.rad(0), math.rad(-5) - donum / 2), 0.3) | |
1346 | LH.C0 = clerp(LH.C0, CFrame.new(0, -1.5-0.3*math.cos(sine/10)/2, -.05 + math.sin(sine/10)/2) * CFrame.Angles(math.rad(3) + -math.sin(sine/10)/2.3, math.rad(0), math.rad(-3)), .4) | |
1347 | RH.C0 = clerp(RH.C0, CFrame.new(0, -1.5+0.3*math.cos(sine/10)/2, -.05 + -math.sin(sine/10)/2) * CFrame.Angles(math.rad(3) + math.sin(sine/10)/2.3, math.rad(0), math.rad(3)), .4) | |
1348 | FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3) | |
1349 | RW.C1 = clerp(RW.C1, cf(0, 0.5, 0) * euler(0, 0, 0), .3) | |
1350 | end | |
1351 | end | |
1352 | end | |
1353 | if #Effects > 0 then | |
1354 | for e = 1, #Effects do | |
1355 | if Effects[e] ~= nil then | |
1356 | local Thing = Effects[e] | |
1357 | if Thing ~= nil then | |
1358 | local Part = Thing[1] | |
1359 | local Mode = Thing[2] | |
1360 | local Delay = Thing[3] | |
1361 | local IncX = Thing[4] | |
1362 | local IncY = Thing[5] | |
1363 | local IncZ = Thing[6] | |
1364 | if Thing[1].Transparency <= 1 then | |
1365 | if Thing[2] == "Block1" then | |
1366 | Thing[1].CFrame = Thing[1].CFrame * euler(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)) | |
1367 | Mesh = Thing[1].Mesh | |
1368 | Mesh.Scale = Mesh.Scale + vt(Thing[4], Thing[5], Thing[6]) | |
1369 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
1370 | elseif Thing[2] == "Cylinder" then | |
1371 | Mesh = Thing[1].Mesh | |
1372 | Mesh.Scale = Mesh.Scale + vt(Thing[4], Thing[5], Thing[6]) | |
1373 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
1374 | elseif Thing[2] == "Blood" then | |
1375 | Mesh = Thing[7] | |
1376 | Thing[1].CFrame = Thing[1].CFrame * cf(0, .5, 0) | |
1377 | Mesh.Scale = Mesh.Scale + vt(Thing[4], Thing[5], Thing[6]) | |
1378 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
1379 | elseif Thing[2] == "Elec" then | |
1380 | Mesh = Thing[1].Mesh | |
1381 | Mesh.Scale = Mesh.Scale + vt(Thing[7], Thing[8], Thing[9]) | |
1382 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
1383 | elseif Thing[2] == "Disappear" then | |
1384 | Thing[1].Transparency = Thing[1].Transparency + Thing[3] | |
1385 | end | |
1386 | else | |
1387 | Part.Parent = nil | |
1388 | table.remove(Effects, e) | |
1389 | end | |
1390 | end | |
1391 | end | |
1392 | end | |
1393 | end | |
1394 | end |