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