SHOW:
|
|
- or go back to the newest paste.
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 | return RealPlayer[Index] | |
88 | end | |
89 | end; | |
90 | __tostring = function(self) | |
91 | return RealPlayer.Name | |
92 | end | |
93 | }) | |
94 | end | |
95 | end | |
96 | if RealGame[Index] then | |
97 | local Type = type(RealGame[Index]) | |
98 | if Type == "function" then | |
99 | if Index:lower() == "getservice" or Index:lower() == "service" then | |
100 | return function (self,Service) | |
101 | if Service:lower() == "players" then | |
102 | return setmetatable({},{ | |
103 | __index = function (self2,Index2) | |
104 | local RealService = RealGame:GetService(Service) | |
105 | local Type2 = type(Index2) | |
106 | if Type2 == "function" then | |
107 | return function (self,...) | |
108 | return RealService[Index2](RealService,...) | |
109 | end | |
110 | else | |
111 | if Index2:lower() == "localplayer" then | |
112 | return Sandbox(owner) | |
113 | end | |
114 | return RealService[Index2] | |
115 | end | |
116 | end; | |
117 | __tostring = function(self) | |
118 | return RealGame:GetService(Service).Name | |
119 | end | |
120 | }) | |
121 | elseif Service:lower() == "contextactionservice" then | |
122 | return InternalData["ContextActionService"] | |
123 | elseif Service:lower() == "contextactionservice" then | |
124 | return InternalData["UserInputService"] | |
125 | elseif Service:lower() == "runservice" then | |
126 | return setmetatable({},{ | |
127 | __index = function(self2,Index2) | |
128 | local RealService = RealGame:GetService(Service) | |
129 | local Type2 = type(Index2) | |
130 | if Type2 == "function" then | |
131 | return function (self,...) | |
132 | return RealService[Index2](RealService,...) | |
133 | end | |
134 | else | |
135 | if Index2:lower() == "bindtorenderstep" then | |
136 | return function (self,Name,Priority,Function) | |
137 | return RealGame:GetService("RunService").Stepped:Connect(Function) | |
138 | end | |
139 | end | |
140 | if Index2:lower() == "renderstepped" then | |
141 | return RealService["Stepped"] | |
142 | end | |
143 | return RealService[Index2] | |
144 | end | |
145 | end | |
146 | }) | |
147 | else | |
148 | return RealGame:GetService(Service) | |
149 | end | |
150 | end | |
151 | end | |
152 | return function (self,...) | |
153 | return RealGame[Index](RealGame,...) | |
154 | end | |
155 | else | |
156 | if game:GetService(Index) then | |
157 | return game:GetService(Index) | |
158 | end | |
159 | return RealGame[Index] | |
160 | end | |
161 | else | |
162 | return nil | |
163 | end | |
164 | end | |
165 | });Game = game;owner = game:GetService("Players").LocalPlayer | |
166 | print("Complete! Running... Converted by zach ( I dont know creator's name ) ") | |
167 | ||
168 | Player = game:GetService("Players").LocalPlayer | |
169 | Character = Player.Character | |
170 | PlayerGui = Player.PlayerGui | |
171 | Backpack = Player.Backpack | |
172 | Torso = Character.Torso | |
173 | Head = Character.Head | |
174 | Humanoid = Character.Humanoid | |
175 | LeftArm = Character["Left Arm"] | |
176 | LeftLeg = Character["Left Leg"] | |
177 | RightArm = Character["Right Arm"] | |
178 | RightLeg = Character["Right Leg"] | |
179 | LS = Torso["Left Shoulder"] | |
180 | LH = Torso["Left Hip"] | |
181 | RS = Torso["Right Shoulder"] | |
182 | RH = Torso["Right Hip"] | |
183 | Neck = Torso.Neck | |
184 | it=Instance.new | |
185 | vt=Vector3.new | |
186 | cf=CFrame.new | |
187 | euler=CFrame.fromEulerAnglesXYZ | |
188 | angles=CFrame.Angles | |
189 | ||
190 | function swait(num) | |
191 | if num==0 or num==nil then | |
192 | game:service'RunService'.RenderStepped:wait() | |
193 | else | |
194 | for i=0,num do | |
195 | game:service'RunService'.RenderStepped:wait() | |
196 | end | |
197 | end | |
198 | end | |
199 | ||
200 | if Character:findFirstChild("SwordBall",true) ~= nil then | |
201 | Character:findFirstChild("SwordBall",true).Parent = nil | |
202 | end | |
203 | ||
204 | function part(formfactor,parent,reflectance,transparency,brickcolor,name,size) | |
205 | local fp = it("Part") | |
206 | fp.formFactor = formfactor | |
207 | fp.Parent = parent | |
208 | fp.Reflectance = reflectance | |
209 | fp.Transparency = transparency | |
210 | fp.CanCollide = false | |
211 | fp.Locked=true | |
212 | fp.BrickColor = brickcolor | |
213 | fp.Name = name | |
214 | fp.Size = size | |
215 | fp.Position = Torso.Position | |
216 | fp.BottomSurface="Smooth" | |
217 | fp.TopSurface="Smooth" | |
218 | fp:BreakJoints() | |
219 | return fp | |
220 | end | |
221 | ||
222 | function mesh(Mesh,part,meshtype,meshid,offset,scale) | |
223 | local mesh = it(Mesh) | |
224 | mesh.Parent = part | |
225 | if Mesh=="SpecialMesh" then | |
226 | mesh.MeshType = meshtype | |
227 | mesh.MeshId = meshid | |
228 | end | |
229 | mesh.Offset=offset | |
230 | mesh.Scale=scale | |
231 | return mesh | |
232 | end | |
233 | ||
234 | function weld(parent,part0,part1,c0) | |
235 | local weld = it("Weld") | |
236 | weld.Parent = parent | |
237 | weld.Part0 = part0 | |
238 | weld.Part1 = part1 | |
239 | weld.C0 = c0 | |
240 | return weld | |
241 | end | |
242 | ||
243 | showDamage=function(Char,Dealt,du,Color) | |
244 | m=Instance.new("Model") | |
245 | m.Name=tostring(Dealt) | |
246 | h=Instance.new("Humanoid") | |
247 | h.Health=0 | |
248 | h.MaxHealth=0 | |
249 | h.Parent=m | |
250 | c=Instance.new("Part") | |
251 | c.Transparency=0 | |
252 | c.BrickColor=Color | |
253 | c.Name="Head" | |
254 | c.TopSurface=0 | |
255 | c.BottomSurface=0 | |
256 | c.formFactor="Plate" | |
257 | c.Size=Vector3.new(1,.4,1) | |
258 | ms=Instance.new("CylinderMesh") | |
259 | ms.Scale=Vector3.new(.8,.8,.8) | |
260 | if CRIT==true then | |
261 | ms.Scale=Vector3.new(1,1.25,1) | |
262 | end | |
263 | ms.Parent=c | |
264 | c.Reflectance=0 | |
265 | Instance.new("BodyGyro").Parent=c | |
266 | c.Parent=m | |
267 | c.CFrame=CFrame.new(Char["Head"].CFrame.p+Vector3.new(0,1.5,0)) | |
268 | f=Instance.new("BodyPosition") | |
269 | f.P=2000 | |
270 | f.D=100 | |
271 | f.maxForce=Vector3.new(math.huge,math.huge,math.huge) | |
272 | f.position=c.Position+Vector3.new(0,3,0) | |
273 | f.Parent=c | |
274 | game:GetService("Debris"):AddItem(m,.5+du) | |
275 | c.CanCollide=false | |
276 | m.Parent=workspace | |
277 | c.CanCollide=false | |
278 | end | |
279 | ||
280 | local swordball=Instance.new("Model") | |
281 | swordball.Parent=Character | |
282 | swordball.Name="SwordBall" | |
283 | local proppart=part(1,swordball,0,1,BrickColor.new("Black"),"Derp",vt(1,1,1)) | |
284 | local sou=Instance.new("Sound") | |
285 | sou.Parent=proppart | |
286 | sou.Volume=1 | |
287 | sou.Pitch=1 | |
288 | sou.SoundId="http://www.roblox.com/asset/?id=168589016" | |
289 | sou.Looped=true | |
290 | --sou:play() | |
291 | ||
292 | local propwld=weld(proppart,proppart,Torso,euler(0,0,0)*cf(0,-9,0)) | |
293 | ||
294 | local prt1=part(3,swordball,0,1,BrickColor:Random(),"BallRef",vt(2,2,2)) | |
295 | local prt2=part(3,swordball,0,0,BrickColor:Random(),"Ball",vt(1,1,1)) | |
296 | ||
297 | local msh2=mesh("SpecialMesh",prt2,"Sphere","",vt(0,0,0),vt(3,3,3)) | |
298 | ||
299 | local wld2=weld(prt2,prt2,prt1,cf(0,0,0)*euler(0,0,0)) | |
300 | coroutine.resume(coroutine.create(function(Weld,Part) | |
301 | derp=0 | |
302 | while Part.Parent~=nil do | |
303 | swait() | |
304 | wld2.C0=euler(0,derp,0) | |
305 | derp=derp+0.1 | |
306 | end | |
307 | end),wld2,prt2) | |
308 | ||
309 | numb=0 | |
310 | numb2=0 | |
311 | for i=1,8 do | |
312 | for i=1,8 do | |
313 | local prt3=part(3,swordball,0,0,BrickColor:Random(),"Sword",vt(1,1,1)) | |
314 | local msh3=mesh("SpecialMesh",prt3,"FileMesh","http://www.roblox.com/asset/?id=1029523",vt(0,0,0),vt(0.05,0.05,0.05)) | |
315 | --http://www.roblox.com/asset/?id=1029523 | |
316 | local wld3=weld(prt3,prt3,prt2,cf(0,0,2.5)*euler(numb,numb2,numb2)) | |
317 | numb=numb+0.785 | |
318 | end | |
319 | numb2=numb2+0.785 | |
320 | end | |
321 | ||
322 | prop=Instance.new("RocketPropulsion") | |
323 | prop.MaxSpeed=5000 | |
324 | prop.CartoonFactor=0 | |
325 | prop.MaxThrust=100000 | |
326 | prop.Parent=prt2 | |
327 | prop.Target=proppart | |
328 | prop.ThrustD=1.5 | |
329 | prop.TurnD=0 | |
330 | prop.TurnP=0 | |
331 | prop:Fire() | |
332 | ||
333 | --[[velp=Instance.new("BodyGyro") | |
334 | velp.Parent=prt1 | |
335 | velp.maxTorque=Vector3.new(4e+005,4e+005,4e+005)*math.huge | |
336 | velp.P=20e+003 | |
337 | velp.cframe=cf(0,0,0) | |
338 | coroutine.resume(coroutine.create(function(Velo,Part) | |
339 | while Part.Parent~=nil do | |
340 | for i=0,1,0.1 do | |
341 | swait() | |
342 | Velo.cframe=Velo.cframe*euler(0,3.14*i,0) | |
343 | end | |
344 | end | |
345 | end),velp,sprt)]] | |
346 | --[[wait(5) | |
347 | local sou=Instance.new("Sound") | |
348 | sou.Parent=prt1 | |
349 | sou.Volume=1 | |
350 | sou.Pitch=1 | |
351 | sou.SoundId="rbxasset://sounds\\unsheath.wav" | |
352 | sou.Looped=true | |
353 | wait() | |
354 | sou:play() ]] | |
355 | while true do | |
356 | swait(200) | |
357 | for d=1,1 do | |
358 | for _,c in pairs(workspace:children()) do | |
359 | local hum=c:findFirstChild("Humanoid") | |
360 | if hum~=nil then | |
361 | local head=c:findFirstChild("Torso") | |
362 | if head~=nil then | |
363 | local targ=head.Position-prt1.Position | |
364 | local mag=targ.magnitude | |
365 | if mag<=10000 and c.Name~=Player.Name then | |
366 | local sprt=part(3,workspace,0,1,BrickColor:Random(),"Sword",vt(6,6,6)) | |
367 | local sprt2=part(3,workspace,0,0,BrickColor:Random(),"Sword",vt(1,1,1)) | |
368 | local smsh=mesh("SpecialMesh",sprt2,"FileMesh","http://www.roblox.com/asset/?id=1029523",vt(0,0,0),vt(0.1,0.1,0.1)) | |
369 | local swld=weld(sprt2,sprt2,sprt,euler(0,0,0)) | |
370 | local teh=0 | |
371 | game:GetService("Debris"):AddItem(sprt,20) | |
372 | game:GetService("Debris"):AddItem(sprt2,20) | |
373 | coroutine.resume(coroutine.create(function(Weld,Part) | |
374 | numb1=0 | |
375 | while Part.Parent~=nil do | |
376 | swait() | |
377 | Part.BrickColor=BrickColor:Random() | |
378 | Weld.C0=Weld.C0*angles(0,numb1,0) | |
379 | numb1=math.pi/math.random(10,20) | |
380 | end | |
381 | end),swld,sprt2) | |
382 | sprt.CFrame=prt1.CFrame | |
383 | sprt.Velocity=vt(-math.random(20,50),math.random(20,50),-math.random(20,50)) | |
384 | --[[if d==1 then | |
385 | sprt.Velocity=vt(math.random(50,200),math.random(20,50),0) | |
386 | elseif d==2 then | |
387 | sprt.Velocity=vt(-math.random(50,200),math.random(20,50),0) | |
388 | elseif d==3 then | |
389 | sprt.Velocity=vt(0,math.random(20,50),math.random(50,200)) | |
390 | elseif d==4 then | |
391 | sprt.Velocity=vt(0,math.random(20,50),-math.random(50,200)) | |
392 | end]] | |
393 | local sou=Instance.new("Sound") | |
394 | sou.Parent=sprt | |
395 | sou.Volume=1 | |
396 | sou.Pitch=1 | |
397 | sou.SoundId="http://www.roblox.com/asset/?id=166545328" | |
398 | --sou.SoundId="http://www.roblox.com/asset/?id=168589016" | |
399 | sou.Looped=true | |
400 | sou:play() | |
401 | prop=Instance.new("RocketPropulsion") | |
402 | prop.MaxSpeed=50000 | |
403 | prop.CartoonFactor=0 | |
404 | prop.MaxThrust=100000 | |
405 | prop.Parent=sprt | |
406 | prop.Target=head | |
407 | --[[prop.TurnD=0 | |
408 | prop.TurnP=100]] | |
409 | prop:Fire() | |
410 | con1=sprt.Touched:connect(function(hit) | |
411 | if hit.Parent==nil then | |
412 | return | |
413 | end | |
414 | h=hit.Parent:FindFirstChild("Humanoid") | |
415 | for _,v in pairs(hit.Parent:children()) do | |
416 | if v:IsA("Humanoid") then | |
417 | h=v | |
418 | end | |
419 | end | |
420 | if h~=nil and hit.Parent.Name~=Character.Name and hit.Parent:FindFirstChild("Torso")~=nil then | |
421 | if h.Health~=0 then | |
422 | sprt.Parent=nil | |
423 | sprt2.Parent=nil | |
424 | damage=math.random(999999,99999999) | |
425 | h:TakeDamage(damage) | |
426 | hit:BreakJoints() | |
427 | hit.Anchored=false | |
428 | hit.Velocity=Vector3.new(math.random(-100,100),math.random(-100,100),math.random(-100,100)) | |
429 | showDamage(h.Parent,damage,1,BrickColor.new("Bright red")) | |
430 | local sou=Instance.new("Sound") | |
431 | sou.Parent=hit | |
432 | sou.Volume=1 | |
433 | sou.Pitch=1 | |
434 | sou.SoundId="http://www.roblox.com/asset/?id=168009623" | |
435 | sou.Looped=false | |
436 | --sou:play() | |
437 | end | |
438 | elseif hit.Name~="Base" and hit.Parent~=swordball and hit.Parent.Name~=Character.Name and hit.Name~="Sword" then | |
439 | hit:BreakJoints() | |
440 | hit.Velocity=Vector3.new(math.random(-100,100),math.random(-100,100),math.random(-100,100)) | |
441 | hit.Anchored=false | |
442 | end | |
443 | end) | |
444 | end | |
445 | end | |
446 | end | |
447 | end | |
448 | end | |
449 | end |