SHOW:
|
|
- or go back to the newest paste.
1 | - | ---Made by mugex---------------------------------------------that u have it?-------- |
1 | + | if game:GetService("RunService"):IsClient() then error("Please run as a server script. Use h/ instead of hl/.") end |
2 | print("FE Compatibility: by WaverlyCole & Mokiros") | |
3 | InternalData = {} | |
4 | do | |
5 | script.Parent = owner.Character | |
6 | local Event = Instance.new("RemoteEvent") | |
7 | Event.Name = "UserInput" | |
8 | local function NewFakeEvent() | |
9 | local Fake = {fakeEvent=true,Connect=function(self,Func)self.Function=Func end}Fake.connect = Fake.Connect | |
10 | return Fake | |
11 | end | |
12 | local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()} | |
13 | local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()} | |
14 | local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...) | |
15 | self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil | |
16 | end};ContextActionService.UnBindAction = ContextActionService.BindAction | |
17 | local function TriggerEvent(self,Event,...) | |
18 | local Trigger = Mouse[Event] | |
19 | if Trigger and Trigger.fakeEvent and Trigger.Function then | |
20 | Trigger.Function(...) | |
21 | end | |
22 | end | |
23 | Mouse.TrigEvent = TriggerEvent | |
24 | UserInputService.TrigEvent = TriggerEvent | |
25 | Event.OnServerEvent:Connect(function(FiredBy,Input) | |
26 | if FiredBy.Name ~= owner.Name then end | |
27 | if Input.MouseEvent then | |
28 | Mouse.Target = Input.Target | |
29 | Mouse.Hit = Input.Hit | |
30 | else | |
31 | local Begin = Input.UserInputState == Enum.UserInputState.Begin | |
32 | if Input.UserInputType == Enum.UserInputType.MouseButton1 then | |
33 | return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") | |
34 | end | |
35 | for _,Action in pairs(ContextActionService.Actions) do | |
36 | for _,Key in pairs(Action.Keys) do | |
37 | if Key==Input.KeyCode then | |
38 | Action.Function(Action.Name,Input.UserInputState,Input) | |
39 | end | |
40 | end | |
41 | end | |
42 | Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower()) | |
43 | UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false) | |
44 | end | |
45 | end) | |
46 | InternalData["Mouse"] = Mouse | |
47 | InternalData["ContextActionService"] = ContextActionService | |
48 | InternalData["UserInputService"] = UserInputService | |
49 | Event.Parent = NLS([[ | |
50 | local Player = owner | |
51 | local Event = script:WaitForChild("UserInput") | |
52 | local UserInputService = game:GetService("UserInputService") | |
53 | local Mouse = Player:GetMouse() | |
54 | local Input = function(Input,gameProcessedEvent) | |
55 | if gameProcessedEvent then return end | |
56 | Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState}) | |
57 | end | |
58 | UserInputService.InputBegan:Connect(Input) | |
59 | UserInputService.InputEnded:Connect(Input) | |
60 | local Hit,Target | |
61 | while wait(1/30) do | |
62 | if Hit ~= Mouse.Hit or Target ~= Mouse.Target then | |
63 | Hit,Target = Mouse.Hit,Mouse.Target | |
64 | Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit}) | |
65 | end | |
66 | end | |
67 | ]],owner.Character) | |
68 | end | |
69 | RealGame = game;game = setmetatable({},{ | |
70 | __index = function (self,Index) | |
71 | local Sandbox = function (Thing) | |
72 | if Thing:IsA("Player") then | |
73 | local RealPlayer = Thing | |
74 | return setmetatable({},{ | |
75 | __index = function (self,Index) | |
76 | local Type = type(RealPlayer[Index]) | |
77 | if Type == "function" then | |
78 | if Index:lower() == "getmouse" or Index:lower() == "mouse" then | |
79 | return function (self) | |
80 | return InternalData["Mouse"] | |
81 | end | |
82 | end | |
83 | return function (self,...) | |
84 | return RealPlayer[Index](RealPlayer,...) | |
85 | end | |
86 | else | |
87 | if Index == "PlrObj" then | |
88 | return RealPlayer | |
89 | end | |
90 | return RealPlayer[Index] | |
91 | end | |
92 | end; | |
93 | __tostring = function(self) | |
94 | return RealPlayer.Name | |
95 | end | |
96 | }) | |
97 | end | |
98 | end | |
99 | if RealGame[Index] then | |
100 | local Type = type(RealGame[Index]) | |
101 | if Type == "function" then | |
102 | if Index:lower() == "getservice" or Index:lower() == "service" then | |
103 | return function (self,Service) | |
104 | if Service:lower() == "players" then | |
105 | return setmetatable({},{ | |
106 | __index = function (self2,Index2) | |
107 | local RealService = RealGame:GetService(Service) | |
108 | local Type2 = type(Index2) | |
109 | if Type2 == "function" then | |
110 | return function (self,...) | |
111 | return RealService[Index2](RealService,...) | |
112 | end | |
113 | else | |
114 | if Index2:lower() == "localplayer" then | |
115 | return Sandbox(owner) | |
116 | end | |
117 | return RealService[Index2] | |
118 | end | |
119 | end; | |
120 | __tostring = function(self) | |
121 | return RealGame:GetService(Service).Name | |
122 | end | |
123 | }) | |
124 | elseif Service:lower() == "contextactionservice" then | |
125 | return InternalData["ContextActionService"] | |
126 | elseif Service:lower() == "contextactionservice" then | |
127 | return InternalData["UserInputService"] | |
128 | elseif Service:lower() == "runservice" then | |
129 | return setmetatable({},{ | |
130 | __index = function(self2,Index2) | |
131 | local RealService = RealGame:GetService(Service) | |
132 | local Type2 = type(Index2) | |
133 | if Type2 == "function" then | |
134 | return function (self,...) | |
135 | return RealService[Index2](RealService,...) | |
136 | end | |
137 | else | |
138 | if Index2:lower() == "bindtorenderstep" then | |
139 | return function (self,Name,Priority,Function) | |
140 | return RealGame:GetService("RunService").Stepped:Connect(Function) | |
141 | end | |
142 | end | |
143 | if Index2:lower() == "renderstepped" then | |
144 | return RealService["Stepped"] | |
145 | end | |
146 | return RealService[Index2] | |
147 | end | |
148 | end | |
149 | }) | |
150 | else | |
151 | return RealGame:GetService(Service) | |
152 | end | |
153 | end | |
154 | end | |
155 | return function (self,...) | |
156 | return RealGame[Index](RealGame,...) | |
157 | end | |
158 | else | |
159 | if game:GetService(Index) then | |
160 | return game:GetService(Index) | |
161 | end | |
162 | return RealGame[Index] | |
163 | end | |
164 | else | |
165 | return nil | |
166 | end | |
167 | end | |
168 | });Game = game;owner = game:GetService("Players").LocalPlayer;script = {} | |
169 | print("Complete! Running...") | |
170 | ||
171 | script.Parent = nil | |
172 | name = 'Rainbow Blade' | |
173 | PLAYERS = game:GetService('Players') | |
174 | ply = PLAYERS.LocalPlayer | |
175 | char = ply.Character | |
176 | pcall(function() char:FindFirstChild("legetdgq"):Remove() end) | |
177 | m = Instance.new("Model",char) m.Name = "legetdgq" | |
178 | hop = Instance.new("HopperBin",ply.Backpack) | |
179 | hop.Name = name | |
180 | debris = game:GetService("Debris") | |
181 | ||
182 | cfn,ang,v3n,ud2n,V2 = CFrame.new,CFrame.Angles,Vector3.new,UDim2.new,Vector2.new | |
183 | floatforce = 196.25 | |
184 | ||
185 | torso,head = char.Torso,char.Head | |
186 | attacking = false | |
187 | ||
188 | rs = torso["Right Shoulder"] | |
189 | ls = torso["Left Shoulder"] | |
190 | rh = torso["Right Hip"] | |
191 | lh = torso["Left Hip"] | |
192 | neck = torso["Neck"] | |
193 | rw,lw = nil,nil | |
194 | rhw,lhw = nil,nil | |
195 | local orgc1 = rs.C1 | |
196 | ||
197 | rarm = char["Right Arm"] | |
198 | larm = char["Left Arm"] | |
199 | rleg = char["Right Leg"] | |
200 | lleg = char["Left Leg"] | |
201 | ||
202 | asset = 'rbxassetid://' | |
203 | normposr = cfn(1.5,.5,0) | |
204 | normposl = cfn(-1.5,.5,0) | |
205 | normposl2 = cfn(.5,-1.5,0) | |
206 | normposr2 = cfn(-.5,-1.5,0) | |
207 | normposn = CFrame.new(0,1,0,-1,-0,-0,0,0,1,0,1,0) | |
208 | ||
209 | holdpos = normposr*ang(math.pi/2,0,0) | |
210 | holdpos2 = normposl*ang(math.pi/2,0,0) | |
211 | for i = 0,1 do --------UTILITIES START------- | |
212 | function genNew(ClassName, Parent, Properties) | |
213 | local nObj = Instance.new(ClassName, Parent) | |
214 | if Properties["FormFactor"] then | |
215 | nObj["FormFactor"] = Properties["FormFactor"] | |
216 | end | |
217 | for Prop, Value in pairs(Properties) do | |
218 | nObj[Prop] = Value | |
219 | end | |
220 | return nObj | |
221 | end | |
222 | ||
223 | T = {["P"] = function(x,y,z,color,transparency,cancollide,anchored,parent,typee) | |
224 | if typee == 'wedge' then | |
225 | c = Instance.new("WedgePart",m) | |
226 | elseif typee == 'seat' then | |
227 | c = Instance.new("Seat",m) | |
228 | elseif typee == 'vseat' then | |
229 | c = Instance.new("VehicleSeat",m) | |
230 | else | |
231 | c = Instance.new("Part",m) | |
232 | end | |
233 | c.TopSurface,c.BottomSurface = 0,0 | |
234 | c.Locked = true | |
235 | c.formFactor = "Custom" | |
236 | c.Size = Vector3.new(x,y,z) | |
237 | if color ~= "random" then | |
238 | c.BrickColor = BrickColor.new(color) | |
239 | else c.BrickColor = BrickColor:random() | |
240 | end | |
241 | c.Transparency = transparency | |
242 | c.CanCollide = cancollide | |
243 | if anchored ~= nil then c.Anchored = anchored end | |
244 | if parent ~= nil then c.Parent = parent end | |
245 | return c | |
246 | end | |
247 | , | |
248 | ["C"] = function(func) coroutine.resume(coroutine.create(func)) end | |
249 | , | |
250 | ["W"] = function(part0,part1,x,y,z,rx,ry,rz,parent) | |
251 | w = Instance.new("Motor",m) | |
252 | if parent ~= nil then w.Parent = parent end | |
253 | w.Part0,w.Part1 = part0,part1 | |
254 | w.C1 = CFrame.new(x,y,z) * CFrame.Angles(rx,ry,rz) | |
255 | return w | |
256 | end | |
257 | , | |
258 | ["BG"] = function(parent) | |
259 | local c = Instance.new("BodyGyro",parent) | |
260 | c.P = 20e+003 | |
261 | c.cframe = parent.CFrame | |
262 | c.maxTorque = Vector3.new(c.P,c.P,c.P) | |
263 | return c | |
264 | end | |
265 | , | |
266 | ["BP"] = function(parent,position) | |
267 | local bp = Instance.new("BodyPosition",parent) | |
268 | bp.maxForce = Vector3.new()*math.huge | |
269 | bp.position = position | |
270 | return bp | |
271 | end | |
272 | , | |
273 | ["F"] = function(parent,size,heat,color,secondcolor,enabled) | |
274 | f = Instance.new("Fire",parent) | |
275 | f.Size = size | |
276 | f.Heat = heat | |
277 | if enabled ~= nil then f.Enabled = enabled end | |
278 | if color ~= nil then f.Color = BrickColor.new(color).Color end | |
279 | if secondcolor ~= nil then f.SecondaryColor = BrickColor.new(secondcolor).Color end | |
280 | return f | |
281 | end | |
282 | , | |
283 | ||
284 | ["FM"] = function(parent,meshid,x,y,z,meshtexture) | |
285 | if meshid == "cylinder" then | |
286 | mesh = Instance.new("CylinderMesh",parent) | |
287 | mesh.Scale = Vector3.new(x,y,z) | |
288 | return mesh | |
289 | elseif meshid == 'block' then | |
290 | mesh = Instance.new("SpecialMesh",parent) | |
291 | mesh.MeshId = 'rbxassetid://9856898' | |
292 | mesh.Scale = v3n(x*parent.Size.x,y*parent.Size.y,z*parent.Size.z)*2 | |
293 | if meshtexture then mesh.TextureId = 'rbxassetid://'..textureids[meshtexture] end | |
294 | return mesh | |
295 | end | |
296 | mesh = Instance.new("SpecialMesh",parent) | |
297 | ||
298 | if meshid == 'wedge' then | |
299 | mesh.MeshType = 'Wedge' | |
300 | elseif meshid == 'sphere' then | |
301 | mesh.MeshType = 3 | |
302 | elseif type(meshid) == "number" then | |
303 | mesh.MeshId = "rbxassetid://"..meshid | |
304 | else | |
305 | mesh.MeshId = "rbxassetid://"..meshids[meshid] | |
306 | end | |
307 | mesh.Scale = Vector3.new(x,y,z) | |
308 | if meshtexture then | |
309 | if type(meshtexture) == "number" then mesh.TextureId = "rbxassetid://"..meshtexture else | |
310 | mesh.TextureId = "rbxassetid://"..textureids[meshtexture] end | |
311 | end | |
312 | return mesh | |
313 | end, | |
314 | ||
315 | ["Dec"] = function(parent,face,id,transparency) | |
316 | c = Instance.new("Decal",parent) | |
317 | c.Face = face | |
318 | c.Texture = id | |
319 | if transparency then c.Transparency = transparency end | |
320 | return c | |
321 | end, | |
322 | ["S"] = function(id,pitch,volume,parent) | |
323 | cur = nil | |
324 | found = false | |
325 | if type(id) == 'string' then | |
326 | for i,v in pairs(char.Head:children()) do | |
327 | if v:IsA("Sound") and v.Name == id and not found then | |
328 | cur = v | |
329 | if parent then cur = v:Clone() cur.Parent = parent end | |
330 | cur.Pitch = pitch | |
331 | if volume then cur.Volume = volume end | |
332 | cur:Play() | |
333 | found = true | |
334 | return cur | |
335 | end | |
336 | end | |
337 | elseif type(id) == 'number' then | |
338 | local a = char.Head:FindFirstChild('exteo') | |
339 | a.SoundId = 'rbxassetid://'..id | |
340 | a.Pitch = pitch | |
341 | if volume then a.Volume = volume end | |
342 | a:Play() | |
343 | return a | |
344 | end | |
345 | end | |
346 | } | |
347 | function FindHumanoid(a,b) | |
348 | for i,v in pairs(a:children()) do | |
349 | if v:IsA('Humanoid') then | |
350 | if not b then | |
351 | if v.Parent ~= char then return v end | |
352 | else return v end | |
353 | end | |
354 | end | |
355 | end | |
356 | function damage(hit,amount,delay) ---- VAHINKO DAMAGE | |
357 | hum = FindHumanoid(hit) | |
358 | if hum then | |
359 | if delay then | |
360 | local found = CheckTag(hum,'tag') | |
361 | if not found then | |
362 | local a = AddTag(hum,'tag') | |
363 | debris:AddItem(a,delay) | |
364 | hum.Health = hum.Health - amount | |
365 | end | |
366 | else hum.Health = hum.Health - amount | |
367 | end | |
368 | return hum | |
369 | end | |
370 | end | |
371 | ||
372 | rtorso = torso | |
373 | ||
374 | lock = {["R"] = | |
375 | function(a) | |
376 | if a == 1 then | |
377 | rabrick = T.P(1.1,1.1,1.1,"White",1,false,false) | |
378 | rw = T.W(rabrick,rtorso,1.5,.5,0,0,0,0) | |
379 | T.W(rarm,rabrick,0,-.5,0,0,0,0) | |
380 | elseif a == 2 then | |
381 | rlbrick = T.P(1,1,1,"White",1,false,false) | |
382 | rhw = T.W(rlbrick,rtorso,-.5,-1.5,0,0,0,0) | |
383 | T.W(rleg,rlbrick,0,-.5,0,0,0,0) | |
384 | elseif a == 0 then | |
385 | rs.Parent = rtorso | |
386 | rw.Parent = nil | |
387 | rabrick:Destroy() rabrick = nil | |
388 | elseif a == -1 then | |
389 | rhw.Parent = nil | |
390 | rh.Parent = rtorso | |
391 | rlbrick:Destroy() rlbrick = nil | |
392 | end | |
393 | end | |
394 | , ["L"] = function(a) | |
395 | if a == 1 then | |
396 | labrick = T.P(1,1,1,"White",1,false,false) | |
397 | lw = T.W(labrick,rtorso,-1.5,.5,0,0,0,0) | |
398 | T.W(larm,labrick,0,-.5,0,0,0,0) | |
399 | elseif a == 2 then | |
400 | llbrick = T.P(1,1,1,"White",1,false,false) | |
401 | lhw = T.W(llbrick,rtorso,.5,-1.5,0,0,0,0) | |
402 | T.W(lleg,llbrick,0,-.5,0,0,0,0) | |
403 | elseif a == 0 then | |
404 | ls.Parent = rtorso | |
405 | lw.Parent = nil | |
406 | labrick:Destroy() labrick = nil | |
407 | elseif a == -1 then | |
408 | lhw.Parent = nil | |
409 | lh.Parent = rtorso | |
410 | llbrick:Destroy() llbrick = nil | |
411 | end | |
412 | end | |
413 | } | |
414 | cfn,ang = CFrame.new,CFrame.Angles | |
415 | function spaas(position,radius,number,number2,color) | |
416 | mode = Instance.new("Model",m) | |
417 | ||
418 | for i = 1,number2 do | |
419 | pos = position+v3n(M.R(-radius,radius),M.R(-radius,radius),M.R(-radius,radius)) | |
420 | mag = (position-pos).magnitude | |
421 | ||
422 | col = color or 'Toothpaste' | |
423 | local laz = T.P(.1,mag,.1,col,0,false,true,mode) | |
424 | ||
425 | T.FM(laz,'cylinder',.3,1,.3) | |
426 | laz.CFrame = (cfn(position,pos)*cfn(0,0,-mag/2))*ang(math.pi/2,0,0) | |
427 | ||
428 | cframe = (laz.CFrame*cfn(0,-mag/2,0)).p | |
429 | pos2 = cframe+v3n(M.R(-radius,radius),M.R(-radius,radius),M.R(-radius,radius)) | |
430 | mag2 = (cframe-pos2).magnitude | |
431 | local laz2 = T.P(.1,mag2,.1,col,0,false,true,mode) | |
432 | T.FM(laz2,'cylinder',.3,1,.3) | |
433 | laz2.CFrame = (cfn(cframe,pos2)*cfn(0,0,-mag2/2))*ang(math.pi/2,0,0) | |
434 | ||
435 | previo = laz2 | |
436 | for i = 1,number do | |
437 | cframe = (previo.CFrame*cfn(0,-mag/2,0)).p | |
438 | pos2 = cframe+v3n(M.R(-radius,radius),M.R(-radius,radius),M.R(-radius,radius)) | |
439 | mag2 = (cframe-pos2).magnitude | |
440 | ||
441 | local laz2 = T.P(.1,mag2,.1,col,0,false,true,mode) | |
442 | T.FM(laz2,'cylinder',.3,1,.3) | |
443 | laz2.CFrame = (cfn(cframe,pos2)*cfn(0,0,-mag2/2))*ang(math.pi/2,0,0) | |
444 | ||
445 | previo = laz2 | |
446 | end | |
447 | ||
448 | end | |
449 | debris:AddItem(mode,.1) | |
450 | return mode | |
451 | end | |
452 | ||
453 | function lightning(startpos,endpos,times,offse,livetime,col,dmg) | |
454 | local curpos = startpos | |
455 | for i = 1,times do | |
456 | mag = (startpos-endpos).magnitude offs = {-offse,offse} | |
457 | offset = v3n(offs[M.R(1,2)],offs[M.R(1,2)],offs[M.R(1,2)]) | |
458 | laz = T.P(.1,.1,mag/times,col,0,false,true,m) | |
459 | if dmg then laz.Touched:connect(function(hit) damage(hit.Parent,dmg[1],dmg[2]) end) end | |
460 | apos = (cfn(curpos,endpos)*cfn(0,0,-mag/times)).p+offset | |
461 | if times == i then | |
462 | mag2 = (curpos-endpos).magnitude | |
463 | laz.Size = v3n(.1,.1,mag2) | |
464 | laz.CFrame = cfn(curpos,endpos)*cfn(0,0,-mag2/2) | |
465 | else | |
466 | laz.CFrame = cfn(curpos,apos)*cfn(0,0,-mag/times/2) | |
467 | end | |
468 | curpos = laz.CFrame*cfn(0,0,-mag/times/2).p debris:AddItem(laz,livetime) | |
469 | end | |
470 | end | |
471 | ||
472 | ------MESHIDS--- | |
473 | meshids = {["penguin"] = 15853464, ["ring"] = 3270017, | |
474 | ["spike"] = 1033714,["cone"] = 1082802,["crown"] = 20329976,["crossbow"] = 15886761, | |
475 | ["cloud"] = 1095708,["mjolnir"] = 1279013,["diamond"] = 9756362, ["hand"] = 37241605, | |
476 | ["fist"] = 65322375,["skull"] = 36869983,["totem"] = 35624068,["spikeb"] = 9982590,["dragon"] = 58430372,["fish"] = 31221717, ["coffee"] = 15929962,["spiral"] = 1051557, | |
477 | ["ramen"] = 19380188,["lightning"] = 72583597,["bullet"]=2697549,['cheese'] = 1090700,["pan"] = 24342877,["ketchup"] = 29690481, | |
478 | ["duck"] = 9419831,["unicorn"]=84003494,["luatophat"] = 42157240}---some meshids | |
479 | textureids = {["cone"] = 1082804,["rainbow"] = 28488599,["fish"] = 31221733, ["coffee"] = 24181455,["monster"] = 33366441,["ramen"] = 19380153, | |
480 | ["cheese"] = 1090703} | |
481 | soundids = {["bell"] = 20005706,["flintlock"] = 13510352,["falcon"] = 1387390,['sensa'] = 4700455, | |
482 | ['midas'] = 17385513; | |
483 | ['spark'] = 10756118; | |
484 | ['boom'] = 10730819; | |
485 | ['plank'] = 10548112; | |
486 | ['harmonica1'] = 33069371; | |
487 | ['harmonica2'] = 33069412; | |
488 | ['thump'] = 10730819; | |
489 | ['hit'] = 2801263; | |
490 | ['crunch'] = 15047813; | |
491 | ['Piano'] = 11998796; | |
492 | } | |
493 | ||
494 | function AddTag(object,tagname) local tag = Instance.new("BoolValue",object) tag.Name = tagname return tag end | |
495 | function CheckTag(object,tagname) local found = object:FindFirstChild(tagname) if found then return found else return _ end end | |
496 | function RemoveTag(object,tagname) local found = CheckTag(object,tagname) if found then found:Remove() end end | |
497 | for i,v in pairs(soundids) do ---Remove sounds | |
498 | for _,q in pairs(char.Head:children()) do | |
499 | if q.Name == i then q:Remove() end | |
500 | end | |
501 | end | |
502 | for i,v in pairs(soundids) do ----Add sounds | |
503 | sound = Instance.new("Sound") | |
504 | sound.SoundId = "http://www.roblox.com/asset/?id="..v | |
505 | sound.Name = i | |
506 | sound.Parent = char.Head | |
507 | end | |
508 | genNew('Sound',char.Head,{ | |
509 | Name = 'slash'; | |
510 | SoundId = 'rbxasset://sounds//swordslash.wav' | |
511 | }) | |
512 | ||
513 | waitbp = function(a,r) while (a.Parent.Position-a.position).magnitude > r do wait() end end | |
514 | ||
515 | M = {["R"] = function(a,b) return math.random(a,b) end, | |
516 | ["Cos"] = function(a) return math.cos(a) end, | |
517 | ["Sin"] = function(a) return math.sin(a) end, | |
518 | ["D"] = function(a) return math.rad(a) end | |
519 | } | |
520 | ||
521 | function findground(position,radius,ignore) | |
522 | if ignore then | |
523 | ig = ignore table.insert(ig,m) | |
524 | else ig = {m} | |
525 | end | |
526 | local ray = Ray.new(position.p,position.p+(position.p-v3n(0,200,0)).unit*radius) | |
527 | local obj,pos2 = Workspace:FindPartOnRayWithIgnoreList(ray,ig) | |
528 | if obj and pos2 then return obj,pos2 else return nil end | |
529 | end | |
530 | ||
531 | rweld = _ | |
532 | faketorso = _ | |
533 | function faketor() | |
534 | if rtorso == torso then | |
535 | torso.Transparency = 1 | |
536 | faketorso = T.P(2,2,1,torso.BrickColor.Name,0,false,false,char) | |
537 | rweld = T.W(faketorso,torso,0,0,0,0,0,0) | |
538 | rtorso = faketorso | |
539 | for i,v in pairs({lh,ls,rh,rs}) do v.Part0 = rtorso end | |
540 | elseif rtorso ~= torso then | |
541 | rtorso = torso | |
542 | for i,v in pairs({lh,ls,rh,rs}) do v.Part0 = rtorso end | |
543 | faketorso:Remove() | |
544 | rweld:Remove() | |
545 | torso.Transparency = 0 | |
546 | end | |
547 | dec.Parent = rtorso | |
548 | end | |
549 | ||
550 | function calcp(a,b) --- Direction CFrame | |
551 | return cfn(a,v3n(b.x,a.y,b.z)) | |
552 | end | |
553 | ||
554 | --------ANIMATING FUNCTION-------- | |
555 | tw = function(Weld, Stop, Step,a) | |
556 | local func = function() | |
557 | local Start = Weld.C0 | |
558 | local X1, Y1, Z1 = Start:toEulerAnglesXYZ() | |
559 | local Stop = Stop | |
560 | local X2, Y2, Z2 = Stop:toEulerAnglesXYZ() | |
561 | ||
562 | for i = 0, 1, Step or .1 do | |
563 | Weld.C0 = CFrame.new( (Start.p.X * (1 - i)) + (Stop.p.X * i), | |
564 | (Start.p.Y * (1 - i)) + (Stop.p.Y * i), | |
565 | (Start.p.Z * (1 - i)) + (Stop.p.Z * i)) * CFrame.fromEulerAnglesXYZ( | |
566 | (X1 * (1 - i)) + (X2 * i), (Y1 * (1 - i)) + (Y2 * i), | |
567 | (Z1 * (1 - i)) + (Z2 * i) ) | |
568 | wait() | |
569 | end | |
570 | ||
571 | Weld.C0 = Stop | |
572 | end | |
573 | if a then T.C(function() func() end) else func() end | |
574 | end | |
575 | ------------------------------------ | |
576 | ||
577 | function weldall(q) | |
578 | if q == 1 then a,b = 1,2 else a,b = -1,0 end | |
579 | for i = a,b do lock.R(i) lock.L(i) end | |
580 | end | |
581 | function FindPlayers(a,b,c) --- Finds Players near a part | |
582 | list = {} | |
583 | for i,v in pairs(Workspace:children()) do | |
584 | if v:IsA("Model") then | |
585 | for _,q in pairs(v:children()) do | |
586 | if q:IsA("Humanoid") then | |
587 | if c and q.Parent ~= char then | |
588 | if (q.Torso.Position-a).magnitude < b then | |
589 | table.insert(list,v) | |
590 | end | |
591 | elseif not c then | |
592 | if (q.Torso.Position-a).magnitude < b then | |
593 | table.insert(list,v) | |
594 | end | |
595 | end | |
596 | end | |
597 | end | |
598 | end | |
599 | end | |
600 | return list | |
601 | end | |
602 | end | |
603 | sword = Instance.new("Model",m) | |
604 | hdl = T.P(.3,1,.3,'Brown',0,false,false,sword) | |
605 | ||
606 | blade = T.P(0,4,1,'White',0,false,false,sword) | |
607 | T.W(blade,hdl,0,2.5,0,0,0,0) T.FM(blade,'block',.2,1,1,'rainbow') | |
608 | cougar = T.P(.4,.1,1.1,'New Yeller',0,false,false,sword) | |
609 | T.W(cougar,hdl,0,.5,0,0,0,0) | |
610 | sheath = T.P(.1,1,.5,'Brown',0,false,false) | |
611 | T.W(sheath,torso,1.1,-1,0,M.D(-60),0,M.D(10)) | |
612 | hw = T.W(hdl,sheath,0,1,0,math.pi,0,0) sheathposition = hw.C1 | |
613 | handposition = cfn(0,-1,0)*ang(math.pi/2,0,0) | |
614 | tip = T.P(0,1,1,'White',0,false,false,sword) | |
615 | T.FM(tip,'wedge',.2,1,1) | |
616 | T.W(tip,blade,0,2.5,0,0,0,0) | |
617 | for i,v in pairs({'Top','Bottom','Back','Front','Left','Right'}) do | |
618 | T.Dec(tip,v,asset..textureids['rainbow']) | |
619 | end | |
620 | ||
621 | function trace() decs = {} | |
622 | for i,v in pairs(sword:children()) do | |
623 | local cl = v:Clone() | |
624 | cl.Parent = m | |
625 | cl.Anchored = true | |
626 | for i,v in pairs(cl:children()) do if v:IsA("Decal") then table.insert(decs,v) end end | |
627 | cl.Transparency = .5 | |
628 | for _,v in pairs(decs) do v.Transparency = .5 end | |
629 | T.C(function() for i = .5,1,.05 do | |
630 | cl.Transparency = i wait() | |
631 | for _,v in pairs(decs) do v.Transparency = i end | |
632 | end cl:Remove() end) | |
633 | end | |
634 | end | |
635 | ||
636 | np = cfn()*ang(M.D(-40),M.D(10),0) | |
637 | r = .5 | |
638 | function Connect(func) | |
639 | con1 = blade.Touched:connect(function(hit) func(hit) end) | |
640 | con2 = tip.Touched:connect(function(hit) func(hit) end) | |
641 | return con1,con2 | |
642 | end | |
643 | function Stab() local pw = hw.C1 | |
644 | T.C(function() for i = 0,1,.2 do wait() hw.C1 = pw*ang(M.D(-90*i),0,0) end | |
645 | for i = 1,0,-.2 do wait() hw.C1 = pw*ang(M.D(-90*i),0,0) end end) | |
646 | c1,c2 = Connect(function(hit) local hum = damage(hit.Parent,9000,9999) if hum then spaas(hum.Torso.Position,3,3,3,'random') end end) | |
647 | tw(rw,cfn()*ang(M.D(-90),0,0),.2) | |
648 | tw(rw,np,.2) | |
649 | c1:disconnect() c2:disconnect() | |
650 | end | |
651 | ||
652 | function Portal() pw = hw.C1 len = 0 | |
653 | T.C(function() for i = 0,1,.1 do hw.C1 = pw*ang(-math.pi/2*i,0,0) wait() end end) | |
654 | --hw.C1 = pw*ang(-math.pi/2,0,0) | |
655 | tw(rw,cfn()*ang(M.D(-110),M.D(-30),0),.2) local stpos = (torso.CFrame*cfn(-2,2,-4)).p | |
656 | p = T.P(.1,1,.1,'Black',.5,false,true) T.FM(p,'sphere',1,1,1) local p3 = p | |
657 | T.C(function() for i = 0,1.1,.2 do | |
658 | local stcf = (torso.CFrame*cfn(-2,2,-4)) stpos = stcf.p | |
659 | ep = (torso.CFrame*cfn(4*i,-4*i,-4)).p | |
660 | mag = (stpos-ep).magnitude | |
661 | p.Size = v3n(0,mag,.5*i) | |
662 | p.CFrame = cfn(stpos,ep)*cfn(0,0,-mag/2)*ang(math.pi/2,0,0) | |
663 | wait() | |
664 | end end) | |
665 | tw(rw,cfn()*ang(M.D(-70),M.D(30),0)) | |
666 | cf = p.CFrame | |
667 | local p = T.P(.7,1,.7,'Black',.5,false,true) T.FM(p,'cylinder',1,1,1) | |
668 | local p2 = T.P(1,1,1,'Black',.5,false,true) | |
669 | T.FM(p2,37241605,3,3,3) | |
670 | ray = Ray.new(cf.p,cf.p+(cf.p-(cf.p+torso.CFrame.lookVector*-1)).unit*50) | |
671 | local obj,pos = Workspace:FindPartOnRayWithIgnoreList(ray,{m,sword,char}) | |
672 | if obj and pos then len = (cf.p-pos).magnitude else len = 50 end | |
673 | for i = 0,1,.1 do p.Size = v3n(.7,len*i,.7) | |
674 | p.CFrame = cf*cfn(-len/2*i,0,0)*ang(0,0,math.pi/2) | |
675 | p2.CFrame = p.CFrame*cfn(0,p.Size.y/2+1,1)*ang(math.pi/2,0,0) | |
676 | wait() | |
677 | end | |
678 | ef = T.P(1,1,1,'Black',0,false,true) | |
679 | ef.CFrame = p2.CFrame | |
680 | msh = T.FM(ef,'sphere',1,1,1) | |
681 | for i,v in pairs(FindPlayers(ef.Position,15)) do damage(v,9000,9999) end | |
682 | for i = 0,50,2.5 do | |
683 | msh.Scale = v3n(i,i,i) | |
684 | ef.Transparency = i/50 | |
685 | wait() | |
686 | end ef:Remove() | |
687 | hw.C1 = pw | |
688 | tw(rw,np) | |
689 | T.C(function() for i = .5,1,.05 do p.Transparency,p2.Transparency,p3.Transparency = i,i,i wait() end p:Remove() p2:Remove() p3:Remove() end) | |
690 | end | |
691 | function part(mouse) | |
692 | t= T.P(30,30,30,'White',0,true,true,Workspace) | |
693 | t.CFrame = cfn(mouse.hit.p+v3n(0,15,0)) | |
694 | T.FM(t,'block',1,1,1,'rainbow') | |
695 | end | |
696 | ||
697 | function Whirlwind() | |
698 | bg = T.BG(head) pw = hw.C1 | |
699 | tw(rw,cfn()*ang(M.D(-90),M.D(90),0)) | |
700 | hw.C1 = pw*ang(-math.pi/2,-math.pi/2,0) | |
701 | for i = 1,360*5,60 do | |
702 | bg.cframe = bg.cframe*ang(0,M.D(60),0) | |
703 | wait() | |
704 | pcall(function() | |
705 | for i,v in pairs(FindPlayers(torso.Position,20)) do local hum = damage(v,9000,9999) | |
706 | if hum then | |
707 | if not CheckTag(hum.Torso,'muforce') then | |
708 | bf = Instance.new("BodyVelocity",hum.Torso) | |
709 | bf.Name = 'muforce' | |
710 | bf.maxForce = v3n()*math.huge | |
711 | bf.velocity = calcp(torso.Position,hum.Torso.Position).lookVector*100 | |
712 | debris:AddItem(bf,1) | |
713 | end | |
714 | end | |
715 | end end) | |
716 | end | |
717 | bg:Remove() | |
718 | hw.C1 = pw | |
719 | tw(rw,np) | |
720 | end | |
721 | ||
722 | function Slash() | |
723 | con = blade.Touched:connect(function(hit) damage(hit.Parent,9000,9999) end) | |
724 | tw(rw,cfn()*ang(M.D(-100),M.D(-10),M.D(-70)),1/3) | |
725 | T.C(function()for i = 0,3 do trace() wait() end end) | |
726 | tw(rw,cfn()*ang(M.D(60),M.D(-10),M.D(-70)),1/3) | |
727 | tw(rw,np,.1) | |
728 | con:disconnect() | |
729 | end | |
730 | function Equip() if attacking then return end | |
731 | attacking = true | |
732 | tw(rw,cfn()*ang(M.D(-40),M.D(10),0),.1,'') | |
733 | hw.Part1 = rarm | |
734 | T.C(function() for i = 0,1,.1 do | |
735 | hw.C1 = handposition*ang(M.D(180*i),0,0) wait() end | |
736 | end) | |
737 | attacking = false | |
738 | end | |
739 | function Unequip() if attacking then return end | |
740 | attacking = true | |
741 | tw(rw,cfn()*ang(M.D(-130),M.D(-20),M.D(10)),.1) pw = hw.C1 | |
742 | for i = 0,1,.1 do | |
743 | hw.C1 = pw*ang(M.D(-195*i),0,M.D(8)) | |
744 | wait() | |
745 | end | |
746 | tw(rw,cfn()*ang(M.D(-40),M.D(-20),M.D(5)),.1) pw = hw.C1 | |
747 | hw.Part1 = sheath hw.C1 = sheathposition | |
748 | tw(rw,cfn(),.1) | |
749 | attacking = false | |
750 | end | |
751 | ||
752 | -----------ZOMBIE MAKER FUNCTION------------ | |
753 | function Exorcism() | |
754 | pos = torso.Position+torso.CFrame.lookVector*3+v3n(0,-3,0) | |
755 | ||
756 | person = Instance.new("Model",Workspace) | |
757 | person.Name = 'Zombie' | |
758 | ||
759 | ----PARTS------- | |
760 | local hed = T.P(1,1,1,'White',0,true,false,person) hed.Name = 'Head' | |
761 | Instance.new("SpecialMesh",hed).Scale = v3n(1.25,1.25,1.25) | |
762 | local tor = T.P(2,2,1,'White',0,true,false,person) tor.Name = 'Torso' | |
763 | local ar = T.P(1,2,1,'White',0,true,false,person) ar.Name = 'Left Arm' | |
764 | q = T.W(ar,tor,-.5,0.5,0,0,math.pi/2,0,tor) | |
765 | q.C0 = cfn(1,0.5,0)*ang(0,math.pi/2,0) | |
766 | local ar = T.P(1,2,1,'White',0,true,false,person) ar.Name = 'Right Arm' | |
767 | q2 = T.W(ar,tor,.5,0.5,0,0,math.pi/2,0,tor) | |
768 | q2.C0 = cfn(-1,0.5,0)*ang(0,math.pi/2,0) | |
769 | ||
770 | local ar = T.P(1,2,1,'White',0,true,false,person) ar.Name = 'Right Leg' | |
771 | T.W(ar,tor,-.5,-2,0,0,0,0,tor) | |
772 | local ar = T.P(1,2,1,'White',0,true,false,person) ar.Name = 'Left Leg' | |
773 | T.W(ar,tor,.5,-2,0,0,0,0,tor) | |
774 | ||
775 | T.W(hed,tor,0,1.5,0,0,0,0,tor) | |
776 | ||
777 | ----PARTS------- | |
778 | ||
779 | q.MaxVelocity = .1 | |
780 | q.DesiredAngle = math.pi/2 | |
781 | q2.MaxVelocity = .1 | |
782 | q2.DesiredAngle = math.pi/2 | |
783 | ||
784 | local hum = Instance.new("Humanoid",person) | |
785 | Instance.new("Skin",person).SkinColor = BrickColor.new('Earth green') | |
786 | tor.CFrame = calcp(torso.Position+torso.CFrame.lookVector*5,torso.Position) | |
787 | ||
788 | shirt = Instance.new('Shirt',person) | |
789 | shirt.ShirtTemplate = 'http://www.roblox.com/asset/?id=79001892' | |
790 | ||
791 | pants = Instance.new('Pants',person) | |
792 | pants.PantsTemplate = 'http://www.roblox.com/asset/?id=79001892' | |
793 | crown = T.P(1,1,1,'White',0,false,false) | |
794 | T.FM(crown,1031410,1,1,1,1031417) | |
795 | T.W(crown,hed,-.2,.85,0,0,0,M.D(20),person) | |
796 | face = T.Dec(hed,'Front','http://www.roblox.com/asset/?id=65180938') | |
797 | ||
798 | ---DYING--- | |
799 | hum.Died:connect(function() wait(2) hum.Parent:Remove() end) | |
800 | ---DYING--- | |
801 | end | |
802 | -----------ZOMBIE MAKER FUNCTION------------ | |
803 | function Logg() | |
804 | lock.L(1) | |
805 | logeh = Instance.new("Model",m) | |
806 | tw(lw,cfn()*ang(M.D(-90),M.D(-70),0)) | |
807 | plank = T.P(1,2,1,'Brown',0,true,false,logeh) | |
808 | T.FM(plank,'cylinder',1,1,1) | |
809 | plank2 = T.P(.9,2.01,.9,'Nougat',0,true,false,logeh) | |
810 | T.FM(plank2,'cylinder',1,1,1) | |
811 | T.W(plank2,plank,0,0,0,0,0,0) | |
812 | wld = T.W(plank,larm,0,-1.5,0,math.pi/2,0,0) holding = true | |
813 | while holding do wait() end | |
814 | plank.Touched:connect(function(hit) local hum = damage(hit.Parent,9000,9999) | |
815 | if hum then hum.PlatformStand = true end end) | |
816 | tw(lw,cfn(0,.5,0)*ang(M.D(-90),M.D(40),0),1/3) wait(.1) | |
817 | wld:Remove() | |
818 | debris:AddItem(logeh,2) | |
819 | tw(lw,cfn()) | |
820 | end | |
821 | klist = { | |
822 | {'f',function() Stab() end}; | |
823 | {'e',function() Portal() end}; | |
824 | {'q',function(a) part(a) end}; | |
825 | {'r',function() Whirlwind() end}; | |
826 | {'c',function() Logg() end,''}; | |
827 | {'t',function() Exorcism() end}; | |
828 | } | |
829 | ||
830 | hop.Deselected:connect(function() Unequip() lock.R(0) end) | |
831 | hop.Selected:connect(function(mouse) | |
832 | lock.R(1) Equip() | |
833 | mouse.Button1Up:connect(function() holding = false end) | |
834 | mouse.KeyUp:connect(function(a) for i,v in pairs(klist) do if a == v[1] and v[3] ~= nil then holding = false end end end) | |
835 | mouse.KeyDown:connect(function(key) | |
836 | if attacking then return end | |
837 | for i,v in pairs(klist) do | |
838 | if key == v[1] then attacking = true v[2](mouse) attacking = false end | |
839 | end | |
840 | end) | |
841 | mouse.Button1Down:connect(function() if attacking then return end attacking = true Slash(mouse) attacking = false end) | |
842 | end) | |
843 | --mediafire |