kaualima12

Untitled

Nov 1st, 2019
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.30 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
  6. print("FE Compatibility code V2 by Mokiros")
  7. local RealPlayer = RealPlayer
  8. script.Parent = RealPlayer.Character
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local Disconnect_Function = function(this)
  12. this[1].Functions[this[2]] = nil
  13. end
  14. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  15. local FakeEvent_Metatable = {__index={
  16. Connect = function(this,f)
  17. local i = tostring(math.random(0,10000))
  18. while this.Functions[i] do
  19. i = tostring(math.random(0,10000))
  20. end
  21. this.Functions[i] = f
  22. return setmetatable({this,i},Disconnect_Metatable)
  23. end
  24. }}
  25. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  26. local function fakeEvent()
  27. return setmetatable({Functions={}},FakeEvent_Metatable)
  28. end
  29.  
  30. --Creating fake input objects with fake variables
  31. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  32. FakeMouse.keyUp = FakeMouse.KeyUp
  33. FakeMouse.keyDown = FakeMouse.KeyDown
  34. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  35. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  36. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  37. end}
  38. --Merged 2 functions into one by checking amount of arguments
  39. CAS.UnbindAction = CAS.BindAction
  40.  
  41. --This function will trigger the events that have been :Connect()'ed
  42. local function TriggerEvent(self,ev,...)
  43. for _,f in pairs(self[ev].Functions) do
  44. f(...)
  45. end
  46. end
  47. FakeMouse.TriggerEvent = TriggerEvent
  48. UIS.TriggerEvent = TriggerEvent
  49.  
  50. --Client communication
  51. local Event = Instance.new("RemoteEvent")
  52. Event.Name = "UserInput_Event"
  53. Event.OnServerEvent:Connect(function(plr,io)
  54. if plr~=RealPlayer then return end
  55. FakeMouse.Target = io.Target
  56. FakeMouse.Hit = io.Hit
  57. if not io.isMouse then
  58. local b = io.UserInputState == Enum.UserInputState.Begin
  59. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  60. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  61. end
  62. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  63. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  64. end
  65. for _,t in pairs(CAS.Actions) do
  66. for _,k in pairs(t.Keys) do
  67. if k==io.KeyCode then
  68. t.Function(t.Name,io.UserInputState,io)
  69. end
  70. end
  71. end
  72. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  73. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  74. end
  75. end)
  76. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  77. local Mouse = owner:GetMouse()
  78. local UIS = game:GetService("UserInputService")
  79. local input = function(io,RobloxHandled)
  80. if RobloxHandled then return end
  81. --Since InputObject is a client-side instance, we create and pass table instead
  82. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  83. end
  84. UIS.InputBegan:Connect(input)
  85. UIS.InputEnded:Connect(input)
  86.  
  87. local h,t
  88. --Give the server mouse data every second frame, but only if the values changed
  89. --If player is not moving their mouse, client won't fire events
  90. local HB = game:GetService("RunService").Heartbeat
  91. while true do
  92. if h~=Mouse.Hit or t~=Mouse.Target then
  93. h,t=Mouse.Hit,Mouse.Target
  94. Event:FireServer({isMouse=true,Target=t,Hit=h})
  95. end
  96. --Wait 2 frames
  97. for i=1,2 do
  98. HB:Wait()
  99. end
  100. end]==],script)
  101.  
  102. ----Sandboxed game object that allows the usage of client-side methods and services
  103. --Real game object
  104. local RealGame = game
  105.  
  106. --Metatable for fake service
  107. local FakeService_Metatable = {
  108. __index = function(self,k)
  109. local s = rawget(self,"_RealService")
  110. if s then
  111. return typeof(s[k])=="function"
  112. and function(_,...)return s[k](s,...)end or s[k]
  113. end
  114. end,
  115. __newindex = function(self,k,v)
  116. local s = rawget(self,"_RealService")
  117. if s then s[k]=v end
  118. end
  119. }
  120. local function FakeService(t,RealService)
  121. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  122. return setmetatable(t,FakeService_Metatable)
  123. end
  124.  
  125. --Fake game object
  126. local FakeGame = {
  127. GetService = function(self,s)
  128. return rawget(self,s) or RealGame:GetService(s)
  129. end,
  130. Players = FakeService({
  131. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  132. },"Players"),
  133. UserInputService = FakeService(UIS,"UserInputService"),
  134. ContextActionService = FakeService(CAS,"ContextActionService"),
  135. RunService = FakeService({
  136. _btrs = {},
  137. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  138. BindToRenderStep = function(self,name,_,fun)
  139. self._btrs[name] = self.Heartbeat:Connect(fun)
  140. end,
  141. UnbindFromRenderStep = function(self,name)
  142. self._btrs[name]:Disconnect()
  143. end,
  144. },"RunService")
  145. }
  146. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  147. FakeGame.service = FakeGame.GetService
  148. FakeService(FakeGame,game)
  149. --Changing owner to fake player object to support owner:GetMouse()
  150. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  151. end
  152.  
  153. --a duck ball (by boss_kiddos)
  154. p = game.Players.LocalPlayer
  155. char = p.Character
  156. pgui = p.PlayerGui
  157. Debounce = false
  158. local sin, cos, atan, rad, rand, rands = math.sin, math.cos, math.atan, math.rad, math.random, math.randomseed
  159. mouse= p:GetMouse()
  160. rarm = char["Right Arm"]
  161. larm = char["Left Arm"]
  162. rleg = char["Right Leg"]
  163. lleg = char["Left Leg"]
  164. local Euler = CFrame.fromEulerAnglesXYZ
  165. hed = char.Head
  166. torso = char.Torso
  167. root = char.HumanoidRootPart
  168. sinestep = 0
  169. melee = false
  170. smelee = false
  171. local sine, change = 0, 1
  172. local animpose = "Idle"
  173. local lastanimpose = "Idle"
  174. local sine = 0
  175. local change = 1
  176. local rs = game:service'RunService'
  177. local srs = rs.Stepped
  178. local animstop = false
  179. local animstopr = false
  180. local cf, ang, eu, v3 = CFrame.new, CFrame.Angles, CFrame.fromEulerAnglesXYZ, Vector3.new
  181. function clerp(c1,c2,al)
  182. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
  183. local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  184. for i,v in pairs(com1) do
  185. com1[i] = v+(com2[i]-v)*al
  186. end
  187. return cf(com1[1],com1[2],com1[3]) * ang(select(4,unpack(com1)))
  188. end
  189. srs:connect(function()
  190. sine = tick() * (change * 25)
  191. end)
  192. local s = Instance.new("Sound",Character)
  193. s.Name = "BGMusic"
  194. s.SoundId = "rbxassetid://1071384374"
  195. s.Pitch = 1
  196. s.Volume = 35
  197. s.Looped = true
  198. s.archivable = false
  199. wait(0.1)
  200. s:play()
  201.  
  202.  
  203.  
  204.  
  205.  
  206. --Welds--
  207. newWeld = function(wp0, wp1, wc0x, wc0y, wc0z)
  208. local wld = Instance.new("Weld", wp1)
  209. wld.Part0 = wp0
  210. wld.Part1 = wp1
  211. wld.C0 = CFrame.new(wc0x, wc0y, wc0z)
  212. end
  213. newWeld(torso, larm, -1.5, 0.5, 0)
  214. larm.Weld.C1 = CFrame.new(0, 0.5, 0)
  215. newWeld(torso, rarm, 1.5, 0.5, 0)
  216. rarm.Weld.C1 = CFrame.new(0, 0.5, 0)
  217. newWeld(torso, hed, 0, 1.5, 0)
  218. newWeld(torso, lleg, -0.5, -1, 0)
  219. lleg.Weld.C1 = CFrame.new(0, 1, 0)
  220. newWeld(torso, rleg, 0.5, -1, 0)
  221. rleg.Weld.C1 = CFrame.new(0, 1, 0)
  222. newWeld(root, torso, 0, -1, 0)
  223. torso.Weld.C1 = CFrame.new(0, -1, 0)
  224.  
  225. o1 = Instance.new("Part")
  226. o1.Parent = char
  227. o1.CanCollide = false
  228. o1.Shape = Enum.PartType.Ball
  229. o1.Size = Vector3.new(1.67000008, 1.67000008, 1.67000008)
  230. o1.BottomSurface = Enum.SurfaceType.Smooth
  231. o1.TopSurface = Enum.SurfaceType.Smooth
  232. newWeld(torso, o1, 0, -1, 0)
  233. o1.Weld.C1 = CFrame.new(0,-1,1.7)
  234. o1.BrickColor = BrickColor.new("Gold")
  235. o2 = Instance.new("Decal",o1)
  236. o2.Texture = "http://www.roblox.com/asset/?id=1004332745"
  237.  
  238.  
  239. Knife = Instance.new("Part")
  240. Knim = Instance.new("SpecialMesh")
  241. Knife.Name = "Handle"
  242. Knife.Parent = game.Lighting
  243. Knife.CanCollide = false
  244. Knife.Anchored = false
  245. Knife.Material = Enum.Material.DiamondPlate
  246. Knife.BrickColor = BrickColor.new("New Yeller")
  247. Knife.Reflectance = 0.0099999997764826
  248. Knife.Elasticity = 0
  249. Knife.FormFactor = Enum.FormFactor.Custom
  250. Knife.Size = Vector3.new(0.400000006, 5, 0.800000012)
  251. Knife.BottomSurface = Enum.SurfaceType.Smooth
  252. Knife.TopSurface = Enum.SurfaceType.Smooth
  253. Knife.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  254. Knim.Parent = Knife
  255. Knim.MeshId = "http://www.roblox.com/asset/?id=9419831 "
  256. Knim.TextureId = "http://www.roblox.com/asset/?id=9419827"
  257. Knim.MeshType = Enum.MeshType.FileMesh
  258. Inst = Instance.new
  259. BC = BrickColor.new
  260. Vec = Vector3.new
  261. Colour1 = " Yeller"
  262. Cf = CFrame.new
  263. local function MakeWave()
  264. local Wave = Inst("Model", workspace)
  265. Wave.Name = "Wave"
  266. local WM = Inst("Part", Wave)
  267. WM.BrickColor = BC("New Yeller")
  268. WM.Material = "Neon"
  269. WM.Name = "WavePart"
  270. WM.Position = Vec(10.3, 7.6, -239.4)
  271. WM.Rotation = Vec(-180, 0, -180)
  272. WM.Anchored = true
  273. WM.CanCollide = false
  274. WM.Locked = true
  275. WM.Size = Vec(1, 2.4, 1)
  276. local W1 = Inst("Part", Wave)
  277. W1.BrickColor = BC(Colour1)
  278. W1.Material = "Neon"
  279. W1.Name = "WavePart"
  280. W1.Position = Vec(10.3, 9.648, -239.664)
  281. W1.Rotation = Vec(165, 0, -180)
  282. W1.Anchored = true
  283. W1.CanCollide = false
  284. W1.Locked = true
  285. W1.Size = Vec(1, 2.1, 1)
  286. local W2 = Inst("Part", Wave)
  287. W2.BrickColor = BC(Colour1)
  288. W2.Material = "Neon"
  289. W2.Name = "WavePart"
  290. W2.Position = Vec(10.3, 11.4, -240.4)
  291. W2.Rotation = Vec(150, 0, -180)
  292. W2.Anchored = true
  293. W2.CanCollide = false
  294. W2.Locked = true
  295. W2.Size = Vec(1, 2, 1)
  296. local W3 = Inst("Part", Wave)
  297. W3.BrickColor = BC(Colour1)
  298. W3.Material = "Neon"
  299. W3.Name = "WavePart"
  300. W3.Position = Vec(10.3, 5.552, -239.663)
  301. W3.Rotation = Vec(-165, 0, -180)
  302. W3.Anchored = true
  303. W3.CanCollide = false
  304. W3.Locked = true
  305. W3.Size = Vec(1, 2.1, 1)
  306. local W4 = Inst("Part", Wave)
  307. W4.BrickColor = BC(Colour1)
  308. W4.Material = "Neon"
  309. W4.Name = "WavePart"
  310. W4.Position = Vec(10.3, 3.8, -240.4)
  311. W4.Rotation = Vec(-150, 0, -180)
  312. W4.Anchored = true
  313. W4.CanCollide = false
  314. W4.Locked = true
  315. W4.Size = Vec(1, 2, 1)
  316. local WH = Inst("Part", Wave)
  317. WH.Transparency = 1
  318. WH.Name = "WaveHitbox"
  319. WH.Position = Vec(10.3, 7.6, -240.2)
  320. WH.Rotation = Vec(-180, 0, -180)
  321. WH.Anchored = true
  322. WH.CanCollide = false
  323. WH.Locked = true
  324. WH.Size = Vec(5, 12, 8)
  325. for _, w in pairs(Wave:GetChildren()) do
  326. if w:IsA("BasePart") and w ~= WH then
  327. local W = Inst("Weld", WH)
  328. W.Part0 = WH
  329. W.Part1 = w
  330. W.C0 = WH.CFrame:inverse() * Cf(WH.Position)
  331. W.C1 = w.CFrame:inverse() * Cf(WH.Position)
  332. local M = Inst("BlockMesh", w)
  333. M.Scale = Vec(0, 1, 1)
  334. end
  335. end
  336. local SiP = {NumberSequenceKeypoint.new(0, 1, 0), NumberSequenceKeypoint.new(1, .188, 0)}
  337. local TrP = {NumberSequenceKeypoint.new(0, 0, 0), NumberSequenceKeypoint.new(1, 1, 0)}
  338. local PE = Inst("ParticleEmitter", WH)
  339. PE.Color = ColorSequence.new(BC(Colour1).Color)
  340. PE.LightEmission = 1
  341. PE.Size = NumberSequence.new(SiP)
  342. PE.Transparency = NumberSequence.new(TrP)
  343. PE.EmissionDirection = "Back"
  344. PE.Lifetime = NumberRange.new(.2, .8)
  345. PE.Rate = 500
  346. PE.Rotation = NumberRange.new(60, 120)
  347. PE.RotSpeed = NumberRange.new(120, 360)
  348. PE.Speed = NumberRange.new(30)
  349. return Wave, WH
  350. end
  351. --Mouse Attack--
  352. hit1 = true
  353. hit2 = false
  354. hited = false
  355. attackdeb = false
  356. mouse.Button1Down:connect(function()
  357. if melee == false then
  358. if smelee == false then
  359. if Debounce == false then
  360. Debounce = true
  361. char.Humanoid.WalkSpeed = 0
  362. local Sound = Instance.new("Sound",o1)
  363. Sound.SoundId = "rbxassetid://681582832"
  364. Sound:Play()
  365. local Eff = Instance.new("Part",o1)
  366. Eff.Size = Vector3.new(3,3,3)
  367. Eff.CFrame = o1.CFrame
  368. Eff.CanCollide = false
  369. Eff.Anchored = true
  370. Eff.Transparency = 0.5
  371. Eff.Material = "Neon"
  372. Eff.BrickColor = BrickColor.new("Gold")
  373. for i = 1,100 do
  374. wait()
  375. Eff.CFrame = Eff.CFrame * CFrame.Angles(math.random(),math.random(),math.random())
  376. end
  377. local Beam = Instance.new("Part",o1)
  378. Beam.Size = Vector3.new(3,3,3)
  379. Beam.CFrame = torso.CFrame * CFrame.new(0,0,-2)
  380. Beam.CanCollide = false
  381. Beam.Anchored = true
  382. Beam.Transparency = 0.5
  383. Beam.Material = "Neon"
  384. Beam.BrickColor = BrickColor.new("Gold")
  385. local si = 0
  386. Sound.SoundId = 'rbxassetid://525289290'
  387. Sound:Play()
  388. for i = 1, 100 do
  389. si = si + 1
  390. Eff.CFrame = Eff.CFrame * CFrame.Angles(math.random(),math.random(),math.random())
  391. Beam.Size = Beam.Size + Vector3.new(0, 0, 4)
  392. Beam.Touched:connect(function(Hit)
  393. if Hit.Anchored == false and Hit.Parent ~= char then
  394. Hit:remove()
  395. end
  396. wait()
  397. end)
  398. Beam.CFrame = char.HumanoidRootPart.CFrame * CFrame.new(0, 0, -4 + -2 * si)
  399. wait()
  400. end
  401. for i = 1,6 do
  402. wait()
  403. Beam.Size = Beam.Size - Vector3.new(.5, 0, 0)
  404. end
  405. Beam:Destroy()
  406. Eff:Destroy()
  407. Sound:Destroy()
  408. char.Humanoid.WalkSpeed = 8
  409. Debounce = false
  410. end
  411. end
  412. end
  413. if melee == true then
  414. if Debounce == false then
  415. Debounce = true
  416. animstopr = true
  417. for i=1,10 do
  418. wait()
  419. rarm.Weld.C1 = clerp(rarm.Weld.C1, cf(-0.3,.5,0.5) * ang(rad(-120),rad(0),rad(-90)),0.3)
  420. end
  421. for i=1,6 do
  422. wait()
  423. rarm.Weld.C1 = clerp(rarm.Weld.C1, cf(-0.2,0,0) * ang(rad(20),rad(0),rad(-90)),0.3)
  424. end
  425. local Wave, WHB = MakeWave()
  426. for _, p in pairs(Wave:GetChildren()) do
  427. if p:IsA("BasePart") then
  428. p.Anchored = false
  429. end
  430. end
  431. WHB.CFrame = root.CFrame * Euler(0, 0, rad(90))
  432. local Vel = Inst("BodyVelocity", WHB)
  433. Vel.MaxForce = Vec(math.huge, math.huge, math.huge)
  434. Vel.Velocity = WHB.CFrame.lookVector * 220
  435. local Gyr = Inst("BodyGyro", WHB)
  436. Gyr.CFrame = WHB.CFrame
  437. Gyr.MaxTorque = Vec(math.huge, math.huge, math.huge)
  438. local attack = false
  439. warn("Made by Owlv?")
  440.  
  441. local list = {}
  442. local numFrags = 2
  443. math.randomseed(tick())
  444. WHB.Touched:connect(function(hit)
  445. if hit.Name ~= "Fragment" and hit.Name ~= "Base" and hit.Parent ~= char and hit.Parent.Parent ~= char then
  446. local sizeX = hit.Size.X/numFrags
  447. local sizeY = hit.Size.Y/numFrags
  448. local sizeZ = hit.Size.Z/numFrags
  449.  
  450. local startX = (hit.Position.X - hit.Size.X/2) + sizeX/2
  451. local startY = (hit.Position.Y - hit.Size.Y/2) + sizeY/2
  452. local startZ = (hit.Position.Z - hit.Size.Z/2) + sizeZ/2
  453.  
  454. for x=0,numFrags-1 do
  455. for y=0,numFrags-1 do
  456. for z=0,numFrags-1 do
  457. local part = Instance.new("Part")
  458. part.Size = Vector3.new(sizeX,sizeY,sizeZ)
  459. part.BrickColor = hit.BrickColor
  460. part.Material = hit.Material
  461. part.Transparency = hit.Transparency
  462. part.Reflectance = hit.Reflectance
  463. part.CanCollide = true
  464. part.CFrame = CFrame.new(startX+x*sizeX, startY+y*sizeY, startZ+z*sizeZ)
  465. part.Anchored = true
  466. table.insert(list, part)
  467. part.Name = "Fragment"
  468. part.Parent = hit.Parent
  469. end
  470. end
  471. end
  472.  
  473. hit:Destroy()
  474.  
  475. for i,v in pairs(list) do
  476. v.Anchored = false
  477. end
  478.  
  479. end
  480. end)
  481. Debounce = false
  482. animstopr = false
  483. end
  484.  
  485. end
  486. if smelee == true then
  487. if melee == false then
  488. if Debounce == false then
  489. Debounce = true
  490. animstopr = true
  491. attackdeb = true
  492. Knife.Touched:connect(function(hit)
  493. if attackdeb == false then
  494. local ehum = hit.Parent:findFirstChild("Humanoid") or hit.Parent.Parent:findFirstChild("Humanoid")
  495. if ehum ~= char.Humanoid and ehum ~= nil then
  496. attackdeb = true
  497.  
  498. hit.Parent.Head.face.Texture = "http://www.roblox.com/asset/?id=93815042"
  499. local Head = hit.Parent:FindFirstChild("Head")
  500. local i
  501. local ch = hit.Parent:GetChildren()
  502. for i = 1,#ch do
  503. if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" or ch[i].ClassName == "Script" then
  504. ch[i]:remove()
  505. end
  506. end
  507. local function Scan(ch)
  508. local e
  509. for e = 1,#ch do
  510. Scan(ch[e]:GetChildren())
  511. if ch[e].ClassName == "Weld" or ch[e].ClassName == "Motor6D" then
  512. ch[e]:remove()
  513. end
  514. end
  515. end
  516. Scan(hit.Parent:GetChildren())
  517. if Head then
  518. Torso = hit.Parent.Torso
  519. local Neck = Instance.new("Weld")
  520. Neck.Name = "Neck"
  521. Neck.Part0 = Torso
  522. Neck.Part1 = Head
  523. Neck.C0 = CFrame.new(0, 1.5, 0)
  524. Neck.C1 = CFrame.new()
  525. Neck.Parent = Torso
  526. end
  527. local Limb = hit.Parent:FindFirstChild("Right Arm")
  528. if Limb then
  529.  
  530. Limb.CFrame = Torso.CFrame * CFrame.new(1.5, 0, 0)
  531. local Joint = Instance.new("Glue")
  532. Joint.Name = "RightShoulder"
  533. Joint.Part0 = Torso
  534. Joint.Part1 = Limb
  535. Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  536. Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  537. Joint.Parent = Torso
  538.  
  539. local B = Instance.new("Part")
  540. B.TopSurface = 0
  541. B.BottomSurface = 0
  542. B.formFactor = "Symmetric"
  543. B.Size = Vector3.new(1, 1, 1)
  544. B.Transparency = 1
  545. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  546. B.Parent = hit.Parent
  547. local W = Instance.new("Weld")
  548. W.Part0 = Limb
  549. W.Part1 = B
  550. W.C0 = CFrame.new(0, -0.5, 0)
  551. W.Parent = Limb
  552.  
  553. end
  554. local Limb = hit.Parent:FindFirstChild("Left Arm")
  555. if Limb then
  556.  
  557. Limb.CFrame = Torso.CFrame * CFrame.new(-1.5, 0, 0)
  558. local Joint = Instance.new("Glue")
  559. Joint.Name = "LeftShoulder"
  560. Joint.Part0 = Torso
  561. Joint.Part1 = Limb
  562. Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  563. Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  564. Joint.Parent = Torso
  565.  
  566. local B = Instance.new("Part")
  567. B.TopSurface = 0
  568. B.BottomSurface = 0
  569. B.formFactor = "Symmetric"
  570. B.Size = Vector3.new(1, 1, 1)
  571. B.Transparency = 1
  572. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  573. B.Parent = hit.Parent
  574. local W = Instance.new("Weld")
  575. W.Part0 = Limb
  576. W.Part1 = B
  577. W.C0 = CFrame.new(0, -0.5, 0)
  578. W.Parent = Limb
  579.  
  580. end
  581. local Limb = hit.Parent:FindFirstChild("Right Leg")
  582. if Limb then
  583.  
  584. Limb.CFrame = Torso.CFrame * CFrame.new(0.5, -2, 0)
  585. local Joint = Instance.new("Glue")
  586. Joint.Name = "RightHip"
  587. Joint.Part0 = Torso
  588. Joint.Part1 = Limb
  589. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  590. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  591. Joint.Parent = Torso
  592.  
  593. local B = Instance.new("Part")
  594. B.TopSurface = 0
  595. B.BottomSurface = 0
  596. B.formFactor = "Symmetric"
  597. B.Size = Vector3.new(1, 1, 1)
  598. B.Transparency = 1
  599. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  600. B.Parent = hit.Parent
  601. local W = Instance.new("Weld")
  602. W.Part0 = Limb
  603. W.Part1 = B
  604. W.C0 = CFrame.new(0, -0.5, 0)
  605. W.Parent = Limb
  606.  
  607. end
  608. local Limb = hit.Parent:FindFirstChild("Left Leg")
  609. if Limb then
  610.  
  611. Limb.CFrame = Torso.CFrame * CFrame.new(-0.5, -2, 0)
  612. local Joint = Instance.new("Glue")
  613. Joint.Name = "LeftHip"
  614. Joint.Part0 = Torso
  615. Joint.Part1 = Limb
  616. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  617. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  618. Joint.Parent = Torso
  619.  
  620. local B = Instance.new("Part")
  621. B.TopSurface = 0
  622. B.BottomSurface = 0
  623. B.formFactor = "Symmetric"
  624. B.Size = Vector3.new(1, 1, 1)
  625. B.Transparency = 1
  626. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  627. B.Parent = hit.Parent
  628. local W = Instance.new("Weld")
  629. W.Part0 = Limb
  630. W.Part1 = B
  631. W.C0 = CFrame.new(0, -0.5, 0)
  632. W.Parent = Limb
  633.  
  634. end
  635. --[
  636. local Bar = Instance.new("Part")
  637. Bar.TopSurface = 0
  638. Bar.BottomSurface = 0
  639. Bar.formFactor = "Symmetric"
  640. Bar.Size = Vector3.new(1, 1, 1)
  641. Bar.Transparency = 1
  642. Bar.CFrame = Torso.CFrame * CFrame.new(0, 0.5, 0)
  643. Bar.Parent = hit.Parent
  644. local Weld = Instance.new("Weld")
  645. Weld.Part0 = Torso
  646. Weld.Part1 = Bar
  647. Weld.C0 = CFrame.new(0, 0.5, 0)
  648. Weld.Parent = Torso
  649. --]]
  650. for i,v in pairs(hit.Parent:GetChildren()) do
  651. if v:IsA'Hat' or v:IsA'Shirt' or v:IsA'Pants' or v:IsA'Accessory' or v:IsA'CharacterMesh' then
  652. v:Destroy()
  653. end
  654. if v:IsA'Part' then
  655. if v.Name ~= 'Torso' and v.Name ~= 'Right Leg' and v.Name ~= 'Left Leg' then
  656. v.BrickColor = BrickColor.new("New Yeller")
  657. end
  658. if v.Name ~= 'Torso' and v.Name ~= 'Right Arm' and v.Name ~= 'Left Arm' and v.Name ~= 'Head' then
  659. v.BrickColor = BrickColor.new("Br. yellowish green")
  660. end
  661. if v.Name == 'Torso' then
  662. v.BrickColor = BrickColor.new("Bright blue")
  663. end
  664.  
  665. end
  666. end
  667. end
  668. end
  669. end)
  670. if hit1 == true then
  671. for i=1,10 do
  672. wait()
  673. rarm.Weld.C1 = clerp(rarm.Weld.C1, cf(-0.3,.5,0.5) * ang(rad(-120),rad(0),rad(-90)),0.3)
  674. end
  675. for i=1,6 do
  676. wait()
  677. rarm.Weld.C1 = clerp(rarm.Weld.C1, cf(-0.2,0,0) * ang(rad(20),rad(0),rad(-90)),0.3)
  678. end
  679. hited = true
  680. hit2 = true
  681. hit1 = false
  682. end
  683. if hit2 == true then
  684. if hited == false then
  685. for i=1,10 do
  686. wait()
  687. rarm.Weld.C1 = clerp(rarm.Weld.C1, cf(-0.2,0,0) * ang(rad(20),rad(0),rad(-90)),0.3)
  688. end
  689. for i=1,6 do
  690. wait()
  691. rarm.Weld.C1 = clerp(rarm.Weld.C1, cf(-0.3,0.5,0.5) * ang(rad(-140),rad(0),rad(-90)),0.3)
  692. end
  693. hit1 = true
  694. hit2 = false
  695. end
  696. end
  697. Debounce = false
  698. animstopr = false
  699. hited = false
  700. attackdeb = false
  701. end
  702. end
  703. end
  704. end)
  705. --Knife/Sword Mode--
  706. once = false
  707. mouse.KeyDown:connect(function(key)
  708. if key == "b" then
  709. if smelee == false then
  710. if Debounce == false then
  711. Debounce = true
  712. if melee == false then
  713. o1.Anchored = true
  714. for i = 1,10 do
  715. wait()
  716. o1.Size = o1.Size - Vector3.new(0.1,0.1,0.1)
  717. end
  718. o1.Parent = game.Lighting
  719. Knife.Parent = rarm
  720. newWeld(rarm, Knife, 0, -1, 0)
  721. Knife.Weld.C1 = CFrame.new(0.2,-1,0) * CFrame.Angles(90,rad(0),rad(0))
  722. melee = true
  723. once = true
  724. end
  725.  
  726. if melee == true then
  727. if once == false then
  728. o1.Parent = char
  729. Knife.Rotation = Vector3.new(0,0,0)
  730. Knife.Parent = game.Lighting
  731. o1.CFrame = torso.CFrame * CFrame.new(0,-1,-1.7)
  732. for i = 1,10 do
  733. wait()
  734. o1.Size = o1.Size + Vector3.new(0.1,0.1,0.1)
  735. end
  736. o1.Anchored = false
  737. newWeld(torso, o1, 0, -1, 0)
  738. o1.Weld.C1 = CFrame.new(0,-1,1.7)
  739. melee = false
  740. end
  741. end
  742. Debounce = false
  743. once = false
  744. end
  745. end
  746. end
  747. if key == 'x' then
  748. if melee == false then
  749. if smelee == false then
  750. if Debounce == false then
  751. once = true
  752. animstop = true
  753. Debounce = true
  754. o1.Weld:Destroy()
  755. root.Anchored = true
  756. newWeld(rarm, o1, 0, -1, 0)
  757. o1.Weld.C1 = CFrame.new(0,1,1)
  758. for i=1,6 do
  759. wait()
  760. rarm.Weld.C1 = clerp(rarm.Weld.C1, cf(-0.2,0.3,0.2) * ang(rad(-150),rad(30),-rad(1)),0.3)
  761. end
  762. o1.Anchored = true
  763. o1.Weld:Destroy()
  764. local Spin = coroutine.create(function()
  765. for i =1,100 do
  766. wait()
  767. o1.CFrame = o1.CFrame * CFrame.Angles(math.random(),math.random(),math.random())
  768. end
  769. o1.Parent = game.Lighting
  770. Knife.Parent = rarm
  771. newWeld(rarm, Knife, 0, -1, 0)
  772. Knife.Weld.C1 = CFrame.new(0.2,-1.8,0) * CFrame.Angles(90,rad(0),rad(0))
  773. Knim.Scale = Vector3.new(1,2,1)
  774. smelee = true
  775. wait(0.5)
  776. animstop = false
  777. root.Anchored = false
  778. end)
  779.  
  780. coroutine.resume(Spin)
  781. local pat = Instance.new("ParticleEmitter")
  782. pat.Parent = o1
  783. pat.Size = NumberSequence.new(0.40000000596046,0.40000000596046)
  784. pat.Texture = "rbxassetid://1004332745"
  785. pat.Speed = NumberRange.new(0.89999997615814,0.89999997615814)
  786. local naeeym = Instance.new("BillboardGui",char)
  787. naeeym.Size = UDim2.new(0,100,0,40)
  788. naeeym.StudsOffset = Vector3.new(0,2,0)
  789. naeeym.Adornee = char.Head
  790. local tecks = Instance.new("TextLabel",naeeym)
  791. tecks.BackgroundTransparency = 1
  792. tecks.BorderSizePixel = 0
  793. tecks.Font = "Code"
  794. tecks.FontSize = "Size36"
  795. tecks.TextStrokeTransparency = 0.5
  796. tecks.TextColor3 = Color3.new(244,210,0)
  797. tecks.Size = UDim2.new(1,0,0.5,0)
  798. tecks.Text = "U WILL PAY"
  799. wait(0.9)
  800. tecks.Text = "HAA!!!!"
  801. wait(0.9)
  802. tecks.Text = "U WILL PAY!!!!!!!!"
  803. wait(0.9)
  804. tecks.Text = "DIE!!!!!!!"
  805. tecks.Text = "SUMMON THE DUCK SWORD!!!!!!!!"
  806. wait(0.9)
  807. tecks.Text = "YOU WILL PAY."
  808. wait(1)
  809. naeeym:Destroy()
  810. for i = 1,10 do
  811. wait()
  812. o1.Size = o1.Size - Vector3.new(0.1,0.1,0.1)
  813. end
  814. Debounce = false
  815. pat:Destroy()
  816. end
  817. end
  818. if smelee == true then
  819. if Debounce == false then
  820. if once == false then
  821. Debounce = true
  822. o1.Parent = char
  823. Knife.Rotation = Vector3.new(0,0,0)
  824. Knife.Parent = game.Lighting
  825. Knim.Scale = Vector3.new(1,1,1)
  826. o1.CFrame = torso.CFrame * CFrame.new(0,-1,-1.7)
  827. for i = 1,10 do
  828. wait()
  829. o1.Size = o1.Size + Vector3.new(0.1,0.1,0.1)
  830. end
  831. o1.Anchored = false
  832. newWeld(torso, o1, 0, -1, 0)
  833. o1.Weld.C1 = CFrame.new(0,-1,1.7)
  834. smelee = false
  835. end
  836. end
  837. end
  838. end
  839. once = false
  840. Debounce = false
  841. end
  842. end)
  843. --Animation--
  844. char.Humanoid.WalkSpeed = 8
  845. srs:connect(function()
  846. if (torso.Velocity*Vector3.new(1, 0, 1)).magnitude < 2 then
  847. animpose = "Idle"
  848. elseif (torso.Velocity*Vector3.new(1, 0, 1)).magnitude < 20 then
  849. animpose = "Walking"
  850. end
  851. if animpose == "Walking" then
  852. if animstop == false then
  853. if melee == false then
  854. local animspd = .1
  855. rleg.Weld.C1 = clerp(rleg.Weld.C1, cf(0,1,0) * ang(-rad(1)+-sin(sine/6)/2.2,-sin(sine/6)/13,rad(1)),animspd)
  856. lleg.Weld.C1 = clerp(lleg.Weld.C1, cf(0,1,0) * ang(rad(1)-sin(-sine/6)/2.2,sin(-sine/6)/13,-rad(1)),animspd)
  857. if animstopr == false then
  858. rarm.Weld.C1 = clerp(rarm.Weld.C1, cf(.1,.6,.1) * ang(rad(-70)-sin(-sine/14)/14,rad(-15)+sin(-sine/18)/18,-rad(1)),animspd)
  859. end
  860. larm.Weld.C1 = clerp(larm.Weld.C1, cf(-.1,.6,.1) * ang(rad(-70)-sin(sine/14)/14,rad(15)+sin(sine/18)/18,-rad(1)),animspd)
  861. end
  862. end
  863. end
  864. if animpose == "Idle" then
  865. if animstop == false then
  866. if melee == false then
  867. local animspd = .1
  868. rleg.Weld.C1 = clerp(rleg.Weld.C1, cf(0,1,0) * ang(rad(0),rad(0),rad(0)),animspd)
  869. lleg.Weld.C1 = clerp(lleg.Weld.C1, cf(0,1,0) * ang(rad(0),rad(0),rad(0)),animspd)
  870. if animstopr == false then
  871. rarm.Weld.C1 = clerp(rarm.Weld.C1, cf(.1,.6,.1) * ang(rad(-70)-sin(-sine/12)/13,rad(-15)+sin(-sine/18)/18,-rad(1)),animspd)
  872. end
  873. larm.Weld.C1 = clerp(larm.Weld.C1, cf(-.1,.6,.1) * ang(rad(-70)-sin(sine/12)/13,rad(15)+sin(sine/18)/18,-rad(0)),animspd)
  874. torso.Weld.C1 = clerp(torso.Weld.C1, cf(0,-1+cos(sine/10)/11,0),animspd)
  875. end
  876. end
  877. end
  878.  
  879. if animpose == "Walking" then
  880. if animstop == false then
  881. if melee == true or smelee == true then
  882. local animspd = .1
  883. rleg.Weld.C1 = clerp(rleg.Weld.C1, cf(0,1,0) * ang(-rad(1)+-sin(sine/6)/2.2,-sin(sine/6)/13,rad(1)),animspd)
  884. lleg.Weld.C1 = clerp(lleg.Weld.C1, cf(0,1,0) * ang(rad(1)-sin(-sine/6)/2.2,sin(-sine/6)/13,-rad(1)),animspd)
  885. if animstopr == false then
  886. rarm.Weld.C1 = clerp(rarm.Weld.C1, cf(0,0.5,0) * ang(rad(0)-sin(-sine/5),rad(0)+sin(-sine/18)/18,-rad(1)),animspd)
  887. end
  888. larm.Weld.C1 = clerp(larm.Weld.C1, cf(0,0.5,0) * ang(rad(0)-sin(sine/5),rad(0)+sin(sine/18)/18,-rad(1)),animspd)
  889. end
  890. end
  891. end
  892. if animpose == "Idle" then
  893. if animstop == false then
  894. if melee == true or smelee == true then
  895. local animspd = .1
  896. rleg.Weld.C1 = clerp(rleg.Weld.C1, cf(0,1,0) * ang(rad(0),rad(0),rad(0)),animspd)
  897. lleg.Weld.C1 = clerp(lleg.Weld.C1, cf(0,1,0) * ang(rad(0),rad(0),rad(0)),animspd)
  898. if animstopr == false then
  899. rarm.Weld.C1 = clerp(rarm.Weld.C1, cf(0,.5,0) * ang(rad(0)-sin(-sine/12)/13,rad(0)+sin(-sine/18)/18,-rad(1)),animspd)
  900. end
  901. larm.Weld.C1 = clerp(larm.Weld.C1, cf(0,.5,0) * ang(rad(0)-sin(sine/12)/13,rad(0)+sin(sine/18)/18,-rad(0)),animspd)
  902. torso.Weld.C1 = clerp(torso.Weld.C1, cf(0,-1+cos(sine/10)/11,0),animspd)
  903. end
  904. end
  905. end
  906. end)
Advertisement
Add Comment
Please, Sign In to add comment