Advertisement
sawgamer1

Untitled

Apr 30th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.71 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do print("FE Compatibility code V2 by Mokiros")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end
  6.  
  7. --Converted with ttyyuu12345's model to script plugin v4
  8. function sandbox(var,func)
  9. local env = getfenv(func)
  10. local newenv = setmetatable({},{
  11. __index = function(self,k)
  12. if k=="script" then
  13. return var
  14. else
  15. return env[k]
  16. end
  17. end,
  18. })
  19. setfenv(func,newenv)
  20. return func
  21. end
  22. cors = {}
  23. mas = Instance.new("Model",game:GetService("Lighting"))
  24. Tool0 = Instance.new("Tool")
  25. Part1 = Instance.new("Part")
  26. SpecialMesh2 = Instance.new("SpecialMesh")
  27. Sound3 = Instance.new("Sound")
  28. Sound4 = Instance.new("Sound")
  29. Sound5 = Instance.new("Sound")
  30. Script6 = Instance.new("Script")
  31. LocalScript7 = Instance.new("LocalScript")
  32. Camera8 = Instance.new("Camera")
  33. Tool0.Name = "ClassicSword"
  34. Tool0.Parent = mas
  35. Tool0.TextureId = "rbxasset://Textures/Sword128.png"
  36. Tool0.Grip = CFrame.new(0, 0, -1.5, 0, 0, 1, 1, 0, 0, 0, 1, 0)
  37. Tool0.GripForward = Vector3.new(-1, -0, -0)
  38. Tool0.GripPos = Vector3.new(0, 0, -1.5)
  39. Tool0.GripRight = Vector3.new(0, 1, 0)
  40. Tool0.GripUp = Vector3.new(0, 0, 1)
  41. Part1.Name = "Handle"
  42. Part1.Parent = Tool0
  43. Part1.CFrame = CFrame.new(-3.17383099, 1.57000101, 3.03996301, 0.0910440385, -0.881099463, 0.464084357, 0.537011683, 0.435894847, 0.722229123, -0.838648558, 0.183463722, 0.512845576)
  44. Part1.Orientation = Vector3.new(-46.2400017, 42.1399994, 50.9300003)
  45. Part1.Position = Vector3.new(-3.17383099, 1.57000101, 3.03996301)
  46. Part1.Rotation = Vector3.new(-54.6199989, 27.6499996, 84.0999985)
  47. Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
  48. Part1.Size = Vector3.new(1, 0.800000012, 4)
  49. Part1.BottomSurface = Enum.SurfaceType.Smooth
  50. Part1.BrickColor = BrickColor.new("Dark stone grey")
  51. Part1.Locked = true
  52. Part1.Reflectance = 0.40000000596046
  53. Part1.TopSurface = Enum.SurfaceType.Smooth
  54. Part1.brickColor = BrickColor.new("Dark stone grey")
  55. Part1.FormFactor = Enum.FormFactor.Plate
  56. Part1.formFactor = Enum.FormFactor.Plate
  57. SpecialMesh2.Parent = Part1
  58. SpecialMesh2.MeshId = "rbxasset://fonts/sword.mesh"
  59. SpecialMesh2.TextureId = "rbxasset://textures/SwordTexture.png"
  60. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  61. Sound3.Name = "SwordSlash"
  62. Sound3.Parent = Part1
  63. Sound3.SoundId = "http://www.roblox.com/asset/?id=12222216"
  64. Sound3.Volume = 0.69999998807907
  65. Sound4.Name = "SwordLunge"
  66. Sound4.Parent = Part1
  67. Sound4.SoundId = "http://www.roblox.com/asset/?id=12222208"
  68. Sound4.Volume = 0.60000002384186
  69. Sound5.Name = "Unsheath"
  70. Sound5.Parent = Part1
  71. Sound5.SoundId = "http://www.roblox.com/asset/?id=12222225"
  72. Sound5.Volume = 1
  73. Script6.Name = "SwordScript"
  74. Script6.Parent = Tool0
  75. table.insert(cors,sandbox(Script6,function()
  76. --Rescripted by Luckymaxer
  77. --EUROCOW WAS HERE BECAUSE I MADE THE PARTICLES AND THEREFORE THIS ENTIRE SWORD PRETTY AND LOOK PRETTY WORDS AND I'D LIKE TO DEDICATE THIS TO MY FRIENDS AND HI LUCKYMAXER PLS FIX SFOTH SWORDS TY LOVE Y'ALl
  78. --Updated for R15 avatars by StarWars
  79. --Re-updated by TakeoHonorable
  80.  
  81. Tool = script.Parent
  82. Handle = Tool:WaitForChild("Handle")
  83.  
  84. function Create(ty)
  85. return function(data)
  86. local obj = Instance.new(ty)
  87. for k, v in pairs(data) do
  88. if type(k) == 'number' then
  89. v.Parent = obj
  90. else
  91. obj[k] = v
  92. end
  93. end
  94. return obj
  95. end
  96. end
  97.  
  98. local BaseUrl = "rbxassetid://"
  99.  
  100. Players = game:GetService("Players")
  101. Debris = game:GetService("Debris")
  102. RunService = game:GetService("RunService")
  103.  
  104. DamageValues = {
  105. BaseDamage = 5,
  106. SlashDamage = 10,
  107. LungeDamage = 30
  108. }
  109.  
  110. --For R15 avatars
  111. Animations = {
  112. R15Slash = 522635514,
  113. R15Lunge = 522638767
  114. }
  115.  
  116. Damage = DamageValues.BaseDamage
  117.  
  118. Grips = {
  119. Up = CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0),
  120. Out = CFrame.new(0, 0, -1.70000005, 0, 1, 0, 1, -0, 0, 0, 0, -1)
  121. }
  122.  
  123. Sounds = {
  124. Slash = Handle:WaitForChild("SwordSlash"),
  125. Lunge = Handle:WaitForChild("SwordLunge"),
  126. Unsheath = Handle:WaitForChild("Unsheath")
  127. }
  128.  
  129. ToolEquipped = false
  130.  
  131. --For Omega Rainbow Katana thumbnail to display a lot of particles.
  132. for i, v in pairs(Handle:GetChildren()) do
  133. if v:IsA("ParticleEmitter") then
  134. v.Rate = 20
  135. end
  136. end
  137.  
  138. Tool.Grip = Grips.Up
  139. Tool.Enabled = true
  140.  
  141. function IsTeamMate(Player1, Player2)
  142. return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
  143. end
  144.  
  145. function TagHumanoid(humanoid, player)
  146. local Creator_Tag = Instance.new("ObjectValue")
  147. Creator_Tag.Name = "creator"
  148. Creator_Tag.Value = player
  149. Debris:AddItem(Creator_Tag, 2)
  150. Creator_Tag.Parent = humanoid
  151. end
  152.  
  153. function UntagHumanoid(humanoid)
  154. for i, v in pairs(humanoid:GetChildren()) do
  155. if v:IsA("ObjectValue") and v.Name == "creator" then
  156. v:Destroy()
  157. end
  158. end
  159. end
  160.  
  161. function Blow(Hit)
  162. if not Hit or not Hit.Parent or not CheckIfAlive() or not ToolEquipped then
  163. return
  164. end
  165. local RightArm = Character:FindFirstChild("Right Arm") or Character:FindFirstChild("RightHand")
  166. if not RightArm then
  167. return
  168. end
  169. local RightGrip = RightArm:FindFirstChild("RightGrip")
  170. if not RightGrip or (RightGrip.Part0 ~= Handle and RightGrip.Part1 ~= Handle) then
  171. return
  172. end
  173. local character = Hit.Parent
  174. if character == Character then
  175. return
  176. end
  177. local humanoid = character:FindFirstChildOfClass("Humanoid")
  178. if not humanoid or humanoid.Health == 0 then
  179. return
  180. end
  181. local player = Players:GetPlayerFromCharacter(character)
  182. if player and (player == Player or IsTeamMate(Player, player)) then
  183. return
  184. end
  185. UntagHumanoid(humanoid)
  186. TagHumanoid(humanoid, Player)
  187. humanoid:TakeDamage(Damage)
  188. end
  189.  
  190.  
  191. function Attack()
  192. Damage = DamageValues.SlashDamage
  193. Sounds.Slash:Play()
  194.  
  195. if Humanoid then
  196. if Humanoid.RigType == Enum.HumanoidRigType.R6 then
  197. local Anim = Instance.new("StringValue")
  198. Anim.Name = "toolanim"
  199. Anim.Value = "Slash"
  200. Anim.Parent = Tool
  201. elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then
  202. local Anim = Tool:FindFirstChild("R15Slash")
  203. if Anim then
  204. local Track = Humanoid:LoadAnimation(Anim)
  205. Track:Play(0)
  206. end
  207. end
  208. end
  209. end
  210.  
  211. function Lunge()
  212. Damage = DamageValues.LungeDamage
  213.  
  214. Sounds.Lunge:Play()
  215.  
  216. if Humanoid then
  217. if Humanoid.RigType == Enum.HumanoidRigType.R6 then
  218. local Anim = Instance.new("StringValue")
  219. Anim.Name = "toolanim"
  220. Anim.Value = "Lunge"
  221. Anim.Parent = Tool
  222. elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then
  223. local Anim = Tool:FindFirstChild("R15Lunge")
  224. if Anim then
  225. local Track = Humanoid:LoadAnimation(Anim)
  226. Track:Play(0)
  227. end
  228. end
  229. end
  230. --[[
  231. if CheckIfAlive() then
  232. local Force = Instance.new("BodyVelocity")
  233. Force.velocity = Vector3.new(0, 10, 0)
  234. Force.maxForce = Vector3.new(0, 4000, 0)
  235. Debris:AddItem(Force, 0.4)
  236. Force.Parent = Torso
  237. end
  238. ]]
  239.  
  240. wait(0.2)
  241. Tool.Grip = Grips.Out
  242. wait(0.6)
  243. Tool.Grip = Grips.Up
  244.  
  245. Damage = DamageValues.SlashDamage
  246. end
  247.  
  248. Tool.Enabled = true
  249. LastAttack = 0
  250.  
  251. function Activated()
  252. if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then
  253. return
  254. end
  255. Tool.Enabled = false
  256. local Tick = RunService.Stepped:wait()
  257. if (Tick - LastAttack < 0.2) then
  258. Lunge()
  259. else
  260. Attack()
  261. end
  262. LastAttack = Tick
  263. --wait(0.5)
  264. Damage = DamageValues.BaseDamage
  265. local SlashAnim = (Tool:FindFirstChild("R15Slash") or Create("Animation"){
  266. Name = "R15Slash",
  267. AnimationId = BaseUrl .. Animations.R15Slash,
  268. Parent = Tool
  269. })
  270.  
  271. local LungeAnim = (Tool:FindFirstChild("R15Lunge") or Create("Animation"){
  272. Name = "R15Lunge",
  273. AnimationId = BaseUrl .. Animations.R15Lunge,
  274. Parent = Tool
  275. })
  276. Tool.Enabled = true
  277. end
  278.  
  279. function CheckIfAlive()
  280. return (((Player and Player.Parent and Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent) and true) or false)
  281. end
  282.  
  283. function Equipped()
  284. Character = Tool.Parent
  285. Player = Players:GetPlayerFromCharacter(Character)
  286. Humanoid = Character:FindFirstChildOfClass("Humanoid")
  287. Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("HumanoidRootPart")
  288. if not CheckIfAlive() then
  289. return
  290. end
  291. ToolEquipped = true
  292. Sounds.Unsheath:Play()
  293. end
  294.  
  295. function Unequipped()
  296. Tool.Grip = Grips.Up
  297. ToolEquipped = false
  298. end
  299.  
  300. Tool.Activated:Connect(Activated)
  301. Tool.Equipped:Connect(Equipped)
  302. Tool.Unequipped:Connect(Unequipped)
  303.  
  304. Connection = Handle.Touched:Connect(Blow)
  305. end))
  306. LocalScript7.Name = "MouseIcon"
  307. LocalScript7.Parent = Tool0
  308. table.insert(cors,sandbox(LocalScript7,function()
  309. --Made by Luckymaxer
  310.  
  311. Mouse_Icon = "rbxasset://textures/GunCursor.png"
  312. Reloading_Icon = "rbxasset://textures/GunWaitCursor.png"
  313.  
  314. Tool = script.Parent
  315.  
  316. Mouse = nil
  317.  
  318. function UpdateIcon()
  319. if Mouse then
  320. Mouse.Icon = Tool.Enabled and Mouse_Icon or Reloading_Icon
  321. end
  322. end
  323.  
  324. function OnEquipped(ToolMouse)
  325. Mouse = ToolMouse
  326. UpdateIcon()
  327. end
  328.  
  329. function OnChanged(Property)
  330. if Property == "Enabled" then
  331. UpdateIcon()
  332. end
  333. end
  334.  
  335. Tool.Equipped:Connect(OnEquipped)
  336. Tool.Changed:Connect(OnChanged)
  337.  
  338. end))
  339. Camera8.Name = "ThumbnailCamera"
  340. Camera8.Parent = Tool0
  341. Camera8.CFrame = CFrame.new(-5.67428207, 2.83736515, 3.79184556, 0.289030313, 0.416664183, -0.861888885, -0, 0.900314331, 0.435240269, 0.957319915, -0.125797629, 0.260218143)
  342. Camera8.CoordinateFrame = CFrame.new(-5.67428207, 2.83736515, 3.79184556, 0.289030313, 0.416664183, -0.861888885, -0, 0.900314331, 0.435240269, 0.957319915, -0.125797629, 0.260218143)
  343. Camera8.Focus = CFrame.new(-3.9505043, 1.96688461, 3.27140927, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  344. Camera8.focus = CFrame.new(-3.9505043, 1.96688461, 3.27140927, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  345. for i,v in pairs(mas:GetChildren()) do
  346. v.Parent = script
  347. pcall(function() v:MakeJoints() end)
  348. end
  349. mas:Destroy()
  350. for i,v in pairs(cors) do
  351. spawn(function()
  352. pcall(v)
  353. end)
  354. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement