SHOW:
|
|
- or go back to the newest paste.
1 | -- This script has been converted to FE by iPxter | |
2 | ||
3 | ||
4 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end | |
5 | local Player,Mouse,mouse,UserInputService,ContextActionService = owner | |
6 | do | |
7 | print("FE Compatibility code by Mokiros | Translated to FE by iPxter") | |
8 | script.Parent = Player.Character | |
9 | ||
10 | --RemoteEvent for communicating | |
11 | local Event = Instance.new("RemoteEvent") | |
12 | Event.Name = "UserInput_Event" | |
13 | ||
14 | --Fake event to make stuff like Mouse.KeyDown work | |
15 | local function fakeEvent() | |
16 | local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end} | |
17 | t.connect = t.Connect | |
18 | return t | |
19 | end | |
20 | ||
21 | --Creating fake input objects with fake variables | |
22 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()} | |
23 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} | |
24 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) | |
25 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil | |
26 | end} | |
27 | --Merged 2 functions into one by checking amount of arguments | |
28 | CAS.UnbindAction = CAS.BindAction | |
29 | ||
30 | --This function will trigger the events that have been :Connect()'ed | |
31 | local function te(self,ev,...) | |
32 | local t = m[ev] | |
33 | if t and t._fakeEvent and t.Function then | |
34 | t.Function(...) | |
35 | end | |
36 | end | |
37 | m.TrigEvent = te | |
38 | UIS.TrigEvent = te | |
39 | ||
40 | Event.OnServerEvent:Connect(function(plr,io) | |
41 | if plr~=Player then return end | |
42 | if io.isMouse then | |
43 | m.Target = io.Target | |
44 | m.Hit = io.Hit | |
45 | else | |
46 | local b = io.UserInputState == Enum.UserInputState.Begin | |
47 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
48 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
49 | end | |
50 | for _,t in pairs(CAS.Actions) do | |
51 | for _,k in pairs(t.Keys) do | |
52 | if k==io.KeyCode then | |
53 | t.Function(t.Name,io.UserInputState,io) | |
54 | end | |
55 | end | |
56 | end | |
57 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
58 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
59 | end | |
60 | end) | |
61 | Event.Parent = NLS([==[ | |
62 | local Player = Owner | |
63 | local Event = script:WaitForChild("UserInput_Event") | |
64 | ||
65 | local UIS = game:GetService("UserInputService") | |
66 | local input = function(io,a) | |
67 | if a then return end | |
68 | --Since InputObject is a client-side instance, we create and pass table instead | |
69 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}) | |
70 | end | |
71 | UIS.InputBegan:Connect(input) | |
72 | UIS.InputEnded:Connect(input) | |
73 | ||
74 | local Mouse = Player:GetMouse() | |
75 | local h,t | |
76 | --Give the server mouse data 30 times every second, but only if the values changed | |
77 | --If player is not moving their mouse, client won't fire events | |
78 | while wait(1/30) do | |
79 | if h~=Mouse.Hit or t~=Mouse.Target then | |
80 | h,t=Mouse.Hit,Mouse.Target | |
81 | Event:FireServer({isMouse=true,Target=t,Hit=h}) | |
82 | end | |
83 | end]==],Player.Character) | |
84 | Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS | |
85 | end | |
86 | ||
87 | repeat wait() until game:GetService("Players").LocalPlayer.Character; | |
88 | pcall(function() _G.RMs.Disabled=true end) | |
89 | _G.RMs=script | |
90 | _G.RMf=getfenv() | |
91 | ServiceTable = {"Players","Lighting","Debris","StarterPack","InsertService"} | |
92 | for i,v in pairs(ServiceTable) do | |
93 | getfenv()[v]=game:GetService(v) | |
94 | end | |
95 | ||
96 | INEW=Instance.new | |
97 | V3=Vector3.new | |
98 | V3A=function(i) return V3(i,i,i) end | |
99 | CF=CFrame.new | |
100 | MRAD=math.rad | |
101 | MDEG=math.deg | |
102 | mrnd=math.random | |
103 | CA=function(a,b,c) return CFrame.Angles(MRAD(a),MRAD(b),MRAD(c)) end | |
104 | CF0=CF(0,0,0) | |
105 | v3=V3 | |
106 | v30=v3(0,0,0) | |
107 | v31=v3(1/0,1/0,1/0) | |
108 | rotrand = function(a,b) | |
109 | local a = a and -a or -180 | |
110 | local b = b and -b or 180 | |
111 | return CA(mrnd(a,b),mrnd(a,b),mrnd(a,b)) | |
112 | end | |
113 | ||
114 | as,so2,so={},{'metal','Block','Slash','Slash2','Hit','Kick','Abscond','Cast'},{} | |
115 | as.corner='11294911' | |
116 | as.cone='1033714' | |
117 | as.ring="3270017" | |
118 | as.Chakram='47260990' | |
119 | as.ring2='18430887' | |
120 | as.blast='20329976' | |
121 | as.missile='10207677' | |
122 | as.fire='2693346' | |
123 | as.boom='3264793' | |
124 | as.slash='10209645' | |
125 | as.abscond='2767090' | |
126 | as.firelaser='13775494' | |
127 | as.diamond='9756362' | |
128 | as.metal='rbxasset://sounds\\unsheath.wav' | |
129 | as.Block = 'rbxasset://sounds\\metal.ogg' | |
130 | as.Slash = '10209645' | |
131 | as.Slash2 = '46760716' | |
132 | as.Hit='10209583' | |
133 | as.Kick='46153268' | |
134 | as.Cast='2101137' | |
135 | as.Abscond='2767090' | |
136 | as.Blood='158555098' | |
137 | as.Spear1='69891706' | |
138 | as.Spear1T='69890778' | |
139 | as.Skull='6552202' | |
140 | as.Gradient1='185346444' | |
141 | as.Gradient2='185346448' | |
142 | ||
143 | for i,v in pairs(as) do | |
144 | if v:sub(1,3)~="htt" and v:sub(1,3)~="rbx" then | |
145 | as[i]="http://www.roblox.com/asset/?id="..v | |
146 | end | |
147 | end | |
148 | ||
149 | ||
150 | newPart = function(sizea,sizeb,sizec,parent,cframe,aa,bb,cc,dd,ee,ff) | |
151 | local Materials = {} | |
152 | for i,v in pairs{ | |
153 | "Plastic","SmoothPlastic","Wood", "WoodPlanks", | |
154 | "Marble", "Slate","Concrete", "Granite", | |
155 | "Brick","Pebble", "Cobblestone","CorrodedMetal", | |
156 | "DiamondPlate", "Foil", "Metal","Grass", | |
157 | "Sand","Fabric","Ice"} do | |
158 | Materials[v]=v | |
159 | end | |
160 | local mat,col | |
161 | local part = Instance.new("Part",parent or Model) | |
162 | for i,v in pairs{aa,bb,cc,dd,ee,ff} do | |
163 | if Materials[v] then mat=v end | |
164 | if BrickColor.new(v).Name==v then col=v end | |
165 | if v=="CylinderMesh" or v=="BlockMesh" then INEW(v,part).Name="Mesh" end | |
166 | if v=="Wedge" then part.Parent=nil part=INEW("WedgePart",parent or Model) end | |
167 | if v=="Corner" then part.Parent=nil part=INEW("CornerWedgePart",parent or Model) | |
168 | end | |
169 | end | |
170 | if part.className~="CornerWedgePart" then part.formFactor="Custom" end | |
171 | part.TopSurface=0 | |
172 | part.BottomSurface=0 | |
173 | part.Size=V3(sizea,sizeb,sizec) or V3(1,1,1) | |
174 | part.CFrame=cframe or CF(0,10,0) | |
175 | part.BrickColor=BrickColor.new(col or '') | |
176 | part.Material = mat or 'Plastic' | |
177 | part:BreakJoints() | |
178 | return part,cframe | |
179 | end | |
180 | newWeld = function(parent,P0,P1,C0,C1) | |
181 | local weld=INEW("Weld",parent or P0) | |
182 | weld.Part0=P0 | |
183 | weld.Part1=P1 | |
184 | weld.C0=C0 or weld.C0 | |
185 | weld.C1=C1 or weld.C1 | |
186 | return weld | |
187 | end | |
188 | ------- | |
189 | ray = function(Pos, Dir,tab,length) -- ray cast | |
190 | return workspace:FindPartOnRay(Ray.new(Pos, Dir.unit *(length or 999)),tab) | |
191 | end | |
192 | ---------------------------------------------------------------------------- | |
193 | WeldLib={} | |
194 | function GetWeld(weld,CO) | |
195 | local CO=CO or 0 | |
196 | if not WeldLib[weld] then | |
197 | local x0,y0,z0=weld.C0:toEulerAnglesXYZ() | |
198 | local x1,y1,z1=weld.C1:toEulerAnglesXYZ() | |
199 | WeldLib[weld]={[0]=v3(mdeg(x0),mdeg(y0),mdeg(z0)),[1]=v3(mdeg(x1),mdeg(y1),mdeg(z1))} | |
200 | end | |
201 | return weld['C'..CO].p,WeldLib[weld][CO] | |
202 | end | |
203 | function ClearWeld(weld) | |
204 | if WeldLib[weld] then WeldLib[weld]=nil end | |
205 | end | |
206 | mabs=math.abs | |
207 | mdeg = math.deg | |
208 | v3floor = function(w,dec) | |
209 | local dec=dec or 1000 | |
210 | return v3(math.floor(w.x*dec)/dec,math.floor(w.y*dec)/dec,math.floor(w.z*dec)/dec) | |
211 | end | |
212 | function SetWeld(weld,CO,i, loops, origpos,origangle, nextpos,nextangle,smooth) | |
213 | local origpos=origpos | |
214 | local origangle=origangle | |
215 | loops=math.floor(loops) | |
216 | if not origpos and not origangle then | |
217 | origpos,origangle=GetWeld(weld,CO) | |
218 | end | |
219 | local perc =(smooth==1 or smooth==nil) and math.sin((math.pi/2)/loops*i) or i/loops | |
220 | ----------- | |
221 | if not WeldLib[weld] then | |
222 | local x0,y0,z0=weld.C0:toEulerAnglesXYZ() | |
223 | local x1,y1,z1=weld.C1:toEulerAnglesXYZ() | |
224 | WeldLib[weld]={[0]=v3(mdeg(x0),mdeg(y0),mdeg(z0)),[1]=v3(mdeg(x1),mdeg(y1),mdeg(z1))} | |
225 | end | |
226 | --if smooth==2 and (origangle-nextangle).magnitude <2.5 then return end -- anti | |
227 | ----------- | |
228 | origangle=v3floor(origangle) | |
229 | nextangle=v3floor(nextangle) | |
230 | local tox,toy,toz = 0,0,0 | |
231 | tox = origangle.x > nextangle.x and -mabs(origangle.x - nextangle.x) *perc or mabs(origangle.x - nextangle.x) *perc | |
232 | toy = origangle.y > nextangle.y and -mabs(origangle.y - nextangle.y) *perc or mabs(origangle.y - nextangle.y) *perc | |
233 | toz = origangle.z > nextangle.z and -mabs(origangle.z - nextangle.z) *perc or mabs(origangle.z - nextangle.z) *perc | |
234 | local tox2,toy2,toz2 = 0,0,0 | |
235 | tox2= origpos.x > nextpos.x and -mabs(origpos.x - nextpos.x) *perc or mabs(origpos.x - nextpos.x) *perc | |
236 | toy2= origpos.y > nextpos.y and -mabs(origpos.y - nextpos.y) *perc or mabs(origpos.y - nextpos.y) *perc | |
237 | toz2= origpos.z > nextpos.z and -mabs(origpos.z - nextpos.z) *perc or mabs(origpos.z - nextpos.z) *perc | |
238 | WeldLib[weld][CO] = v3(origangle.x + tox,origangle.y + toy,origangle.z + toz) | |
239 | weld['C'..CO] = CF(origpos.x + tox2,origpos.y + toy2,origpos.z + toz2)*CA(origangle.x + tox,origangle.y + toy,origangle.z + toz) | |
240 | end | |
241 | ---------------------------------------- | |
242 | function GetTriangleValues(Points) | |
243 | local G, V = 0 | |
244 | for S = 1, 3 do | |
245 | local L = (Points[1+(S+1)%3]-Points[1+S%3]).magnitude | |
246 | G, V = L > G and L or G, L > G and {Points[1+(S-1)%3], Points[1+(S)%3], Points[1+(S+1)%3]} or V | |
247 | end | |
248 | local D = V[2]+(V[3]-V[2]).unit*((V[3]-V[2]).unit:Dot(V[1]-V[2])) | |
249 | local C, B = (D-V[1]).unit, (V[2]-V[3]).unit | |
250 | local A = B:Cross(C) | |
251 | S1 = V3(0, (V[2]-D).magnitude, (V[1]-D).magnitude)/1 --0.2 | |
252 | S2 = V3(0, (V[3]-D).magnitude, (V[1]-D).magnitude)/1 --0.2 | |
253 | C1 = CF(0,0,0,A.X,B.X,C.X,A.Y,B.Y,C.Y,A.Z,B.Z,C.Z)+(V[1]+V[2])/2 | |
254 | C2 = CF(0,0,0,-A.X,-B.X,C.X,-A.Y,-B.Y,C.Y,-A.Z,-B.Z,C.Z)+(V[1]+V[3])/2 | |
255 | return C1, C2, S1, S2 | |
256 | end | |
257 | ------ | |
258 | LoopFunctions={} | |
259 | function DoLoop(times,func) | |
260 | LoopFunctions[#LoopFunctions+1]={times,0,func} | |
261 | end | |
262 | ---------- | |
263 | MeshPack={} | |
264 | MeshEffect=function(i,ofs,trans,mesh,ofss,col,sc1,sc2) -- Interval>CFrame>Adj | |
265 | local sc2=sc2 | |
266 | if sc2 and type(sc2)=="number" then sc2=sc1*sc2 end | |
267 | local ob=INEW("Part",Model) | |
268 | ob.Anchored=true | |
269 | ob.CanCollide=false | |
270 | ob.TopSurface,ob.BottomSurface=0,0 | |
271 | ob.formFactor="Custom" | |
272 | ob.Name="Effect" | |
273 | ob.Size=v3(1,1,1) | |
274 | ob.CFrame=ofs | |
275 | ob.BrickColor=BrickColor.new(col or EffectColor) | |
276 | ob.Transparency=trans or 0.5 | |
277 | local obm | |
278 | if mesh=="Block" or mesh=="Cylinder" then | |
279 | obm=INEW(mesh.."Mesh",ob) | |
280 | elseif mesh:sub(1,3)=="htt" or mesh:sub(1,3)=="rbx" then | |
281 | obm=INEW("SpecialMesh",ob) | |
282 | obm.MeshType="FileMesh" | |
283 | obm.MeshId=mesh | |
284 | else | |
285 | obm=INEW("SpecialMesh",ob) | |
286 | obm.MeshType=mesh | |
287 | end | |
288 | obm.Scale=sc1 or v3(1,1,1) | |
289 | MeshPack[#MeshPack+1]={ob,1,-i,ofss or CF0,obm.Scale,sc2 or v30,ob.Transparency} | |
290 | end | |
291 | Effect1 = function(orig,adjj,radius,deg,parts,fade,wide,fadespeed) | |
292 | local orig = orig | |
293 | local adjj = adjj or CF(0,0,0) | |
294 | local radius=radius or 8 | |
295 | local deg=deg or 65 | |
296 | local parts=parts or 6 | |
297 | local fade=fade or 1 | |
298 | local wide = wide or 0.2 --mrnd(500,1500)/1000 | |
299 | local fadespeed=fadespeed or 0.05 | |
300 | local part={} | |
301 | for x=-deg/2,deg/2,deg/parts do | |
302 | local function reframe(x,radius,wide,orig) | |
303 | local xa=x-deg/parts/2 | |
304 | local xb=x+deg/parts/2 | |
305 | local xxa=math.sin(math.rad(xa))*radius*wide | |
306 | local zza=math.cos(math.rad(xa))*radius | |
307 | local xxb=math.sin(math.rad(xb))*radius*wide | |
308 | local zzb=math.cos(math.rad(xb))*radius | |
309 | local xx=math.sin(math.rad(x))*radius*wide | |
310 | local zz=math.cos(math.rad(x))*radius | |
311 | local kek=CF(orig*CF(xxa,0,zza).p,orig*CF(xxb,0,zzb).p)*CF(0,0,-(orig*CF(xxa,0,zzb).p-orig*CF(xx,0,zz).p).magnitude) | |
312 | local len=(orig*CF(xxa,0,zza).p-orig*CF(xxb,0,zzb).p).magnitude | |
313 | return kek,len | |
314 | end | |
315 | local kek,len = reframe(x,radius,wide,orig) | |
316 | local new=INEW("Part",Model) | |
317 | new.Anchored=true new.TopSurface=10 new.BottomSurface=10 | |
318 | new.CanCollide=false new.formFactor="Custom" new.Size=v3(0.2,0.2,0.2) | |
319 | new.BrickColor=BrickColor.new(EffectColor) new.Transparency=0.6 | |
320 | new.CFrame=kek | |
321 | newm=INEW("BlockMesh",new) | |
322 | newm.Scale=v3(0.5,0.1,len)*5 | |
323 | part[#part+1]={new,newm,x,CF(fade*radius/(1/fadespeed),0,0),reframe} --part,mesh,x,adj,func | |
324 | end | |
325 | DoLoop(1/fadespeed,function(i) | |
326 | orig=orig*adjj | |
327 | for x=1,#part do | |
328 | local kek,len=part[x][5](part[x][3],radius+fade*radius*i,wide,orig) | |
329 | part[x][1].CFrame=kek | |
330 | part[x][2].Scale=v3(0.5,0.1,0.01+len)*5 | |
331 | part[x][1].Transparency=0.6+0.4*i | |
332 | if i==1 then part[x][1]:Remove() end | |
333 | end | |
334 | end) | |
335 | end | |
336 | newMesh=function(parent,type,sx,sy,sz) | |
337 | local filemesh | |
338 | - | SkinColor="Pastel brown" |
338 | + | |
339 | - | Player=Players.LocalPlayer |
339 | + | |
340 | mesh=INEW(type.."Mesh",parent) | |
341 | elseif type:sub(1,4)=="http" or type:sub(1,3)=="rbx" then | |
342 | mesh=INEW("SpecialMesh",parent) | |
343 | mesh.MeshType="FileMesh" | |
344 | mesh.MeshId=type | |
345 | filemesh=true | |
346 | else | |
347 | mesh=INEW("SpecialMesh",parent) | |
348 | mesh.MeshType=type | |
349 | end | |
350 | if parent.Size.x<0.2001 then parent.CanCollide=false end | |
351 | local yes=parent.Size.x<0.2001 and 5 or 1 | |
352 | if filemesh then yes=1 end | |
353 | mesh.Scale=V3(sx or 1,sy or 1,sz or 1)*yes | |
354 | return mesh | |
355 | end | |
356 | Ca=function(a,b,c,d,e,f) | |
357 | local x,y,z=(CA(a,b,c)*CA(d,e,f)):toEulerAnglesXYZ() | |
358 | return v3(mdeg(x),mdeg(y),mdeg(z)) | |
359 | end | |
360 | ----- | |
361 | Ghost={} | |
362 | NewGhost=function(cff) | |
363 | local gho=#Ghost+1 | |
364 | Ghost[gho]={} | |
365 | Ghost[gho][1]=cff | |
366 | local ghom=INEW('Model',workspace) | |
367 | ghom.Name=Player.Name..'Ghost' | |
368 | Ghost[gho][2]=ghom | |
369 | Ghost[gho][3]=CF(0,1.5,0)*CA(0,90,0) | |
370 | Ghost[gho].Torso=INEW("Part",ghom) -- | |
371 | Ghost[gho].Torso.formFactor='Custom' | |
372 | Ghost[gho].Torso.Size=v3(2,2,1) | |
373 | Ghost[gho].Torso.Name='Torso' | |
374 | local kek=Ghost[gho].Torso | |
375 | Ghost[gho].Handle=kek:Clone() Ghost[gho].Handle.Name='Handle' Ghost[gho].Handle.Touched:connect(BladeFunc) | |
376 | Ghost[gho].Handle.Size=v3(0.4,pol+4,1)local mesh=INEW("SpecialMesh",Ghost[gho].Handle) mesh.MeshType='FileMesh' mesh.MeshId=as.Spear1 mesh.TextureId=as.Spear1T mesh.Scale=v3(3,3,3) | |
377 | Ghost[gho].Head=Ghost[gho].Handle:Clone() Ghost[gho].Head.Mesh.MeshId=as.Skull Ghost[gho].Head.Mesh.TextureId='' | |
378 | Ghost[gho].Head.Mesh.Scale=v3(1,1,1)/0.32 Ghost[gho].Head.Size=v3(1,1,1) | |
379 | Ghost[gho].Head.Name='Head' | |
380 | Ghost[gho].LA=kek:Clone() Ghost[gho].LA.Name=LA.Name Ghost[gho].LA.Size=v3(1,2,1) --LA:Clone() | |
381 | local kek=Ghost[gho].LA | |
382 | Ghost[gho].RA=kek:Clone() Ghost[gho].RA.Name=RA.Name --RA:Clone() | |
383 | Ghost[gho].LL=kek:Clone() Ghost[gho].LL.Name=LL.Name --LL:Clone() | |
384 | Ghost[gho].RL=kek:Clone() Ghost[gho].RL.Name=RL.Name --RL:Clone() | |
385 | Ghost[gho].Torso.Parent=ghom | |
386 | Ghost[gho].Head.Parent=ghom | |
387 | Ghost[gho].LA.Parent,Ghost[gho].RA.Parent,Ghost[gho].LL.Parent,Ghost[gho].RL.Parent,Ghost[gho].Handle.Parent=ghom,ghom,ghom,ghom,ghom | |
388 | local bp=INEW('BodyPosition',Ghost[gho].Handle) | |
389 | bp.maxForce=v31 | |
390 | bp.Name='bp' | |
391 | for i,v in pairs(ghom:children()) do v.CanCollide=false if v.Name~='Handle' then v.Anchored=true | |
392 | v.BrickColor=BrickColor.new'Really black' v.Transparency=0.1 v.TopSurface=0 v.BottomSurface=0 end end | |
393 | end | |
394 | ------ | |
395 | AOEDmg = function(pos,ra,dmg,func) -- range get | |
396 | local p0,p1=pos-v3(ra/2,ra/2,ra/2),pos+v3(ra/2,ra/2,ra/2) | |
397 | for i,v in pairs(workspace:FindPartsInRegion3(Region3.new(p0,p1),nil,100)) do | |
398 | local Hum=v.Parent:findFirstChild'Humanoid' | |
399 | if Hum and Hum.Health>0 and Hum~=Humanoid and (HitDB[Hum]==nil or (HitDB[Hum] and HitDB[Hum]<time())) then | |
400 | HitDB[Hum]=time()+0.08 | |
401 | fDamage(dmg,v,Hum) | |
402 | if func then func(v,Hum) end | |
403 | elseif not Hum then | |
404 | --------- | |
405 | end | |
406 | end | |
407 | end | |
408 | ------- | |
409 | GetX = function(Part,Point) | |
410 | local x,y,z=Part.CFrame:toObjectSpace(CFrame.new(Part.Position,Point)):toEulerAnglesXYZ() | |
411 | return math.deg(x) | |
412 | end | |
413 | GetY = function(Part,Point) | |
414 | local x,y,z=Part.CFrame:toObjectSpace(CFrame.new(Part.Position,Point)):toEulerAnglesXYZ() | |
415 | return math.deg(y) | |
416 | end | |
417 | ----- | |
418 | --AddBV=function(str,cfr,par,deb,yy) | |
419 | --return qi{'BodyVelocity',par,velocity=cfr.lookVector*str,maxForce=v3(1/0,not yy and 1/0 or 0,1/0),Debris=deb,n='LibBV'} | |
420 | ---- | |
421 | ||
422 | Name="weapon" | |
423 | SkinColor="New Yeller" | |
424 | Player=Players.Owner | |
425 | Character=Player.Character | |
426 | Torso,Head,Humanoid=Character.Torso,Character.Head,Character.Humanoid | |
427 | HRP=Character.HumanoidRootPart.RootJoint | |
428 | Neck=Torso.Neck | |
429 | oHRP=Character.HumanoidRootPart | |
430 | ||
431 | pcall(function() Player.Backpack[Name]:Remove() end) | |
432 | pcall(function() Character[Name]:Remove() end) | |
433 | for i,v in pairs(workspace:children()) do if v.Name==Player.Name.."Ghost" then v:Remove() end end | |
434 | ||
435 | Tool=INEW("HopperBin",Player.Backpack) | |
436 | Tool.Name=Name | |
437 | ||
438 | Model=INEW("Model",Character) | |
439 | Model.Name=Name | |
440 | ||
441 | -----------------------------LimbWelds | |
442 | LA=Character["Left Arm"] | |
443 | RA=Character["Right Arm"] | |
444 | LL=Character["Left Leg"] | |
445 | RL=Character["Right Leg"] | |
446 | LS=Torso:findFirstChild("Left Shoulder") or _G.LS | |
447 | RS=Torso:findFirstChild("Right Shoulder") or _G.RS | |
448 | LH=Torso:findFirstChild("Left Hip") or _G.LL | |
449 | RH=Torso:findFirstChild("Right Hip") or _G.RL | |
450 | _G.LS,_G.RS,_G.LH,_G.RH=LS,RS,LH,RH | |
451 | LA:BreakJoints() RA:BreakJoints() LL:BreakJoints() LL:BreakJoints() | |
452 | LS.Parent,RS.Parent,LH.Parent,RH.Parent=Torso,Torso,Torso,Torso | |
453 | LS.Part0,RS.Part0,LH.Part0,RH.Part0=Torso,Torso,Torso,Torso | |
454 | LS.Part1,RS.Part1,LH.Part1,RH.Part1=LA,RA,LL,RL | |
455 | cLA0,cLA1=CF(-1.5,0.5,0),CF(0,0.5,0) | |
456 | cRA0,cRA1=CF(1.5,0.5,0),CF(0,0.5,0) | |
457 | cLL0,cLL1=CF(-0.5,-1,0),CF(0,1,0) | |
458 | cRL0,cRL1=CF(0.5,-1,0),CF(0,1,0) | |
459 | for i,v in pairs{"LS","RS","LH","RH"} do | |
460 | local w=getfenv()[v] | |
461 | getfenv()["a"..v.."0"]=_G["RMo1"..v] or w.C0.p | |
462 | getfenv()["a"..v.."1"]=_G["RMo2"..v] or w.C1.p | |
463 | local a,b,c=w.C0:toEulerAnglesXYZ() | |
464 | local x,y,z=w.C1:toEulerAnglesXYZ() | |
465 | getfenv()["b"..v.."0"]=_G["RMo3"..v] or v3(mdeg(a),mdeg(b),mdeg(c)) | |
466 | getfenv()["b"..v.."1"]=_G["RMo4"..v] or v3(mdeg(x),mdeg(y),mdeg(z)) | |
467 | _G["RMo1"..v]=getfenv()["a"..v.."0"] | |
468 | _G["RMo2"..v]=getfenv()["a"..v.."1"] | |
469 | _G["RMo3"..v]=getfenv()["b"..v.."0"] | |
470 | _G["RMo4"..v]=getfenv()["b"..v.."1"] | |
471 | end | |
472 | ------Sounds | |
473 | for i,v in pairs(Torso:children()) do | |
474 | if v:IsA'Sound' then v:Remove() end | |
475 | end | |
476 | for i,v in pairs(oHRP:children()) do | |
477 | if v.Name:sub(1,2)=="RM" then v:Remove() end | |
478 | end | |
479 | HRPDist = function(pos,adj) return (oHRP.Position-CF(pos,oHRP.Position)*CF(0,0,adj and -adj or 0).p).magnitude end | |
480 | oBP=INEW("BodyPosition",oHRP) | |
481 | oBG=INEW("BodyGyro",oHRP) | |
482 | oBV=INEW("BodyVelocity",oHRP) | |
483 | oBP.Name="RMBP" | |
484 | oBG.Name="RMBG" | |
485 | oBV.Name="RMBV" | |
486 | oBP.maxForce=v30 | |
487 | oBP.D=500 | |
488 | oBG.maxTorque=v30 | |
489 | oBG.D=100 | |
490 | oBV.maxForce=v30 | |
491 | DoBP=function(pos,adj) | |
492 | if not pos then oBP.maxForce=v30 return end | |
493 | oBP.maxForce=v31 --(1/0,0,1/0) | |
494 | oBP.position=(CF(pos,oHRP.Position)*CF(0,0,adj and -adj or 0)).p | |
495 | end | |
496 | DoBG=function(pos) | |
497 | if not pos then oBG.maxTorque=v30 return end | |
498 | oBG.maxTorque=v31 | |
499 | oBG.cframe=CF(oHRP.Position,v3(pos.x,oHRP.Position.y,pos.z)) | |
500 | - | part=newPart(0,0,0,nil,nil,'Dark stone grey') |
500 | + | |
501 | for i,n in pairs(so2) do | |
502 | so[n]={} | |
503 | so[n].Pitch=1 | |
504 | so[n].Volume=1 | |
505 | so[n].SoundId=as[n] | |
506 | so[n].Play=function(table) | |
507 | local v=INEW("Sound",Torso) | |
508 | v.Volume=so[n].Volume | |
509 | v.Pitch=so[n].Pitch | |
510 | v.Looped=false | |
511 | v.Name=n | |
512 | v.SoundId=as[n] | |
513 | v:Play() | |
514 | Debris:AddItem(v,5) | |
515 | end | |
516 | end | |
517 | SlashPitch=1.3 | |
518 | so.Slash.Pitch=SlashPitch | |
519 | ||
520 | wLA=newWeld(nil,nil,nil,cLA0,cLA1) wLA.Name="left shoulder" | |
521 | wRA=newWeld(nil,nil,nil,cRA0,cRA1) wRA.Name="right shoulder" | |
522 | wLL=newWeld(nil,nil,nil,cLL0,cLL1) wLL.Name="left hip" | |
523 | wRL=newWeld(nil,nil,nil,cRL0,cRL1) wRL.Name="right hip" | |
524 | Arms = function(on) | |
525 | if on then | |
526 | LS.Parent,RS.Parent=nil,nil | |
527 | LS.Part0,RS.Part0=nil,nil | |
528 | LS.Part1,RS.Part1=nil,nil | |
529 | wLA.Parent,wRA.Parent=Torso,Torso | |
530 | wLA.Part0,wRA.Part0=Torso,Torso | |
531 | wLA.Part1,wRA.Part1=LA,RA | |
532 | else | |
533 | wLA.Parent,wRA.Parent=nil,nil | |
534 | wLA.Part0,wRA.Part0=nil,nil | |
535 | wLA.Part1,wRA.Part1=nil,nil | |
536 | LS.Parent,RS.Parent=Torso,Torso | |
537 | LS.Part0,RS.Part0=Torso,Torso | |
538 | LS.Part1,RS.Part1=LA,RA | |
539 | end | |
540 | end | |
541 | LegUse = false | |
542 | Legs= function(on) | |
543 | LegUse=on | |
544 | if on then | |
545 | LH.Parent,RH.Parent=nil,nil | |
546 | LH.Part0,RH.Part0=nil,nil | |
547 | LH.Part1,RH.Part1=nil,nil | |
548 | wLL.Parent,wRL.Parent=Torso,Torso | |
549 | wLL.Part0,wRL.Part0=Torso,Torso | |
550 | wLL.Part1,wRL.Part1=LL,RL | |
551 | else | |
552 | wLL.Parent,wRL.Parent=nil,nil | |
553 | wLL.Part0,wRL.Part0=nil,nil | |
554 | wLL.Part1,wRL.Part1=nil,nil | |
555 | LH.Parent,RH.Parent=Torso,Torso | |
556 | LH.Part0,RH.Part0=Torso,Torso | |
557 | LH.Part1,RH.Part1=LL,RL | |
558 | end | |
559 | end | |
560 | Arms() | |
561 | Legs() | |
562 | WalkBrick=INEW("Part",Model) | |
563 | WalkBrick.Anchored=true WalkBrick.Size=Vector3.new(1,1,1) | |
564 | WalkBrick.Transparency=1 WalkBrick.CanCollide=false | |
565 | WalkBrick.CFrame=CF(0,-10,0) | |
566 | ----------------------------------------------------- | |
567 | Color1="Black" | |
568 | Color2="Bright yellow" | |
569 | Color3="Pastel brown" | |
570 | EffectColor="Bright yellow" | |
571 | ||
572 | pol=4 | |
573 | Handle=newPart(0,0,0,nil,nil,Color1) | |
574 | Handlem=newMesh(Handle,"Cylinder",0.2,pol-0.33,0.2) | |
575 | wHandle=newWeld(Handle,Torso,Handle,CF(0.8,1.5,0.43)*CA(-25,0,135)) | |
576 | tpol=CF(0,2+(pol+4)/2,0) | |
577 | HitBox=newPart(0.3,tpol.y,0.8) | |
578 | HitBox.CanCollide=false | |
579 | HitBox.Transparency=1 | |
580 | wHitBox=newWeld(HitBox,Handle,HitBox,CF(0,tpol.y/2,0)) | |
581 | oHandle0,oHandle1=GetWeld(wHandle) | |
582 | ---bottomdesignvv | |
583 | for x=-1,1,2 do | |
584 | for xx=-1,1,2 do | |
585 | part=newPart(0,0,0,nil,nil,'Lapis') | |
586 | partm=newMesh(part,as.diamond,0.2,0.15,0.4) | |
587 | partw=newWeld(part,Handle,part,CF(0,x*(pol/2-0.08),0*x)*CA(55*xx,0,0)) | |
588 | end | |
589 | part=newPart(0,0,0,nil,nil,Color1) | |
590 | partm=newMesh(part,as.cone,0.06,1,0.06) | |
591 | partw=newWeld(part,Handle,part,CF(0,-pol/2-1.05,0.1*x)*CA(180,0,0)) | |
592 | local thecf=CF(0,-pol/2-0.7,0.1*x)*CA(90*x+(-90*x/3),0,0) | |
593 | for i=1,3 do | |
594 | part=newPart(0,0,0,nil,nil,Color1) | |
595 | partm=newMesh(part,as.cone,0.09,0.4,0.09) | |
596 | partw=newWeld(part,Handle,part,thecf) | |
597 | thecf=thecf*CA(-90*x/3,0,0)*CF(0,0.2,0.035*x) | |
598 | end | |
599 | end | |
600 | ---botomdesign^^^ | |
601 | local xx=37 | |
602 | for x=-1,1,2 do | |
603 | local thecf=CF(0,pol/2,0) | |
604 | for lel=0.17,0.31,(0.3-0.17)/2 do | |
605 | part=newPart(0,0,0,nil,nil,Color1) | |
606 | partm=newMesh(part,"Block",0.12,lel+0.04,0.06) | |
607 | thecf=thecf*CA(-xx*x,0,0)*CF(0,lel/2,0) | |
608 | partw=newWeld(part,Handle,part,thecf) | |
609 | local outline=part:Clone() outline.Parent=part | |
610 | newWeld(outline,part,outline) outline.Mesh.Scale=outline.Mesh.Scale+(V3(-0.03,0.025,0.03)*5) | |
611 | outline.BrickColor=BrickColor.new(Color2) | |
612 | ---- | |
613 | part=newPart(0,0,0,nil,nil,Color1) | |
614 | partm=newMesh(part,"Block",0.12,lel+0.04,0.06) | |
615 | thecf=thecf*CF(0,lel/2,0)*CA(xx*2*x,0,0)*CF(0,lel/2,0) | |
616 | partw=newWeld(part,Handle,part,thecf) | |
617 | local outline=part:Clone() outline.Parent=part | |
618 | newWeld(outline,part,outline) outline.Mesh.Scale=outline.Mesh.Scale+(V3(-0.03,0.025,0.03)*5) | |
619 | outline.BrickColor=BrickColor.new(Color2) | |
620 | ------ | |
621 | thecf=thecf*CF(0,lel/2,0)*CA(-xx*x,0,0) | |
622 | end | |
623 | end | |
624 | ----botom | |
625 | local xx=30 | |
626 | for x=-1,1,2 do | |
627 | local thecf=CF(0,-pol/2,0)*CA(180,0,0) | |
628 | for lel=0.14,0.26,(0.25-0.14) do | |
629 | part=newPart(0,0,0,nil,nil,Color1) | |
630 | partm=newMesh(part,"Block",0.12,lel+0.04,0.06) | |
631 | thecf=thecf*CA(-xx*x,0,0)*CF(0,lel/2,0) | |
632 | partw=newWeld(part,Handle,part,thecf) | |
633 | local outline=part:Clone() outline.Parent=part | |
634 | newWeld(outline,part,outline) outline.Mesh.Scale=outline.Mesh.Scale+(V3(-0.03,0.025,0.03)*5) | |
635 | outline.BrickColor=BrickColor.new(Color2) | |
636 | ---- | |
637 | part=newPart(0,0,0,nil,nil,Color1) | |
638 | partm=newMesh(part,"Block",0.12,lel+0.04,0.06) | |
639 | thecf=thecf*CF(0,lel/2,0)*CA(xx*2*x,0,0)*CF(0,lel/2,0) | |
640 | partw=newWeld(part,Handle,part,thecf) | |
641 | local outline=part:Clone() outline.Parent=part | |
642 | newWeld(outline,part,outline) outline.Mesh.Scale=outline.Mesh.Scale+(V3(-0.03,0.025,0.03)*5) | |
643 | outline.BrickColor=BrickColor.new(Color2) | |
644 | ------ | |
645 | thecf=thecf*CF(0,lel/2,0)*CA(-xx*x,0,0) | |
646 | end | |
647 | end | |
648 | part=newPart(0,0,0,nil,nil,"Bright orange") | |
649 | partm=newMesh(part,"Sphere",0.2,0.35,0.35) | |
650 | partw=newWeld(part,Handle,part,CF(0,pol/2+1.4,0)) | |
651 | partx=newPart(0,0,0,nil,nil,Color3) | |
652 | newMesh(partx,"Cylinder",0.4,0.11,0.4) | |
653 | newWeld(part,Handle,partx,CF(0,pol/2+1.4,0)*CA(0,0,90)) | |
654 | part=newPart(0,0,0,nil,nil,Color1) | |
655 | partm=newMesh(part,"Cylinder",0.36,0.1,0.36) | |
656 | partw=newWeld(part,Handle,part,CF(0,pol/2+1.45,0)*CA(0,0,90)) | |
657 | ----right half | |
658 | local blade1=CF(0,pol/2+1.6,-0.15) | |
659 | -- | |
660 | local blens={2.4,1.6,0.8,0.2,0.3,0.4} | |
661 | for i=1,3 do | |
662 | local len=blens[i] | |
663 | local wid=blens[i+3] | |
664 | part=newPart(0,0,0,nil,nil,Color1) | |
665 | partm=newMesh(part,"Wedge",0.1+(0.01*i),len,wid) | |
666 | partw=newWeld(part,Handle,part,blade1*CF(0,len/2,-0.17+0.3-wid/2)) | |
667 | part=newPart(0,0,0) | |
668 | partm=newMesh(part,"Wedge",0.06,len,wid) | |
669 | partw=newWeld(part,Handle,part,blade1*CF(0,len/2,-0.18+0.3-wid/2)) | |
670 | end | |
671 | -- | |
672 | function makedia(cur,xx,len,ii,ad,ad2) | |
673 | local ad = ad or 0 | |
674 | local ad2=ad2 or 0 | |
675 | part=newPart(0,0,0,nil,nil,Color1) | |
676 | partm=newMesh(part,as.diamond,0.05+ad/10,0.25+len,xx/120) | |
677 | partw=newWeld(part,Handle,part,cur*CA(ii,0,0)*CF(0,0.1+len,0)) | |
678 | for x=-1,1,2 do | |
679 | part=newPart(0,0,0,nil,nil,Color3) | |
680 | partm=newMesh(part,"Block",0.12+ad+(0.01*x),len+0.02,0.05+ad2) | |
681 | partw=newWeld(part,Handle,part,cur*CA(ii,0,0)*CF(0,0.18,0)*CA(xx*x,0,0)*CF(0,len/2,0)) | |
682 | part=newPart(0,0,0,nil,nil,Color3) | |
683 | partm=newMesh(part,"Block",0.12+ad+(0.01*x),len+0.02,0.05+ad2) | |
684 | partw=newWeld(part,Handle,part,cur*CA(ii,0,0)*CF(0,0.18,0)*CA(xx*x,0,0)*CF(0,len,0)*CA(-xx*x*2,0,0)*CF(0,len/2,0)) | |
685 | end | |
686 | end | |
687 | makedia(blade1*CF(0,-0.29,-0.03+0.025),20,0.4,90+33,0,0.03) | |
688 | makedia(blade1*CF(0,0.04,0.25),20,0.35,-90-20) | |
689 | makedia(blade1*CF(0,0.05,0.1),20,0.35,-90-60,0.01) | |
690 | --makedia(blade1*CF(0,-0.15,-0.025),15,0.4,-90-90,0.05) | |
691 | part=newPart(0,0,0,nil,nil,Color1) | |
692 | partm=newMesh(part,as.cone,0.04,0.5,0.18) | |
693 | partw=newWeld(part,Handle,part,blade1*CF(0,-0.625,-0.1)*CA(-135,0,0)*CF(0,-0.15,0)) | |
694 | local cur=blade1*CF(0,-0.625,-0.1)*CA(-135,0,0)*CF(0,0,0) | |
695 | for i=1,3 do | |
696 | part=newPart(0,0,0,nil,nil,Color1) | |
697 | partm=newMesh(part,as.cone,0.1,0.5,0.1) | |
698 | partw=newWeld(part,Handle,part,cur) | |
699 | cur=cur*CA(-23,0,0)*CF(0,0.25,0.02) | |
700 | end | |
701 | for i=1,4 do | |
702 | part=newPart(0,0,0,nil,nil,Color1) | |
703 | partm=newMesh(part,as.cone,0.1,0.5,0.1) | |
704 | partw=newWeld(part,Handle,part,cur) | |
705 | cur=cur*CA(i==7 and 20 or 30,0,0)*CF(0,0.25,-0.02) | |
706 | end | |
707 | --------------------------------------------- | |
708 | ----left half | |
709 | local blade1=CF(0,pol/2+1.4,0.05)*CA(0,180,0) | |
710 | -- | |
711 | part=newPart(0,0,0,nil,nil,Color1) | |
712 | partm=newMesh(part,"Wedge",0.1,2,0.2) | |
713 | partw=newWeld(part,Handle,part,blade1*CF(0,1,-0.1)) | |
714 | part=newPart(0,0,0) | |
715 | partm=newMesh(part,"Wedge",0.06,2,0.2) | |
716 | partw=newWeld(part,Handle,part,blade1*CF(0,1,-0.11)) | |
717 | part=newPart(0,0,0,nil,nil,Color1) | |
718 | partm=newMesh(part,"Wedge",0.1,0.4,0.37) | |
719 | - | WalkSpeed=18 |
719 | + | |
720 | part=newPart(0,0,0,nil,nil,'') | |
721 | partm=newMesh(part,"Wedge",0.06,0.4,0.37) | |
722 | partw=newWeld(part,Handle,part,blade1*CF(0,-0.06,-0.24)*CA(-10,0,0)) | |
723 | part=newPart(0,0,0,nil,nil,Color1) | |
724 | partm=newMesh(part,"Wedge",0.06,0.2,0.425) | |
725 | partw=newWeld(part,Handle,part,blade1*CF(0,-0.7,-0.16)*CA(-90-35,0,0)) | |
726 | -----------------------------------------------------------WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW--stufs | |
727 | --Basic poses: | |
728 | Pose={"None","Walking","Running","Jumping","Jumping2","Sitting"} | |
729 | for i,v in pairs(Pose) do | |
730 | Pose[v]={ --1=Adj Speed 0=C0xyz 1=C1xyz 2=C0abc 3=C1abc | |
731 | ["Handle"]={[0]=v3(0,-1.1,0),[1]=v3(0,0,0),[2]=v3(-90,0,0),[3]=v3(-20,20,0)}, | |
732 | ["HRP"]={[-1]=0,[0]=v30,[1]=v30,[2]=v3(0,0,0),[3]=v3(0,0,0)}, | |
733 | ["Neck"]={[0]=v3(0,1,0),[1]=v3(0,-0.5,0),[2]=v3(0,0,0),[3]=v3(0,0,0)}, | |
734 | ["LA"]={[-1]=1,[0]=cLA0,[1]=cLA1,[2]=v3(-20,0,-10)}, | |
735 | ["RA"]={[-1]=0.75,[0]=cRA0,[1]=cRA1,[2]=v3(20,20,15)}, | |
736 | ["LH"]={[-1]=1,[0]=aLH0,[1]=aLH1,[2]=bLH0,[3]=bLH1}, | |
737 | ["RH"]={[-1]=1,[0]=aRH0,[1]=aRH1,[2]=bRH0,[3]=bRH1} | |
738 | } | |
739 | end | |
740 | --Fixes | |
741 | xHRP=v3(-90,0,-180) | |
742 | xNeck=v3(-90,0,180) | |
743 | local xHRP0,xHRP1=Pose.None.HRP[0],Pose.None.HRP[1] | |
744 | HRP.C0=CF(xHRP0.x,xHRP0.y,xHRP0.z)*CA(xHRP.x,xHRP.y,xHRP.z) | |
745 | HRP.C1=CF(xHRP1.x,xHRP1.y,xHRP1.z)*CA(xHRP.x,xHRP.y,xHRP.z) | |
746 | local xNeck0,xNeck1=Pose.None.Neck[0],Pose.None.Neck[1] | |
747 | Neck.C0=CF(xNeck0.x,xNeck0.y,xNeck0.z)*CA(xNeck.x,xNeck.y,xNeck.z) | |
748 | Neck.C1=CF(xNeck1.x,xNeck1.y,xNeck1.z)*CA(xNeck.x,xNeck.y,xNeck.z) | |
749 | ------Set pose: | |
750 | RunLean=30 | |
751 | JumpLean=50 | |
752 | -----Walking | |
753 | Pose.Walking.HRP[-1]=0.25 | |
754 | Pose.Walking.Handle[3]=v3(0,0,0) | |
755 | Pose.Walking.RA[2]=v3(0,15,30) | |
756 | Pose.Walking.LA[2]=v3(0,-15,-20) | |
757 | Pose.Walking.LA[-1]=1 | |
758 | --Running | |
759 | Pose.Running.HRP[-1]=1.4 | |
760 | Pose.Running.HRP[2]=v3(-RunLean,0,0) | |
761 | Pose.Running.Neck[2]=v3(RunLean,0,0) | |
762 | Pose.Running.Handle[1]=v3(0,1.2,0) | |
763 | Pose.Running.Handle[3]=v3(-30,0,0) | |
764 | Pose.Running.RA[2]=v3(-30,-35,15) | |
765 | Pose.Running.LA[0]=v3(-1.35,0.5,-0.6) | |
766 | Pose.Running.LA[2]=v3(100,0,30) | |
767 | Pose.Running.LA[-1]=1 | |
768 | --Jumping | |
769 | Pose.Jumping.Handle[1]=v3(0,-1.5,0) | |
770 | Pose.Jumping.Handle[3]=v3(-45,0,0) | |
771 | Pose.Jumping.RA[2]=v3(200,20,0) | |
772 | Pose.Jumping.LA[2]=v3(-45,0,-20) | |
773 | Pose.Jumping.LH[0]=Pose.Jumping.LH[0]+v3(-0.03,0.3,-1) | |
774 | Pose.Jumping.LH[2]=Pose.Jumping.LH[2]+v3(-45,0,18) | |
775 | Pose.Jumping.RH[0]=Pose.Jumping.RH[0]+v3(0.03,0.25,-0.3) | |
776 | Pose.Jumping.RH[2]=Pose.Jumping.RH[2]+v3(-15,0,-18) | |
777 | --Jumping2 | |
778 | Pose.Jumping2.HRP[2]=v3(-JumpLean,0,0) | |
779 | Pose.Jumping2.Neck[2]=v3(JumpLean,0,0) | |
780 | Pose.Jumping2.Handle[1]=v3(0,-1.5,0) | |
781 | Pose.Jumping2.Handle[3]=v3(-45,0,0) | |
782 | Pose.Jumping2.RA[2]=v3(200,20,0) | |
783 | Pose.Jumping2.LA[0]=v3(-1.4,0.6,-0.1) | |
784 | Pose.Jumping2.LA[2]=v3(180-JumpLean,0,10) | |
785 | Pose.Jumping2.LH[0]=Pose.Jumping2.LH[0]+v3(-0.03,0.3,-1) | |
786 | Pose.Jumping2.LH[2]=Pose.Jumping2.LH[2]+v3(-45,0,18) | |
787 | Pose.Jumping2.RH[0]=Pose.Jumping2.RH[0]+v3(0.03,0.25,-0.3) | |
788 | Pose.Jumping2.RH[2]=Pose.Jumping2.RH[2]+v3(-15,0,-18) | |
789 | ---Sitting | |
790 | Pose.Sitting.Handle[1]=v3(0,1,0) | |
791 | Pose.Sitting.Handle[3]=v3(-10,0,0) | |
792 | Pose.Sitting.RA[2]=v3(-50,0,150) | |
793 | Pose.Sitting.RA[-1]=0 | |
794 | Pose.Sitting.HRP[0]=v3(0,-1.75,0) | |
795 | Pose.Sitting.HRP[2]=v3(20,0,0) | |
796 | Pose.Sitting.LH[0]=Pose.Sitting.LH[0]+v3(0,0.1,-0.1) | |
797 | Pose.Sitting.LH[2]=Ca(70,-90,0,-10,-5,0) | |
798 | Pose.Sitting.RH[0]=Pose.Sitting.RH[0]+v3(0,0.1,-0.1) | |
799 | Pose.Sitting.RH[2]=Ca(70,90,0,-10,5,0) | |
800 | ---------------- | |
801 | Anim="Deselected" | |
802 | LegAnim="None" | |
803 | ArmAnim="None" | |
804 | WalkSpeed=30 | |
805 | WalkM={1,1,1,1,1,1,1,1,1,1} -- multiplier | |
806 | aSpd=8 | |
807 | BladeTrail=false | |
808 | JumpDebounce=time() | |
809 | Key={} | |
810 | ---------- | |
811 | GetFrontRay = function(cff,Dist,X,Y,Z,Exclude) | |
812 | local cff = cff or oHRP.CFrame | |
813 | local Hit,Pos,Hum,Torso | |
814 | local Hits={} | |
815 | for i,v in pairs(workspace:children()) do | |
816 | if v~=Exclude and v~=Character and v:findFirstChild'Humanoid' and v.Humanoid.Health>0 and v:findFirstChild'Torso' then | |
817 | local cor=cff:toObjectSpace(v.Torso.CFrame) | |
818 | if cor.x<X[2] and cor.x>X[1] and cor.y<Y[2] and cor.y>Y[1] and -cor.z<Z[2] and -cor.z>Z[1] and -cor.z<Dist then | |
819 | if Dist>800 then | |
820 | local i=#Hits+1 | |
821 | Hits[i]={} | |
822 | Hits[i][1]=v.Torso | |
823 | Hits[i][2]=v.Humanoid | |
824 | Hits[i][3]=CF(v3(v.Torso.Position.x,cff.y,v.Torso.Position.z),cff.p)*CF(0,0,-(v.Torso.Size.x+v.Torso.Size.z)/2).p | |
825 | else | |
826 | Hit,Pos=v.Torso,CF(v3(v.Torso.Position.x,cff.y,v.Torso.Position.z),cff.p)*CF(0,0,-(v.Torso.Size.x+v.Torso.Size.z)/2).p | |
827 | Dist,Hum,Torso=-cor.z,v.Humanoid,v.Torso | |
828 | end | |
829 | end | |
830 | end | |
831 | end | |
832 | if Dist>800 then return Hits end | |
833 | return Hit,(Pos or cff*CF(0,0,-Dist-1).p),Dist,Hum,Torso | |
834 | end | |
835 | --------------------------------------------------- | |
836 | onKeyDown = function(k) | |
837 | local FrontHit,FrontHitPos,FrontHitDist,FrontHitHum,FrontHitTorso=GetFrontRay(nil,200,{-3,3},{-3,3},{5,300}) | |
838 | ------------------------- | |
839 | local MouseHit,MouseHitPos=Mouse.Target,Mouse.Hit.p | |
840 | local MouseHitDist=(oHRP.Position-MouseHitPos).magnitude | |
841 | MouseHit=(MouseHit and MouseHit.Parent:IsA'Hat') and MouseHit.Parent.Parent:findFirstChild'Torso' or MouseHit | |
842 | local MouseHitHum=MouseHit and MouseHit.Parent:findFirstChild'Humanoid' | |
843 | local MouseHitTorso=MouseHit and MouseHit.Parent:findFirstChild'Torso' | |
844 | -------------------------------- | |
845 | if k=="0" and Anim=="Walking" then | |
846 | Anim="Running" | |
847 | --Pierce Burst | |
848 | elseif k=="0" and Anim=="Stance1" then | |
849 | Anim="Stance1P" | |
850 | local bSpd=aSpd-2 | |
851 | GetRecent() | |
852 | for i=1,bSpd do | |
853 | SetWeld(wHandle,1,i,bSpd,phandle1,phandle3,Pose.None.Handle[1]+v3(0,-1.5,0),v3(90,-15,0)) | |
854 | SetWeld(wRA,0,i,bSpd,pra0,pra2,v3(1.1,0.5,-0.7),Ca(90,0,-60,3,0,0)) | |
855 | SetWeld(wLA,0,i,bSpd,pla0,pla2,v3(-1.2,0.5,-0.5),Ca(90,0,-45,3,0,0)) | |
856 | MeshEffect(0.1,oHRP.CFrame*CF(0,-GroundRange+0.5,0),0.5,as.blast,CA(0,10,0),GroundColor,v3(0.5,0.1,0.5)*5,v3(0.5,0,0.5)*5) | |
857 | wait() | |
858 | end | |
859 | repeat ------ repeatative | |
860 | if FrontHitDist>12 and FrontHitHum then --hax | |
861 | so.Slash:Play() | |
862 | MeshEffect(0.1,CF(oHRP.Position,FrontHitPos)*CF(0,0,2),0.5,as.ring,nil,EffectColor,v3(1.5,1.5,0)*5,v3(1,1,0)*5) | |
863 | DoBP(FrontHitPos,5) | |
864 | DoBG(FrontHitPos) | |
865 | local timee=time() | |
866 | repeat | |
867 | BladeTrail=true | |
868 | MeshEffect(0.1,oHRP.CFrame*CF(0,-GroundRange+0.5,0),0.5,as.blast,CA(0,10,0),GroundColor,v3(0.5,0.1,0.5)*5,v3(0.5,0,0.5)*5) | |
869 | wait() until timee+2.5<time() or HRPDist(FrontHitPos,5)<2 | |
870 | DoBP() | |
871 | DoBG() | |
872 | Torso.Velocity=v30 | |
873 | oHRP.Velocity=v30 | |
874 | BladeTrail=false | |
875 | if HRPDist(FrontHitPos,5)<2 then | |
876 | AOEDmg(HitBox.CFrame*CF(0,HitBox.Size.y,0).p,8,Damage/2,function() so.Hit:Play() end) | |
877 | so.Abscond:Play() | |
878 | local BoomCF=CF(v3(FrontHitPos.x,oHRP.Position.y-3,FrontHitPos.z),oHRP.Position-v3(0,3,0))*CA(0,180,0) | |
879 | MeshEffect(0.07,BoomCF,0.05,'Sphere',CA(0,0,0),GroundColor,v3(5,5,5),v3(5,10,5)) | |
880 | MeshEffect(0.07,BoomCF*CF(0,0.5,0),0.05,as.blast,CA(0,15,0),GroundColor,v3(5,0.75,5),1.1) | |
881 | for i=30,360,30 do | |
882 | MeshEffect(0.08,HitBox.CFrame*CF(0,HitBox.Size.y/2,0)*CA(0,i,165)*CF(0,i%60==0 and 1 or 0,0),0.2,as.diamond,CF(0,0.5,0),EffectColor,v3(0.6,2.4,0.6),v3(0,2,0)) | |
883 | end --mesh360 | |
884 | else | |
885 | DoBP() | |
886 | DoBG() | |
887 | end --dist | |
888 | end --hax | |
889 | wait() | |
890 | FrontHit,FrontHitPos,FrontHitDist,FrontHitHum,FrontHitTorso=GetFrontRay(nil,200,{-3,3},{-3,3},{12,300},FrontHit and FrontHit.Parent) | |
891 | until not Key[k] | |
892 | Anim="Stance1P2" | |
893 | local xhrp0,xhrp1=GetWeld(HRP) | |
894 | local xa,xb=GetWeld(Neck) | |
895 | local xr1,xr2=GetWeld(wRA) | |
896 | local xl1,xl2=GetWeld(wLA) | |
897 | local xhh1,xhh2=GetWeld(wHandle,1) | |
898 | for i=1,aSpd do | |
899 | if Anim~="Stance1P2" then break end | |
900 | SetWeld(HRP,0,i,aSpd,xhrp0,xhrp1,phrp0,phrp2) | |
901 | SetWeld(wHandle,1,i,aSpd,xhh1,xhh2,phandle1,phandle3) | |
902 | SetWeld(wRA,0,i,aSpd,xr1,xr2,pra0,pra2) | |
903 | SetWeld(wLA,0,i,aSpd,xl1,xl2,pla0,pla2) | |
904 | wait() | |
905 | end | |
906 | if Anim~="Stance1P2" then return end | |
907 | Anim="Stance1" | |
908 | --Spinning Slash | |
909 | elseif k=="q" and Anim=="Stance1" then | |
910 | Anim="Stance1Spin" | |
911 | BladeTrail=true | |
912 | local bSpd=aSpd+5 | |
913 | GetRecent() | |
914 | so.Slash:Play() | |
915 | for i=1,bSpd do | |
916 | SetWeld(HRP,0,i,bSpd,phrp0,phrp2,Pose.None.HRP[0],Pose.None.HRP[2]+v3(-3,-360-70,0)) | |
917 | SetWeld(wHandle,1,i,bSpd,phandle1,phandle3,Pose.None.Handle[1]+v3(0,-1.5,0),v3(111,0,-105)) | |
918 | SetWeld(wRA,0,i,bSpd,pra0,pra2,v3(1.1,0.5,-0.7),Ca(90,0,-45,0,0,0)) | |
919 | SetWeld(wLA,0,i,bSpd,pla0,pla2,v3(-1.2,0.5,-0.5),Ca(90,0,30,0,0,0)) | |
920 | SetWeld(LH,0,i,bSpd,plh0,plh2,Pose.None.LH[0],Ca(0,-90,0,-10,0,0)) | |
921 | SetWeld(RH,0,i,bSpd,prh0,prh2,Pose.None.RH[0],Ca(0,90,0,-20,0,0)) | |
922 | wait() | |
923 | end | |
924 | ClearWeld(HRP) | |
925 | BladeTrail=false | |
926 | local xhrp0,xhrp1=GetWeld(HRP) | |
927 | local xa,xb=GetWeld(Neck) | |
928 | local xr1,xr2=GetWeld(wRA) | |
929 | local xl1,xl2=GetWeld(wLA) | |
930 | local xlh1,xlh2=GetWeld(LH) | |
931 | local xrh1,xrh2=GetWeld(RH) | |
932 | local xhh1,xhh2=GetWeld(wHandle,1) | |
933 | for i=1,aSpd do | |
934 | SetWeld(HRP,0,i,aSpd,xhrp0,xhrp1,phrp0,phrp2) | |
935 | SetWeld(wHandle,1,i,aSpd,xhh1,xhh2,phandle1,phandle3) | |
936 | SetWeld(wRA,0,i,aSpd,xr1,xr2,pra0,pra2) | |
937 | SetWeld(wLA,0,i,aSpd,xl1,xl2,pla0,pla2) | |
938 | SetWeld(LH,0,i,aSpd,xlh1,xlh2,plh0,plh2) | |
939 | SetWeld(RH,0,i,aSpd,xrh1,xrh2,prh0,prh2) | |
940 | wait() | |
941 | end | |
942 | Anim="Stance1" | |
943 | --Jump Slash | |
944 | elseif k==" " and Anim=="Jumping" and JumpDebounce<time() then | |
945 | JumpDebounce=time()+1 | |
946 | MeshEffect(0.1,Torso.CFrame*CF(0,-1,0)*CA(180,0,0),0.5,as.blast,CF(0,0.6,0)*CA(0,10,0),EffectColor,v3(0.75,0.2,0.75)*5,v3(0,0.8,0)*5) | |
947 | Torso.Velocity=v3(Torso.Velocity.x,100,Torso.Velocity.z) | |
948 | so.Abscond.Pitch=1.3 | |
949 | so.Abscond:Play() | |
950 | elseif k==" " and Anim=="Jumping2" and GroundRange>6 and JumpDebounce<time() then | |
951 | JumpDebounce=time()+1 | |
952 | MeshEffect(0.1,Torso.CFrame*CF(0,-1,0)*CA(180,0,0),0.5,as.blast,CF(0,0.6,0)*CA(0,10,0),EffectColor,v3(2,0.5,2),0.3) | |
953 | Torso.Velocity=v3(Torso.Velocity.x,95,Torso.Velocity.z) | |
954 | so.Abscond.Pitch=1.3 | |
955 | so.Abscond:Play() | |
956 | WalkM[3]=1.4 | |
957 | repeat wait() until not Falling | |
958 | WalkM[3]=1 | |
959 | --Stance two | |
960 | elseif k=="q" and (Anim=="None" or Anim=="Walking") then | |
961 | Anim="Stance2Ready" | |
962 | WalkM[2]=0.25 | |
963 | local hrp0,hrp1=GetWeld(HRP) | |
964 | local a,b=GetWeld(Neck) | |
965 | local r1,r2=GetWeld(wRA) | |
966 | local l1,l2=GetWeld(wLA) | |
967 | local lh1,lh2=GetWeld(LH) | |
968 | local rh1,rh2=GetWeld(RH) | |
969 | local hh1,hh2=GetWeld(wHandle,1) | |
970 | for i=1,aSpd do | |
971 | SetWeld(HRP,0,i,aSpd,hrp0,hrp1,Pose.None.HRP[0]+v3(0,-0.7-0.3,0),Pose.None.HRP[2]+v3(-20,70,0)) | |
972 | SetWeld(Neck,0,i,aSpd,a,b,Pose.None.Neck[0],Pose.None.Neck[2]+v3(0,-70,0)) | |
973 | SetWeld(wHandle,1,i,aSpd,hh1,hh2,Pose.None.Handle[1]+v3(0,-1.5,0.2),v3(40-110+35,0,-90+30)) | |
974 | SetWeld(wRA,0,i,aSpd,r1,r2,v3(1.2,0.55,-0.5),Ca(90,30,60-20,0,0,0)) | |
975 | SetWeld(wLA,0,i,aSpd,l1,l2,v3(-1,0.5,-0.55),Ca(100-20,30-0,75-30,0,0,0)) | |
976 | SetWeld(LH,0,i,aSpd,lh1,lh2,Pose.None.LH[0]+v3(0,0.45+0.3,-0.95),Ca(-22,-90,0, 15,0,0)) | |
977 | SetWeld(RH,0,i,aSpd,rh1,rh2,Pose.None.RH[0]+v3(-0.1,0.4+0.3,0.05),Ca(0,90,0,-85,0,0)) | |
978 | wait() | |
979 | end | |
980 | Anim="Stance2" | |
981 | repeat wait() until not Key[k] and Anim=="Stance2" | |
982 | WalkM[2]=1 | |
983 | Anim="None" | |
984 | --Stance one | |
985 | elseif k=="e" and (Anim=="None" or Anim=="Walking") then | |
986 | Anim="Stance1Ready" | |
987 | WalkM[2]=0.25 | |
988 | local hrp0,hrp1=GetWeld(HRP) | |
989 | local a,b=GetWeld(Neck) | |
990 | local r1,r2=GetWeld(wRA) | |
991 | local l1,l2=GetWeld(wLA) | |
992 | local lh1,lh2=GetWeld(LH) | |
993 | local rh1,rh2=GetWeld(RH) | |
994 | local hh1,hh2=GetWeld(wHandle,1) | |
995 | for i=1,aSpd do | |
996 | SetWeld(HRP,0,i,aSpd,hrp0,hrp1,Pose.None.HRP[0]+v3(0,-0.7,0),Pose.None.HRP[2]+v3(-20,-70,0)) | |
997 | SetWeld(Neck,0,i,aSpd,a,b,Pose.None.Neck[0],Pose.None.Neck[2]+v3(0,70,0)) | |
998 | SetWeld(wHandle,1,i,aSpd,hh1,hh2,Pose.None.Handle[1]+v3(0,-1.5,0.15),v3(40-110,0,-90)) | |
999 | SetWeld(wRA,0,i,aSpd,r1,r2,v3(1.1,0.5,-0.7),Ca(90,-20,60,0,0,0)) | |
1000 | SetWeld(wLA,0,i,aSpd,l1,l2,v3(-1,0.75,-0.45),Ca(100,-20,75,0,0,0)) | |
1001 | SetWeld(LH,0,i,aSpd,lh1,lh2,Pose.None.LH[0]+v3(0.6,0.4,-0.05),Ca(0,-90,0,-85,0,0)) | |
1002 | SetWeld(RH,0,i,aSpd,rh1,rh2,Pose.None.RH[0]+v3(-0.3,0.45,-0.93),Ca(-22,90,0,-15,0,0)) | |
1003 | wait() | |
1004 | end | |
1005 | Anim="Stance1" | |
1006 | repeat wait() until not Key[k] and Anim=="Stance1" | |
1007 | WalkM[2]=1 | |
1008 | Anim="None" | |
1009 | elseif k=="x" and (Anim=="None" or Anim=="Walking") then | |
1010 | WalkM[2]=0 | |
1011 | Anim="Sitting" | |
1012 | elseif (k=="x" or k==" ") and Anim=="Sitting" then | |
1013 | WalkM[2]=1 | |
1014 | Anim="None" | |
1015 | elseif k =="p" then | |
1016 | repeat | |
1017 | Effect1(Torso.CFrame*CF(0,4,0)*CA(mrnd(-30,30),mrnd(-200,200),mrnd(-200,200)),CF(0,0,1.5),8,mrnd(45,150),10,1,0.85,0.1)--cf,Radius,Deg,Parts,Fade,Wide | |
1018 | wait(0.3) | |
1019 | until not Key[k] | |
1020 | elseif k=="[" then | |
1021 | if #Ghost==0 then | |
1022 | ||
1023 | NewGhost(CF(0,8,0)) | |
1024 | NewGhost(CF(0,16,0)) | |
1025 | NewGhost(CF(0,24,0)) | |
1026 | ||
1027 | ||
1028 | else | |
1029 | for i=1,1 do Ghost[i][1]=nil end end | |
1030 | end | |
1031 | end | |
1032 | -- | |
1033 | --------------------------------------------------- | |
1034 | onKeyUp = function(k) | |
1035 | if k=="0" and Anim=="Running" then | |
1036 | Anim="Walking" | |
1037 | end | |
1038 | end | |
1039 | ---------------------------------------------------------------------------------------------BUTTON -WWWWBUTTON | |
1040 | onButton1Down= function() | |
1041 | --Jump Slash | |
1042 | if Anim=="Jumping" and GroundRange>5 and JumpDebounce<time() then | |
1043 | Anim=" JumpSlash" | |
1044 | BladeTrail=true | |
1045 | local a,b=GetWeld(wRA) | |
1046 | local c,d=GetWeld(wHandle,1) | |
1047 | so.Slash:Play() | |
1048 | for i=1,aSpd do | |
1049 | SetWeld(wRA,0,i,aSpd,a,b,v3(1.5,0.5,0),v3(-20,0,0)) | |
1050 | SetWeld(wHandle,1,i,aSpd,c,d,v3(0,-1.5,0),v3(20,0,-20)) | |
1051 | wait() | |
1052 | end | |
1053 | local timee=time() | |
1054 | repeat wait() until not Falling or timee+2<time() --if DoubleJump then wait(0.5) end -l--- | |
1055 | BladeTrail=false | |
1056 | Anim="None" | |
1057 | --DoubleJump Slash | |
1058 | elseif Anim=="Jumping" and GroundRange>12 and JumpDebounce>time() then | |
1059 | Anim=" JumpSlash2" | |
1060 | BladeTrail=1 | |
1061 | GetRecent() | |
1062 | local timee=time() | |
1063 | so.Slash.Pitch=2 | |
1064 | local flipdmg=function() | |
1065 | local Hits=GetFrontRay(Torso.CFrame,999,{-3,3},{-8,8},{-8,8}) for i,v in pairs(Hits) do local Huma=v[2] | |
1066 | if HitDB[Huma] and HitDB[Huma]>time() then else | |
1067 | HitDB[Huma]=time()+0.2 fDamage(mrnd(Damage*70,Damage*130)/100,v[1],Huma) so.Hit:Play() end end end | |
1068 | local steer=oHRP.CFrame:toObjectSpace(CF(oHRP.Position,Mouse.Hit.p)) | |
1069 | local x,y,z = steer:toEulerAnglesXYZ() | |
1070 | steer=math.deg(-y) | |
1071 | steer = steer>90 and 90 or steer | |
1072 | steer = steer<-90 and -90 or steer | |
1073 | for i=1,aSpd*30 do | |
1074 | if i%4==0 then so.Slash:Play() end | |
1075 | local i2=i>aSpd and aSpd or i | |
1076 | --steer=steer +(Key['q'] and 6 or (Key['e'] and -6 or 0)) | |
1077 | SetWeld(wLA,0,i2,aSpd,pla0,pla2,v3(-1,0.9,0),v3(180,0,30)) | |
1078 | SetWeld(wRA,0,i2,aSpd,pra0,pra2,v3(1,0.9,0),v3(180,0,-30)) | |
1079 | SetWeld(wHandle,1,i2,aSpd,phandle1,phandle3,v3(0.2,-1.5,0),v3(45,30,0)) | |
1080 | SetWeld(HRP,1,i,aSpd*30,phrp0,phrp1,phrp0,v3(360*2*10,0,0)) | |
1081 | SetWeld(HRP,0,1,1,phrp0,phrp2,phrp0+v3(0,-mabs(steer/45),0),v3(0,0,steer)) | |
1082 | flipdmg() | |
1083 | if (not Falling and timee+(mabs(steer)>30 and 1 or 0.6)<time()) or timee+4<time() then break end | |
1084 | wait() | |
1085 | end | |
1086 | flipdmg() | |
1087 | so.Slash.Pitch=SlashPitch | |
1088 | ClearWeld(HRP) | |
1089 | BladeTrail=false | |
1090 | Anim="None" | |
1091 | --RunningJump Slash | |
1092 | elseif Anim=="Jumping2" and GroundRange>6 and JumpDebounce<time() then | |
1093 | Anim=" JumpSlash2" | |
1094 | WalkM[2]=2.5 | |
1095 | BladeTrail=true | |
1096 | GetRecent() | |
1097 | local timee=time() | |
1098 | so.Slash.Pitch=2 | |
1099 | for i=1,aSpd*30 do | |
1100 | if i%4==0 then so.Slash:Play() end | |
1101 | local i2=i>aSpd and aSpd or i | |
1102 | SetWeld(wLA,0,i2,aSpd,pla0,pla2,v3(-1.5,0.5,0),v3(180,0,0)) | |
1103 | SetWeld(wRA,0,i2,aSpd,pra0,pra2,v3(1.5,0.5,0),v3(0,0,90)) | |
1104 | SetWeld(wHandle,1,i2,aSpd,phandle1,phandle3,v3(0.2,-1.5,0),v3(90,110,0)) | |
1105 | SetWeld(HRP,0,i2,aSpd,phrp0,phrp2,phrp0+v3(0,1,0),v3(-110,0,0)) | |
1106 | SetWeld(HRP,1,i,aSpd*30,phrp1,phrp3,phrp1,v3(0,360*2*15,0)) | |
1107 | if (not Falling and timee+0.5<time()) or timee+4<time() then break end | |
1108 | wait() | |
1109 | end | |
1110 | AOEDmg(HitBox.Position,6.5,Damage,function() so.Hit:Play() end) | |
1111 | WalkM[2]=1 | |
1112 | so.Slash.Pitch=SlashPitch | |
1113 | ClearWeld(HRP) | |
1114 | BladeTrail=false | |
1115 | Anim="None" | |
1116 | elseif Anim=="Stance1" then | |
1117 | Anim="Stance1Stab" | |
1118 | local r1,r2=GetWeld(wRA) | |
1119 | local l1,l2=GetWeld(wLA) | |
1120 | local hh1,hh2=GetWeld(wHandle,1) | |
1121 | so.Slash.Pitch=2 | |
1122 | repeat | |
1123 | local raise=mrnd(-4,4)*80/4 | |
1124 | local div=2 | |
1125 | for i=1,div do | |
1126 | SetWeld(wHandle,1,i,div,hh1,hh2,Pose.None.Handle[1]+v3(0,-1.5,0.1),v3(40,0,-90)) | |
1127 | SetWeld(wRA,0,i,div,r1,r2,v3(0.5,0.5,-0.5),Ca(90+raise,-20,-50,0,0,0)) | |
1128 | SetWeld(wLA,0,i,div,l1,l2,v3(-1.6,0.75,0),Ca(100+raise,-20,-15,0,0,0)) | |
1129 | wait() | |
1130 | end | |
1131 | AOEDmg(HitBox.Position,4,Damage/3,function() so.Hit:Play() end) | |
1132 | so.Slash:Play() | |
1133 | MeshEffect(0.15,Handle.CFrame*CF(0,tpol.y/4,0),0.5,as.cone,CF(0,0.5,0),EffectColor,v3(0.01,4,0.3),v3(0.1,3,0.1)) | |
1134 | local R1,R2=GetWeld(wRA) | |
1135 | local L1,L2=GetWeld(wLA) | |
1136 | local HH1,HH2=GetWeld(wHandle,1) | |
1137 | for i=1,div do | |
1138 | SetWeld(wHandle,1,i,div,HH1,HH2,hh1,hh2) | |
1139 | SetWeld(wRA,0,i,div,R1,R2,r1,r2) | |
1140 | SetWeld(wLA,0,i,div,L1,L2,l1,l2) | |
1141 | wait() | |
1142 | end | |
1143 | wait() until not Button1 or Anim~="Stance1Stab" | |
1144 | so.Slash.Pitch=SlashPitch | |
1145 | Anim="Stance1" | |
1146 | end | |
1147 | end | |
1148 | --------------------------------------------------- | |
1149 | onButton1Up= function() | |
1150 | end | |
1151 | --------------------------------------------------- | |
1152 | Tool.Selected:connect(function(mouse) | |
1153 | Mouse=mouse | |
1154 | if Anim=="Deselected" then | |
1155 | Anim="Selecting" | |
1156 | Arms(1) | |
1157 | for x=1,aSpd do | |
1158 | SetWeld(wRA,0,x,aSpd,cRA0,v30,cRA0+v3(0,0,-0.2),v3(135,0,15)) | |
1159 | wait() | |
1160 | end | |
1161 | local w0,w1=GetWeld(wRA) | |
1162 | for x=1,aSpd do | |
1163 | SetWeld(wRA,0,x,aSpd,w0,w1,cRA0,v3(200,0,-15)) | |
1164 | wait() | |
1165 | end | |
1166 | local a,b=GetWeld(wRA) | |
1167 | wHandle.C0=RA.CFrame:toObjectSpace(Handle.CFrame) | |
1168 | wHandle.Part0=RA | |
1169 | ClearWeld(wHandle) | |
1170 | local w0,w1=GetWeld(wHandle) | |
1171 | w1=v3(-360+w1.x,w1.y,w1.z) | |
1172 | for x=1,aSpd do | |
1173 | SetWeld(wHandle,0,x,aSpd,w0,w1,Pose.None.Handle[0],Pose.None.Handle[2]) | |
1174 | SetWeld(wHandle,1,x,aSpd,v30,v30,Pose.None.Handle[1],Pose.None.Handle[3]) | |
1175 | SetWeld(wRA,0,x,aSpd,a,b,cRA0,v3(200,0,20)) | |
1176 | wait() | |
1177 | end | |
1178 | local a,b=GetWeld(wRA) | |
1179 | for x=1,aSpd do | |
1180 | SetWeld(wRA,0,x,aSpd,a,b,Pose.None.RA[0],Pose.None.RA[2]) | |
1181 | wait() | |
1182 | end | |
1183 | SetWeld(Neck,0,1,1,nil,nil,Pose.None.Neck[0],Pose.None.Neck[2]) | |
1184 | SetWeld(Neck,1,1,1,nil,nil,Pose.None.Neck[1],Pose.None.Neck[3]) | |
1185 | SetWeld(HRP,0,1,1,nil,nil,Pose.None.HRP[0],Pose.None.HRP[2]) | |
1186 | SetWeld(HRP,1,1,1,nil,nil,Pose.None.HRP[1],Pose.None.HRP[3]) | |
1187 | pcall(function() Character.Animate.Disabled=true end) | |
1188 | Anim="None" | |
1189 | end -- anim | |
1190 | ------------------- | |
1191 | mouse.KeyDown:connect(function(k) | |
1192 | Key[k]=true | |
1193 | onKeyDown(k) | |
1194 | end) | |
1195 | ------------------------- | |
1196 | mouse.KeyUp:connect(function(k) | |
1197 | Key[k]=false | |
1198 | onKeyUp(k) | |
1199 | end) | |
1200 | mouse.Button1Down:connect(function() | |
1201 | Button1=true | |
1202 | onButton1Down() | |
1203 | end) | |
1204 | mouse.Button1Up:connect(function() | |
1205 | Button1=false | |
1206 | onButton1Up() | |
1207 | end) | |
1208 | end) | |
1209 | ------------------------------------------------------- | |
1210 | Tool.Deselected:connect(function() | |
1211 | Mouse=nil | |
1212 | if Anim=="None" or Anim=="Walking" then | |
1213 | Anim="Deselecting" | |
1214 | local a,b=GetWeld(wRA) | |
1215 | for x=1,aSpd do | |
1216 | SetWeld(wRA,0,x,aSpd,a,b,cRA0+v3(0,0,-0.2),v3(135,0,15)) | |
1217 | wait() | |
1218 | end | |
1219 | local w0,w1=GetWeld(wRA) | |
1220 | for x=1,aSpd do | |
1221 | SetWeld(wRA,0,x,aSpd,w0,w1,cRA0,v3(200,0,-15)) | |
1222 | SetWeld(wHandle,0,x,aSpd,Pose.None.Handle[0],Pose.None.Handle[2],Pose.None.Handle[0],Pose.None.Handle[2]+v3(0,45,45)) | |
1223 | wait() | |
1224 | end | |
1225 | wHandle.C0=Torso.CFrame:toObjectSpace(Handle.CFrame) | |
1226 | wHandle.C1=CF(0,0,0) | |
1227 | wHandle.Part0=Torso | |
1228 | ClearWeld(wHandle) | |
1229 | local w0,w1=GetWeld(wHandle) | |
1230 | for x=1,aSpd do | |
1231 | SetWeld(wHandle,0,x,aSpd,w0,w1,oHandle0,oHandle1) | |
1232 | wait() | |
1233 | end | |
1234 | local a,b=GetWeld(wRA) | |
1235 | for x=1,aSpd do | |
1236 | SetWeld(wRA,0,x,aSpd,a,b,cRA0,cRA1) | |
1237 | wait() | |
1238 | end | |
1239 | Arms() | |
1240 | SetWeld(Neck,0,1,1,nil,nil,v3(xNeck0.x,xNeck0.y,xNeck0.z),xNeck) | |
1241 | SetWeld(Neck,1,1,1,nil,nil,v3(xNeck1.x,xNeck1.y,xNeck1.z),xNeck) | |
1242 | SetWeld(HRP,0,1,1,nil,nil,v3(xHRP0.x,xHRP0.y,xHRP0.z),xHRP) | |
1243 | SetWeld(HRP,1,1,1,nil,nil,v3(xHRP1.x,xHRP1.y,xHRP1.z),xHRP) | |
1244 | pcall(function() Character.Animate.Disabled=false end) | |
1245 | Anim="Deselected" | |
1246 | end | |
1247 | end) | |
1248 | ||
1249 | KillEvade=time() | |
1250 | Damage=18 | |
1251 | HitDB={} | |
1252 | BladeFunc=function(Hit) | |
1253 | if Hit.Parent==Model or Hit.Parent==Character or not BladeTrail then return end | |
1254 | if BladeTrail==1 then return end | |
1255 | local Huma=Hit.Parent:findFirstChild'Humanoid' | |
1256 | if not Huma then return end | |
1257 | if HitDB[Huma] and HitDB[Huma]>time() then return end | |
1258 | HitDB[Huma]=time()+0.5 | |
1259 | local Dmg=mrnd(Damage*70,Damage*130)/100 | |
1260 | fDamage(Dmg,Hit,Huma) | |
1261 | so.Hit.Pitch=mrnd(90,115)/100 | |
1262 | so.Hit:Play() | |
1263 | end | |
1264 | fDamage=function(Dmg,Hit,Huma) | |
1265 | if Huma.Health<=0 then return end | |
1266 | ----------Damage Bar | |
1267 | Huma:TakeDamage(Dmg) | |
1268 | local bdmg=INEW("Model",workspace) | |
1269 | bdmg.Name=math.floor(Dmg) | |
1270 | Debris:AddItem(bdmg,1.5) | |
1271 | local bhead=partx:Clone() --taken from weapon part | |
1272 | bhead.CanCollide=false | |
1273 | bhead.Parent=bdmg | |
1274 | bhead.BrickColor=BrickColor.new'Bright red' | |
1275 | bhead.Mesh.Scale=v3(0.6,0.2,0.6)*5 | |
1276 | bhead.Name="Head" | |
1277 | bhead.Anchored=true | |
1278 | bhead.CFrame=CF(Hit.Position)*CF(mrnd(-100,100)/100*1.5,4.25,mrnd(-100,100)/100*1.5) | |
1279 | local bhuma=INEW("Humanoid",bdmg) | |
1280 | bhuma.Name="keks" | |
1281 | bhuma.MaxHealth=0 | |
1282 | ------------------------Effects | |
1283 | if Hit then | |
1284 | local blod | |
1285 | for i=1,3 do | |
1286 | local y1=mrnd(300,450)/100 | |
1287 | local z1=mrnd(300,450)/100 | |
1288 | local z2=mrnd(400,600)/100 | |
1289 | local blood=INEW("Part",workspace) | |
1290 | blood.Transparency=1 | |
1291 | blood.formFactor='Custom' | |
1292 | blood.Anchored=true | |
1293 | blood.CanCollide=false | |
1294 | blood.Size=v3(0.2,0.2,0.2) | |
1295 | blood.CFrame=CF(Hit.Position,HitBox.Position)*CA(mrnd(-15,15),mrnd(-15,15),mrnd(-180,180))*CF(0,0,-z1/2)*CA(-90,0,0) | |
1296 | if i==1 then blod=blood:Clone() end | |
1297 | local bloodm=INEW("BlockMesh",blood) | |
1298 | Debris:AddItem(blood,1.5) | |
1299 | bloodm.Scale=v3(0,y1,z1)*5 | |
1300 | for i,v in pairs{'Left','Right'} do local dec=INEW('Decal',blood) dec.Name=v dec.Face=v dec.Texture=as.Blood dec.Transparency=0.1 | |
1301 | DoLoop(10,function(i) blood.CFrame=blood.CFrame*CF(0,z2/2/10,0) bloodm.Scale=v3(0,y1+z2*i,z1-z1/2.1*i)*5 dec.Transparency=0.1+0.9*i if i==1 then blood:Remove() end end) end | |
1302 | end | |
1303 | local hit2,pos2=ray(Hit.Position,Hit.Position-Hit.CFrame*CF(0,1,0).p,Hit.Parent,10) | |
1304 | if hit2 then | |
1305 | local blad=blod:Clone() | |
1306 | local bloodmm=INEW("BlockMesh",blad) | |
1307 | blad.Parent=workspace Debris:AddItem(blad,1.5) | |
1308 | blad.CFrame=CF(pos2)*CF(mrnd(-250,250)/100,0.08,mrnd(-250,250)/100)*CA(0,mrnd(-180,180),0) | |
1309 | local decx=INEW('Decal',blad) decx.Face='Top' decx.Texture=as.Blood decx.Transparency=0 | |
1310 | bloodmm.Scale=v3(mrnd(200,400)/100,0,mrnd(300,500)/100)*13 | |
1311 | DoLoop(30,function(i) decx.Transparency=1*i bloodmm.Scale=bloodmm.Scale+v3(1,0,1)*5/30/2 if i==1 then blad:Remove() end end) | |
1312 | end | |
1313 | end | |
1314 | -------Special Evade Move | |
1315 | if Huma.Health-Dmg<=0 and KillEvade<time() and Key['2'] then | |
1316 | KillEvade=time()+1 | |
1317 | so.Abscond:Play() | |
1318 | oHRP.CFrame=oHRP.CFrame*CF(0,0,35) | |
1319 | for i=1,6 do | |
1320 | MeshEffect(0.04,oHRP.CFrame*CF(0,0,-i*5+2.5)*CA(90,0,0),0.2,'Cylinder',nil,'',v3(4,6,4)*(i-1)/3,-v3(4,0,4)*(i-1)/3) | |
1321 | end | |
1322 | end | |
1323 | end | |
1324 | HitBox.Touched:connect(BladeFunc) | |
1325 | ||
1326 | poll=1 | |
1327 | ||
1328 | ||
1329 | Humanoid.FreeFalling:connect(function(v) | |
1330 | Falling=v | |
1331 | end) | |
1332 | Humanoid.Running:connect(function(v) | |
1333 | Moving=v>3 and true or false | |
1334 | end) | |
1335 | Humanoid.Jumping:connect(function(v) | |
1336 | --print(v) | |
1337 | end) | |
1338 | ||
1339 | GetRecent=function() | |
1340 | pneck0,pneck2=GetWeld(Neck) | |
1341 | pneck1,pneck3=GetWeld(Neck,1) | |
1342 | phrp0,phrp2=GetWeld(HRP) | |
1343 | phrp1,phrp3=GetWeld(HRP,1) | |
1344 | phandle0,phandle2=GetWeld(wHandle) | |
1345 | phandle1,phandle3=GetWeld(wHandle,1) | |
1346 | pla0,pla2=GetWeld(wLA) | |
1347 | pra0,pra2=GetWeld(wRA) | |
1348 | plh0,plh2=GetWeld(LH) | |
1349 | plh1,plh3=GetWeld(LH,1) | |
1350 | prh0,prh2=GetWeld(RH) | |
1351 | prh1,prh3=GetWeld(RH,1) | |
1352 | end | |
1353 | ||
1354 | LastPoints={} | |
1355 | ||
1356 | ||
1357 | LS:SetDesiredAngle(0) | |
1358 | RS:SetDesiredAngle(0) | |
1359 | LS.CurrentAngle=0 | |
1360 | RS.CurrentAngle=0 | |
1361 | WedgeTrail={} | |
1362 | -----------------WWWWWWWWWWWW wWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW | |
1363 | game:GetService'RunService'.RenderStepped:connect(function() | |
1364 | --------ghost sytem | |
1365 | for x,v in pairs(Ghost) do | |
1366 | if v[1] then | |
1367 | v.Torso.CFrame=oHRP.CFrame*v[1]*(oHRP.CFrame:toObjectSpace(Torso.CFrame)) | |
1368 | v.Handle.CFrame=v.Torso.CFrame*(Torso.CFrame:toObjectSpace(wHandle.Part1.CFrame))*v[3] | |
1369 | v.Handle.bp.position=v.Handle.Position | |
1370 | v.Handle.Velocity=v30 v.Handle.RotVelocity=v30 | |
1371 | for ii,vv in pairs(v[2]:children()) do if vv.Name~="Torso" and vv.Name~="Handle" then | |
1372 | local adh=Torso.CFrame:toObjectSpace(Character[vv.Name].CFrame) vv.CFrame=v.Torso.CFrame*adh end end | |
1373 | else | |
1374 | for ii,vv in pairs(v[2]:children()) do if v[1]==nil or (v[1] and vv.Name~='Handle') then vv.Transparency=vv.Transparency+0.1 | |
1375 | if vv.Transparency>=1 then v[2]:Remove() Ghost[x]=nil end end end | |
1376 | end | |
1377 | end | |
1378 | end) | |
1379 | ------------------------------------------------ | |
1380 | local handles={Handle} | |
1381 | if Character:findFirstChild'Sound' then Character.Sound.Disabled=true end | |
1382 | Falling=false | |
1383 | xAngle,yAngle,XAngle,YAngle=0,0,0,0 | |
1384 | Adj=0 | |
1385 | Adjx=1 | |
1386 | GroundRange=0 | |
1387 | Adjt={["None"]=0.3,["Walking"]=1.4,["Running"]=3,["Jumping"]=0,["Jumping2"]=0} | |
1388 | LegRaise={["None"]={5,0.003},["Walking"]={37,0.1},["Running"]={80,0.22}} LegNega=1 | |
1389 | WSAnim={["Running"]=2,["Jumping2"]=3} | |
1390 | --sPose={["Jumping"]=1.5} | |
1391 | count=0 | |
1392 | _G.hrp=wHRP | |
1393 | _G.rmail=_G.rmail and _G.rmail+1 or 0 | |
1394 | local rmail=_G.rmail | |
1395 | while _G.rmail==rmail do | |
1396 | --[[ Anti Fall System | |
1397 | local tx,ty,tz=oHRP.CFrame:toEulerAnglesXYZ() | |
1398 | tx,ty,tz=mdeg(tx)%180,mdeg(ty)%180,mdeg(tz)%180 | |
1399 | print(math.floor(tx)) | |
1400 | if v3(oHRP.Velocity.x,0,oHRP.Velocity.z).magnitude>5 and (mabs(tx)>45) then print'kek' | |
1401 | oHRP.Velocity=v30 oHRP.RotVelocity=v30 | |
1402 | Torso.Velocity=v30 Torso.Velocity=v30 | |
1403 | oHRP.CFrame=CF(oHRP.Position.x+mrnd(-12,12),oHRP.Position.y+1,oHRP.Position.z+mrnd(-12,12))*CA(0,mrnd(-200,200),0) | |
1404 | end]] | |
1405 | DoubleJump=JumpDebounce>time() and true or false | |
1406 | Adjx = mabs(Adj)>16 and -Adjx or Adjx | |
1407 | local wss=WalkSpeed | |
1408 | for i,v in pairs(WalkM) do | |
1409 | wss=wss*v | |
1410 | end | |
1411 | WalkM[1]=WSAnim[Anim] or 1 | |
1412 | Humanoid.WalkSpeed=wss | |
1413 | torvel=(Torso.Velocity*v3(1,0,1)).magnitude | |
1414 | --Moving=torvel>2 and true or false | |
1415 | if Anim=="None" and Moving then Anim="Walking" Adj=0 end | |
1416 | if (Anim=="Walking" or Anim=="Running") and not Moving then Anim="None" Adj=0 end | |
1417 | if Falling and (Anim=="None" or Anim=="Walking") then Torso.Velocity=Torso.Velocity+v3(0,16,0) Anim="Jumping" Adj=0 end | |
1418 | if Falling and Anim=="Running" then Torso.Velocity=Torso.Velocity+v3(0,25,0) Anim="Jumping2" so.Slash2:Play() | |
1419 | MeshEffect(0.1,oHRP.CFrame*CF(0,-GroundRange+0.5,0),0.5,as.blast,CA(0,10,0),GroundColor,v3(0.5,0.1,0.5)*5,v3(0.5,0,0.5)*5) Adj=0 end | |
1420 | local hit,pos | |
1421 | local gg=99999 | |
1422 | for i,x in pairs{0,-0.5,0.5,-1.05,1.05} do | |
1423 | local HCF=oHRP.CFrame*CF(x,0,0) | |
1424 | hit2,pos2=ray(HCF.p,HCF.p-HCF*CF(0,1,0).p,Character,200) | |
1425 | local current= (pos2-oHRP.Position).magnitude | |
1426 | if current<gg then | |
1427 | gg=current | |
1428 | GroundRange=current | |
1429 | hit=hit2 | |
1430 | pos=pos2 | |
1431 | end | |
1432 | end | |
1433 | if not Falling and Anim:sub(1,4)=="Jump" then Anim="None" Adj=0 end | |
1434 | if hit and GroundRange<40 then GroundColor=hit.BrickColor.Name end | |
1435 | if Pose[Anim] then | |
1436 | Adj=Adj+(Adjt[Anim] or 1)*Adjx | |
1437 | local xx = 1 --PoseAnim | |
1438 | local PoseSpd=10 | |
1439 | local xxAngle=xAngle<-10 and -10 or xAngle | |
1440 | SetWeld(Neck,0,xx,PoseSpd,pneck10,pneck20,Pose[Anim].Neck[0],Pose[Anim].Neck[2]-v3(-xxAngle/1.5,Adj*Pose[Anim].HRP[-1]-yAngle,-Adj*Pose[Anim].HRP[-1])) | |
1441 | SetWeld(Neck,1,xx,PoseSpd,pneck30,pneck40,Pose[Anim].Neck[1],Pose[Anim].Neck[3]) | |
1442 | SetWeld(HRP,0,xx,PoseSpd,phrp10,phrp20,Pose[Anim].HRP[0],Pose[Anim].HRP[2]+v3(0,Adj*Pose[Anim].HRP[-1],0)) | |
1443 | SetWeld(HRP,1,xx,PoseSpd,phrp30,phrp40,Pose[Anim].HRP[1],Pose[Anim].HRP[3]) | |
1444 | SetWeld(wHandle,0,xx,PoseSpd,phandle10,phandle20,Pose[Anim].Handle[0],Pose[Anim].Handle[2]) | |
1445 | SetWeld(wHandle,1,xx,PoseSpd,phandle30,phandle40,Pose[Anim].Handle[1],Pose[Anim].Handle[3]) | |
1446 | SetWeld(wRA,0,xx,PoseSpd,pra10,pra20,Pose[Anim].RA[0],Pose[Anim].RA[2]+v3(Adj*Pose[Anim].RA[-1],yAngle,0)) | |
1447 | SetWeld(wLA,0,xx,PoseSpd,pla10,pla20,Pose[Anim].LA[0],Pose[Anim].LA[2]+v3(-Adj*Pose[Anim].LA[-1],yAngle,0)) | |
1448 | SetWeld(LH,0,xx,PoseSpd,plh10,plh20,Pose[Anim].LH[0],Pose[Anim].LH[2]) | |
1449 | SetWeld(LH,1,xx,PoseSpd,plh30,plh40,Pose[Anim].LH[1],Pose[Anim].LH[3]) | |
1450 | SetWeld(RH,0,xx,PoseSpd,prh10,prh20,Pose[Anim].RH[0],Pose[Anim].RH[2]) | |
1451 | SetWeld(RH,1,xx,PoseSpd,prh30,prh40,Pose[Anim].RH[1],Pose[Anim].RH[3]) | |
1452 | else | |
1453 | end | |
1454 | --Leg System | |
1455 | LegNega=LegNega*(LH.DesiredAngle==LH.CurrentAngle and -1 or 1) | |
1456 | local LegX=35/WalkSpeed*wss | |
1457 | LegX=LegX>50 and 50 or LegX | |
1458 | LegX2= 0.065/WalkSpeed*wss | |
1459 | LegX2=LegX2>0.2 and 0.2 or LegX2 | |
1460 | LH:SetDesiredAngle(math.rad(LegRaise[Anim] and LegRaise[Anim][1] or ((Moving and not Humanoid.Jump) and LegX or 0))*LegNega) | |
1461 | RH:SetDesiredAngle(LH.DesiredAngle) | |
1462 | if math.abs(LH.DesiredAngle)>=math.abs(LH.CurrentAngle) then | |
1463 | LH.MaxVelocity=LegRaise[Anim] and LegRaise[Anim][2] or LegX2 | |
1464 | RH.MaxVelocity=LH.MaxVelocity | |
1465 | end | |
1466 | ----------------------- | |
1467 | if BladeTrail then | |
1468 | for i,handle in pairs(handles) do | |
1469 | local C1, C2, S1, S2 = GetTriangleValues({ | |
1470 | handle.CFrame*tpol.p, | |
1471 | handle.Position, | |
1472 | LastPoints[handle][1] | |
1473 | }) | |
1474 | local Triangle1 = Instance.new("WedgePart", Model) | |
1475 | for i,v in pairs{"Top","Bottom","Left","Right","Front","Back"} do Triangle1[v.."Surface"]=10 end | |
1476 | Triangle1.Anchored = true | |
1477 | Triangle1.BrickColor = BrickColor.new(EffectColor) | |
1478 | Triangle1.FormFactor = 3 | |
1479 | Triangle1.Transparency = 0.6 | |
1480 | Triangle1.Size = V3(1, 1, 1) | |
1481 | Triangle1.CanCollide=false | |
1482 | Triangle1.CFrame = C1 | |
1483 | local Triangle1Mesh = Instance.new("SpecialMesh", Triangle1) | |
1484 | Triangle1Mesh.MeshType = "Wedge" | |
1485 | Triangle1Mesh.Scale = S1 | |
1486 | Triangle1Mesh.Name="kek" | |
1487 | local Triangle2 = Triangle1:Clone() | |
1488 | Triangle2.Parent = Model | |
1489 | Triangle2.CFrame = C2 | |
1490 | Triangle2.kek.Scale = S2 | |
1491 | local C1, C2, S1, S2 = GetTriangleValues({ | |
1492 | handle.Position, | |
1493 | LastPoints[handle][1], | |
1494 | LastPoints[handle][2] | |
1495 | }) | |
1496 | local Triangle3 = Triangle1:Clone() | |
1497 | Triangle3.Parent = Model | |
1498 | Triangle3.CFrame = C1 | |
1499 | Triangle3.kek.Scale = S1 | |
1500 | local Triangle4 = Triangle1:Clone() | |
1501 | Triangle4.Parent = Model | |
1502 | Triangle4.CFrame = C2 | |
1503 | Triangle4.kek.Scale = S2 | |
1504 | WedgeTrail[#WedgeTrail+1]=Triangle1 | |
1505 | WedgeTrail[#WedgeTrail+1]=Triangle2 | |
1506 | WedgeTrail[#WedgeTrail+1]=Triangle3 | |
1507 | WedgeTrail[#WedgeTrail+1]=Triangle4 | |
1508 | end | |
1509 | end | |
1510 | LastPoints[Handle]={[1]=Handle.CFrame*tpol.p,[2]=Handle.Position} | |
1511 | for i,v in pairs(Ghost) do handles[v.Handle]=v.Handle LastPoints[v.Handle]={[1]=v.Handle.CFrame*tpol.p,[2]=v.Handle.Position} end | |
1512 | ----------------------- | |
1513 | for i,v in pairs(WedgeTrail) do | |
1514 | if v.Transparency>=1 then v:Remove() WedgeTrail[i]=nil | |
1515 | else | |
1516 | v.Transparency=v.Transparency+0.1 | |
1517 | end | |
1518 | end | |
1519 | for i,v in pairs(MeshPack) do | |
1520 | v[2]=v[2]+v[3] | |
1521 | if v[2]<=0 then | |
1522 | v[1]:Remove() | |
1523 | MeshPack[i]=nil | |
1524 | else | |
1525 | v[1].Transparency=v[7]+((1-v[7])-(1-v[7])*v[2]) | |
1526 | v[1].Mesh.Scale=v[5]+(v[6]*(1-v[2])) | |
1527 | v[1].CFrame=v[1].CFrame*v[4] | |
1528 | end | |
1529 | end | |
1530 | ------------- | |
1531 | --DoLoop Package | |
1532 | for i,v in pairs(LoopFunctions) do | |
1533 | v[2]=v[2]+1 | |
1534 | v[3](v[2]/v[1]) | |
1535 | if v[1]<=v[2] then LoopFunctions[i]=nil end | |
1536 | end | |
1537 | ---- | |
1538 | if Mouse then | |
1539 | XAngle = GetX(oHRP,Mouse.Hit.p) | |
1540 | YAngle = GetY(oHRP,Mouse.Hit.p) | |
1541 | else | |
1542 | XAngle = 0 | |
1543 | YAngle = 0 | |
1544 | end | |
1545 | xAngle=XAngle | |
1546 | yAngle=YAngle | |
1547 | xAngle=xAngle>45 and 45 or xAngle | |
1548 | xAngle=xAngle<-45 and -45 or xAngle | |
1549 | yAngle=yAngle>45 and 45 or yAngle | |
1550 | yAngle=yAngle<-45 and -45 or yAngle | |
1551 | wait(0.0275) | |
1552 | count=count+1 | |
1553 | end |