Advertisement
DarkScriptZEditors

THA TEA

Dec 20th, 2018
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.16 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,game,owner = owner,game
  3. local RealPlayer = Player
  4. do
  5. print("FE Compatibility code by Mokiros")
  6. local rp = RealPlayer
  7. script.Parent = rp.Character
  8.  
  9. --RemoteEvent for communicating
  10. local Event = Instance.new("RemoteEvent")
  11. Event.Name = "UserInput_Event"
  12.  
  13. --Fake event to make stuff like Mouse.KeyDown work
  14. local function fakeEvent()
  15. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  16. t.connect = t.Connect
  17. return t
  18. end
  19.  
  20. --Creating fake input objects with fake variables
  21. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  22. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  23. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  24. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  25. end}
  26. --Merged 2 functions into one by checking amount of arguments
  27. CAS.UnbindAction = CAS.BindAction
  28.  
  29. --This function will trigger the events that have been :Connect()'ed
  30. local function te(self,ev,...)
  31. local t = m[ev]
  32. if t and t._fakeEvent then
  33. for _,f in pairs(t.Functions) do
  34. f(...)
  35. end
  36. end
  37. end
  38. m.TrigEvent = te
  39. UIS.TrigEvent = te
  40.  
  41. Event.OnServerEvent:Connect(function(plr,io)
  42. if plr~=rp then return end
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. if not io.isMouse then
  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. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  51. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  52. end
  53. for _,t in pairs(CAS.Actions) do
  54. for _,k in pairs(t.Keys) do
  55. if k==io.KeyCode then
  56. t.Function(t.Name,io.UserInputState,io)
  57. end
  58. end
  59. end
  60. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  61. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  62. end
  63. end)
  64. Event.Parent = NLS([==[
  65. local Player = game:GetService("Players").LocalPlayer
  66. local Event = script:WaitForChild("UserInput_Event")
  67. local Mouse = Player:GetMouse()
  68. local UIS = game:GetService("UserInputService")
  69. local input = function(io,a)
  70. if a then return end
  71. --Since InputObject is a client-side instance, we create and pass table instead
  72. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  73. end
  74. UIS.InputBegan:Connect(input)
  75. UIS.InputEnded:Connect(input)
  76. local h,t
  77. --Give the server mouse data 30 times every second, but only if the values changed
  78. --If player is not moving their mouse, client won't fire events
  79. while wait(1/30) do
  80. if h~=Mouse.Hit or t~=Mouse.Target then
  81. h,t=Mouse.Hit,Mouse.Target
  82. Event:FireServer({isMouse=true,Target=t,Hit=h})
  83. end
  84. end]==],Player.Character)
  85.  
  86. ----Sandboxed game object that allows the usage of client-side methods and services
  87. --Real game object
  88. local _rg = game
  89.  
  90. --Metatable for fake service
  91. local fsmt = {
  92. __index = function(self,k)
  93. local s = rawget(self,"_RealService")
  94. if s then
  95. return typeof(s[k])=="function"
  96. and function(_,...)return s[k](s,...)end or s[k]
  97. end
  98. end,
  99. __newindex = function(self,k,v)
  100. local s = rawget(self,"_RealService")
  101. if s then s[k]=v end
  102. end
  103. }
  104. local function FakeService(t,RealService)
  105. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  106. return setmetatable(t,fsmt)
  107. end
  108.  
  109. --Fake game object
  110. local g = {
  111. GetService = function(self,s)
  112. return rawget(self,s) or _rg:GetService(s)
  113. end,
  114. Players = FakeService({
  115. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  116. },"Players"),
  117. UserInputService = FakeService(UIS,"UserInputService"),
  118. ContextActionService = FakeService(CAS,"ContextActionService"),
  119. RunService = FakeService({
  120. _btrs = {},
  121. RenderStepped = _rg:GetService("RunService").Heartbeat,
  122. BindToRenderStep = function(self,name,_,fun)
  123. self._btrs[name] = self.Heartbeat:Connect(fun)
  124. end,
  125. UnbindFromRenderStep = function(self,name)
  126. self._btrs[name]:Disconnect()
  127. end,
  128. },"RunService")
  129. }
  130. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  131. g.service = g.GetService
  132. FakeService(g,game)
  133. --Changing owner to fake player object to support owner:GetMouse()
  134. game,owner = g,g.Players.LocalPlayer
  135. end
  136. Player = game:GetService("Players").LocalPlayer
  137. Character = Player.Character
  138. PlayerGui = Player.PlayerGui
  139. Backpack = Player.Backpack
  140. Torso = Character.Torso
  141. Head = Character.Head
  142. Humanoid = Character.Humanoid
  143. LeftArm = Character["Left Arm"]
  144. LeftLeg = Character["Left Leg"]
  145. RightArm = Character["Right Arm"]
  146. RightLeg = Character["Right Leg"]
  147. LS = Torso["Left Shoulder"]
  148. LH = Torso["Left Hip"]
  149. RS = Torso["Right Shoulder"]
  150. RH = Torso["Right Hip"]
  151. Neck = Torso.Neck
  152. it=Instance.new
  153. vt=Vector3.new
  154. cf=CFrame.new
  155. euler=CFrame.fromEulerAnglesXYZ
  156. angles=CFrame.Angles
  157.  
  158. function swait(num)
  159. if num==0 or num==nil then
  160. game:service'RunService'.RenderStepped:wait()
  161. else
  162. for i=0,num do
  163. game:service'RunService'.RenderStepped:wait()
  164. end
  165. end
  166. end
  167.  
  168. if Character:findFirstChild("SwordBall",true) ~= nil then
  169. Character:findFirstChild("SwordBall",true).Parent = nil
  170. end
  171.  
  172. function part(formfactor,parent,reflectance,transparency,brickcolor,name,size)
  173. local fp = it("Part")
  174. fp.formFactor = formfactor
  175. fp.Parent = parent
  176. fp.Reflectance = reflectance
  177. fp.Transparency = transparency
  178. fp.CanCollide = false
  179. fp.Locked=true
  180. fp.BrickColor = brickcolor
  181. fp.Name = name
  182. fp.Size = size
  183. fp.Position = Torso.Position
  184. fp.BottomSurface="Smooth"
  185. fp.TopSurface="Smooth"
  186. fp:BreakJoints()
  187. return fp
  188. end
  189.  
  190. function mesh(Mesh,part,meshtype,meshid,offset,scale)
  191. local mesh = it(Mesh)
  192. mesh.Parent = part
  193. if Mesh=="SpecialMesh" then
  194. mesh.MeshType = meshtype
  195. mesh.MeshId = meshid
  196. end
  197. mesh.Offset=offset
  198. mesh.Scale=scale
  199. return mesh
  200. end
  201.  
  202. function weld(parent,part0,part1,c0)
  203. local weld = it("Weld")
  204. weld.Parent = parent
  205. weld.Part0 = part0
  206. weld.Part1 = part1
  207. weld.C0 = c0
  208. return weld
  209. end
  210.  
  211. showDamage=function(Char,Dealt,du,Color)
  212. m=Instance.new("Model")
  213. m.Name=tostring(Dealt)
  214. h=Instance.new("Humanoid")
  215. h.Health=0
  216. h.MaxHealth=0
  217. h.Parent=m
  218. c=Instance.new("Part")
  219. c.Transparency=0
  220. c.BrickColor=Color
  221. c.Name="Head"
  222. c.TopSurface=0
  223. c.BottomSurface=0
  224. c.formFactor="Plate"
  225. c.Size=Vector3.new(1,.4,1)
  226. ms=Instance.new("CylinderMesh")
  227. ms.Scale=Vector3.new(.8,.8,.8)
  228. if CRIT==true then
  229. ms.Scale=Vector3.new(1,1.25,1)
  230. end
  231. ms.Parent=c
  232. c.Reflectance=0
  233. Instance.new("BodyGyro").Parent=c
  234. c.Parent=m
  235. c.CFrame=CFrame.new(Char["Head"].CFrame.p+Vector3.new(0,1.5,0))
  236. f=Instance.new("BodyPosition")
  237. f.P=2000
  238. f.D=100
  239. f.maxForce=Vector3.new(math.huge,math.huge,math.huge)
  240. f.position=c.Position+Vector3.new(0,3,0)
  241. f.Parent=c
  242. game:GetService("Debris"):AddItem(m,.5+du)
  243. c.CanCollide=false
  244. m.Parent=workspace
  245. c.CanCollide=false
  246. end
  247.  
  248. local swordball=Instance.new("Model")
  249. swordball.Parent=Character
  250. swordball.Name="SwordBall"
  251. local proppart=part(1,swordball,0,1,BrickColor.new("Black"),"Derp",vt(1,1,1))
  252. local sou=Instance.new("Sound")
  253. sou.Parent=proppart
  254. sou.Volume=1
  255. sou.Pitch=1
  256. sou.SoundId="http://www.roblox.com/asset/?id=168589016"
  257. sou.Looped=true
  258. --sou:play()
  259.  
  260. local propwld=weld(proppart,proppart,Torso,euler(0,0,0)*cf(0,-9,0))
  261.  
  262. local prt1=part(3,swordball,0,1,BrickColor:Random(),"BallRef",vt(2,2,2))
  263. local prt2=part(3,swordball,0,0,BrickColor:Random(),"Ball",vt(1,1,1))
  264.  
  265. local msh2=mesh("SpecialMesh",prt2,"Sphere","",vt(0,0,0),vt(3,3,3))
  266.  
  267. local wld2=weld(prt2,prt2,prt1,cf(0,0,0)*euler(0,0,0))
  268. coroutine.resume(coroutine.create(function(Weld,Part)
  269. derp=0
  270. while Part.Parent~=nil do
  271. swait()
  272. wld2.C0=euler(0,derp,0)
  273. derp=derp+0.1
  274. end
  275. end),wld2,prt2)
  276.  
  277. numb=0
  278. numb2=0
  279. for i=1,8 do
  280. for i=1,8 do
  281. local prt3=part(3,swordball,0,0,BrickColor:Random(),"Sword",vt(1,1,1))
  282. local msh3=mesh("SpecialMesh",prt3,"FileMesh","http://www.roblox.com/asset/?id=1029523",vt(0,0,0),vt(0.05,0.05,0.05))
  283. --http://www.roblox.com/asset/?id=1029523
  284. local wld3=weld(prt3,prt3,prt2,cf(0,0,2.5)*euler(numb,numb2,numb2))
  285. numb=numb+0.785
  286. end
  287. numb2=numb2+0.785
  288. end
  289.  
  290. prop=Instance.new("RocketPropulsion")
  291. prop.MaxSpeed=5000
  292. prop.CartoonFactor=0
  293. prop.MaxThrust=100000
  294. prop.Parent=prt2
  295. prop.Target=proppart
  296. prop.ThrustD=1.5
  297. prop.TurnD=0
  298. prop.TurnP=0
  299. prop:Fire()
  300.  
  301. --[[velp=Instance.new("BodyGyro")
  302. velp.Parent=prt1
  303. velp.maxTorque=Vector3.new(4e+005,4e+005,4e+005)*math.huge
  304. velp.P=20e+003
  305. velp.cframe=cf(0,0,0)
  306. coroutine.resume(coroutine.create(function(Velo,Part)
  307. while Part.Parent~=nil do
  308. for i=0,1,0.1 do
  309. swait()
  310. Velo.cframe=Velo.cframe*euler(0,3.14*i,0)
  311. end
  312. end
  313. end),velp,sprt)]]
  314. --[[wait(5)
  315. local sou=Instance.new("Sound")
  316. sou.Parent=prt1
  317. sou.Volume=1
  318. sou.Pitch=1
  319. sou.SoundId="rbxasset://sounds\\unsheath.wav"
  320. sou.Looped=true
  321. wait()
  322. sou:play() ]]
  323. while true do
  324. swait(200)
  325. for d=1,1 do
  326. for _,c in pairs(workspace:children()) do
  327. local hum=c:findFirstChild("Humanoid")
  328. if hum~=nil then
  329. local head=c:findFirstChild("Torso")
  330. if head~=nil then
  331. local targ=head.Position-prt1.Position
  332. local mag=targ.magnitude
  333. if mag<=10000 and c.Name~=Player.Name then
  334. local sprt=part(3,workspace,0,1,BrickColor:Random(),"Sword",vt(6,6,6))
  335. local sprt2=part(3,workspace,0,0,BrickColor:Random(),"Sword",vt(1,1,1))
  336. local smsh=mesh("SpecialMesh",sprt2,"FileMesh","http://www.roblox.com/asset/?id=1029523",vt(0,0,0),vt(0.1,0.1,0.1))
  337. local swld=weld(sprt2,sprt2,sprt,euler(0,0,0))
  338. local teh=0
  339. game:GetService("Debris"):AddItem(sprt,20)
  340. game:GetService("Debris"):AddItem(sprt2,20)
  341. coroutine.resume(coroutine.create(function(Weld,Part)
  342. numb1=0
  343. while Part.Parent~=nil do
  344. swait()
  345. Part.BrickColor=BrickColor:Random()
  346. Weld.C0=Weld.C0*angles(0,numb1,0)
  347. numb1=math.pi/math.random(10,20)
  348. end
  349. end),swld,sprt2)
  350. sprt.CFrame=prt1.CFrame
  351. sprt.Velocity=vt(-math.random(20,50),math.random(20,50),-math.random(20,50))
  352. --[[if d==1 then
  353. sprt.Velocity=vt(math.random(50,200),math.random(20,50),0)
  354. elseif d==2 then
  355. sprt.Velocity=vt(-math.random(50,200),math.random(20,50),0)
  356. elseif d==3 then
  357. sprt.Velocity=vt(0,math.random(20,50),math.random(50,200))
  358. elseif d==4 then
  359. sprt.Velocity=vt(0,math.random(20,50),-math.random(50,200))
  360. end]]
  361. local sou=Instance.new("Sound")
  362. sou.Parent=sprt
  363. sou.Volume=1
  364. sou.Pitch=1
  365. sou.SoundId="http://www.roblox.com/asset/?id=166545328"
  366. --sou.SoundId="http://www.roblox.com/asset/?id=168589016"
  367. sou.Looped=true
  368. sou:play()
  369. prop=Instance.new("RocketPropulsion")
  370. prop.MaxSpeed=50000
  371. prop.CartoonFactor=0
  372. prop.MaxThrust=100000
  373. prop.Parent=sprt
  374. prop.Target=head
  375. --[[prop.TurnD=0
  376. prop.TurnP=100]]
  377. prop:Fire()
  378. con1=sprt.Touched:connect(function(hit)
  379. if hit.Parent==nil then
  380. return
  381. end
  382. h=hit.Parent:FindFirstChild("Humanoid")
  383. for _,v in pairs(hit.Parent:children()) do
  384. if v:IsA("Humanoid") then
  385. h=v
  386. end
  387. end
  388. if h~=nil and hit.Parent.Name~=Character.Name and hit.Parent:FindFirstChild("Torso")~=nil then
  389. if h.Health~=0 then
  390. sprt.Parent=nil
  391. sprt2.Parent=nil
  392. damage=math.random(999999,99999999)
  393. h:TakeDamage(damage)
  394. hit:BreakJoints()
  395. hit.Anchored=false
  396. hit.Velocity=Vector3.new(math.random(-100,100),math.random(-100,100),math.random(-100,100))
  397. showDamage(h.Parent,damage,1,BrickColor.new("Bright red"))
  398. local sou=Instance.new("Sound")
  399. sou.Parent=hit
  400. sou.Volume=1
  401. sou.Pitch=1
  402. sou.SoundId="http://www.roblox.com/asset/?id=168009623"
  403. sou.Looped=false
  404. --sou:play()
  405. end
  406. elseif hit.Name~="Base" and hit.Parent~=swordball and hit.Parent.Name~=Character.Name and hit.Name~="Sword" then
  407. hit:BreakJoints()
  408. hit.Velocity=Vector3.new(math.random(-100,100),math.random(-100,100),math.random(-100,100))
  409. hit.Anchored=false
  410. end
  411. end)
  412. end
  413. end
  414. end
  415. end
  416. end
  417. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement