Advertisement
gecksad

Untitled

Dec 25th, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.27 KB | None | 0 0
  1. --]]
  2. --https://github.com/Mokiros/roblox-FE-compatibility
  3. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  4. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  5. local RealPlayer = Player
  6. do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end
  7.  
  8. --Converted with ttyyuu12345's model to script plugin v4
  9. function sandbox(var,func)
  10. local env = getfenv(func)
  11. local newenv = setmetatable({},{
  12. __index = function(self,k)
  13. if k=="script" then
  14. return var
  15. else
  16. return env[k]
  17. end
  18. end,
  19. })
  20. setfenv(func,newenv)
  21. return func
  22. end
  23. cors = {}
  24. mas = Instance.new("Model",game:GetService("Lighting"))
  25. Tool0 = Instance.new("Tool")
  26. Script1 = Instance.new("Script")
  27. Part2 = Instance.new("Part")
  28. SpecialMesh3 = Instance.new("SpecialMesh")
  29. Sound4 = Instance.new("Sound")
  30. Sound5 = Instance.new("Sound")
  31. Sound6 = Instance.new("Sound")
  32. Fire7 = Instance.new("Fire")
  33. LocalScript8 = Instance.new("LocalScript")
  34. Tool0.Name = "Joel's Flaming Super Death Sword"
  35. Tool0.Parent = mas
  36. Tool0.TextureId = "http://www.roblox.com/asset/?id=11444089"
  37. Tool0.GripForward = Vector3.new(-1, -0, -0)
  38. Tool0.GripPos = Vector3.new(0, 0, -1.70000005)
  39. Tool0.GripRight = Vector3.new(0, 1, 0)
  40. Tool0.GripUp = Vector3.new(0, 0, 1)
  41. Tool0.ToolTip = "Joel? Have you been downloading viruses again?"
  42. Script1.Name = "SwordScript"
  43. Script1.Parent = Tool0
  44. table.insert(cors,sandbox(Script1,function()
  45. -------- OMG HAX
  46.  
  47. r = game:service("RunService")
  48.  
  49.  
  50. local damage = 10
  51.  
  52.  
  53. local slash_damage = 25
  54. local lunge_damage = 50
  55.  
  56. sword = script.Parent.Handle
  57. Tool = script.Parent
  58.  
  59.  
  60. local SlashSound = Instance.new("Sound")
  61. SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
  62. SlashSound.Parent = sword
  63. SlashSound.Volume = .7
  64.  
  65. local LungeSound = Instance.new("Sound")
  66. LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
  67. LungeSound.Parent = sword
  68. LungeSound.Volume = .6
  69.  
  70. local UnsheathSound = Instance.new("Sound")
  71. UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
  72. UnsheathSound.Parent = sword
  73. UnsheathSound.Volume = 1
  74.  
  75.  
  76. function blow(hit)
  77. local humanoid = hit.Parent:findFirstChild("Humanoid")
  78. local vCharacter = Tool.Parent
  79. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  80. local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  81. if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  82. -- final check, make sure sword is in-hand
  83.  
  84. local right_arm = vCharacter:FindFirstChild("Right Arm")
  85. if (right_arm ~= nil) then
  86. local joint = right_arm:FindFirstChild("RightGrip")
  87. if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
  88. tagHumanoid(humanoid, vPlayer)
  89. humanoid:TakeDamage(damage)
  90. wait(1)
  91. untagHumanoid(humanoid)
  92. end
  93. end
  94.  
  95.  
  96. end
  97. end
  98.  
  99.  
  100. function tagHumanoid(humanoid, player)
  101. local creator_tag = Instance.new("ObjectValue")
  102. creator_tag.Value = player
  103. creator_tag.Name = "creator"
  104. creator_tag.Parent = humanoid
  105. end
  106.  
  107. function untagHumanoid(humanoid)
  108. if humanoid ~= nil then
  109. local tag = humanoid:findFirstChild("creator")
  110. if tag ~= nil then
  111. tag.Parent = nil
  112. end
  113. end
  114. end
  115.  
  116.  
  117. function attack()
  118. damage = slash_damage
  119. SlashSound:play()
  120. local anim = Instance.new("StringValue")
  121. anim.Name = "toolanim"
  122. anim.Value = "Slash"
  123. anim.Parent = Tool
  124. end
  125.  
  126. function lunge()
  127. damage = lunge_damage
  128.  
  129. LungeSound:play()
  130.  
  131. local anim = Instance.new("StringValue")
  132. anim.Name = "toolanim"
  133. anim.Value = "Lunge"
  134. anim.Parent = Tool
  135.  
  136.  
  137. force = Instance.new("BodyVelocity")
  138. force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
  139. force.Parent = Tool.Parent.Torso
  140. wait(.2)
  141. swordOut()
  142. wait(.2)
  143. force.Parent = nil
  144. wait(.4)
  145. swordUp()
  146.  
  147. damage = slash_damage
  148. end
  149.  
  150. function swordUp()
  151. Tool.GripForward = Vector3.new(-1,0,0)
  152. Tool.GripRight = Vector3.new(0,1,0)
  153. Tool.GripUp = Vector3.new(0,0,1)
  154. end
  155.  
  156. function swordOut()
  157. Tool.GripForward = Vector3.new(0,0,1)
  158. Tool.GripRight = Vector3.new(0,1,0)
  159. Tool.GripUp = Vector3.new(1,0,0)
  160. end
  161.  
  162. function swordAcross()
  163. -- parry
  164. end
  165.  
  166.  
  167. Tool.Enabled = true
  168. local last_attack = 0
  169. function onActivated()
  170.  
  171. if not Tool.Enabled then
  172. return
  173. end
  174.  
  175. Tool.Enabled = false
  176.  
  177. local character = Tool.Parent;
  178. local humanoid = character.Humanoid
  179. if humanoid == nil then
  180. print("Humanoid not found")
  181. return
  182. end
  183.  
  184. t = r.Stepped:wait()
  185.  
  186. if (t - last_attack < .2) then
  187. lunge()
  188. else
  189. attack()
  190. end
  191.  
  192. last_attack = t
  193.  
  194. --wait(.5)
  195.  
  196. Tool.Enabled = true
  197. end
  198.  
  199.  
  200. function onEquipped()
  201. UnsheathSound:play()
  202. end
  203.  
  204.  
  205. script.Parent.Activated:connect(onActivated)
  206. script.Parent.Equipped:connect(onEquipped)
  207.  
  208.  
  209. connection = sword.Touched:connect(blow)
  210.  
  211.  
  212.  
  213. end))
  214. Part2.Name = "Handle"
  215. Part2.Parent = Tool0
  216. Part2.BrickColor = BrickColor.new("Dark stone grey")
  217. Part2.Reflectance = 0.40000000596046
  218. Part2.Rotation = Vector3.new(-90, 0, 89.9599991)
  219. Part2.FormFactor = Enum.FormFactor.Plate
  220. Part2.Size = Vector3.new(1, 0.800000012, 5)
  221. Part2.CFrame = CFrame.new(-4.40033627, 2.5, 1.49973083, 0.000673112052, -0.999999762, -5.82076609e-11, 7.12051502e-08, 3.19377025e-11, 1, -0.999999762, -0.000673112052, 4.74638355e-08)
  222. Part2.BottomSurface = Enum.SurfaceType.Smooth
  223. Part2.TopSurface = Enum.SurfaceType.Smooth
  224. Part2.Color = Color3.new(0.388235, 0.372549, 0.384314)
  225. Part2.Position = Vector3.new(-4.40033627, 2.5, 1.49973083)
  226. Part2.Orientation = Vector3.new(-90, 89.9599991, 0)
  227. Part2.Color = Color3.new(0.388235, 0.372549, 0.384314)
  228. SpecialMesh3.Parent = Part2
  229. SpecialMesh3.MeshId = "http://www.roblox.com/asset/?id=11442510"
  230. SpecialMesh3.Scale = Vector3.new(1.70000005, 1.70000005, 1.70000005)
  231. SpecialMesh3.TextureId = "http://www.roblox.com/asset/?id=236171900"
  232. SpecialMesh3.MeshType = Enum.MeshType.FileMesh
  233. SpecialMesh3.Scale = Vector3.new(1.70000005, 1.70000005, 1.70000005)
  234. Sound4.Parent = Part2
  235. Sound4.SoundId = "rbxasset://sounds/swordslash.wav"
  236. Sound4.Volume = 0.69999998807907
  237. Sound5.Parent = Part2
  238. Sound5.SoundId = "rbxasset://sounds/swordlunge.wav"
  239. Sound5.Volume = 0.60000002384186
  240. Sound6.Parent = Part2
  241. Sound6.SoundId = "rbxasset://sounds/unsheath.wav"
  242. Sound6.Volume = 1
  243. Fire7.Parent = Part2
  244. Fire7.Heat = 7
  245. LocalScript8.Name = "Local Gui"
  246. LocalScript8.Parent = Tool0
  247. for i,v in pairs(mas:GetChildren()) do
  248. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  249. pcall(function() v:MakeJoints() end)
  250. end
  251. mas:Destroy()
  252. for i,v in pairs(cors) do
  253. spawn(function()
  254. pcall(v)
  255. end)
  256. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement