DarkScriptZEditors

Bat

Jan 7th, 2019
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.03 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 by Mokiros")
  7. local rp = RealPlayer
  8. script.Parent = rp.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent then
  34. for _,f in pairs(t.Functions) do
  35. f(...)
  36. end
  37. end
  38. end
  39. m.TrigEvent = te
  40. UIS.TrigEvent = te
  41.  
  42. Event.OnServerEvent:Connect(function(plr,io)
  43. if plr~=rp then return end
  44. m.Target = io.Target
  45. m.Hit = io.Hit
  46. if not io.isMouse then
  47. local b = io.UserInputState == Enum.UserInputState.Begin
  48. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  49. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  50. end
  51. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  52. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  53. end
  54. for _,t in pairs(CAS.Actions) do
  55. for _,k in pairs(t.Keys) do
  56. if k==io.KeyCode then
  57. t.Function(t.Name,io.UserInputState,io)
  58. end
  59. end
  60. end
  61. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  62. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  63. end
  64. end)
  65. Event.Parent = NLS([==[
  66. local Player = game:GetService("Players").LocalPlayer
  67. local Event = script:WaitForChild("UserInput_Event")
  68. local Mouse = Player:GetMouse()
  69. local UIS = game:GetService("UserInputService")
  70. local input = function(io,a)
  71. if a then return end
  72. --Since InputObject is a client-side instance, we create and pass table instead
  73. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  74. end
  75. UIS.InputBegan:Connect(input)
  76. UIS.InputEnded:Connect(input)
  77. local h,t
  78. --Give the server mouse data 30 times every second, but only if the values changed
  79. --If player is not moving their mouse, client won't fire events
  80. while wait(1/30) do
  81. if h~=Mouse.Hit or t~=Mouse.Target then
  82. h,t=Mouse.Hit,Mouse.Target
  83. Event:FireServer({isMouse=true,Target=t,Hit=h})
  84. end
  85. end]==],Player.Character)
  86.  
  87. ----Sandboxed game object that allows the usage of client-side methods and services
  88. --Real game object
  89. local _rg = game
  90.  
  91. --Metatable for fake service
  92. local fsmt = {
  93. __index = function(self,k)
  94. local s = rawget(self,"_RealService")
  95. if s then
  96. return typeof(s[k])=="function"
  97. and function(_,...)return s[k](s,...)end or s[k]
  98. end
  99. end,
  100. __newindex = function(self,k,v)
  101. local s = rawget(self,"_RealService")
  102. if s then s[k]=v end
  103. end
  104. }
  105. local function FakeService(t,RealService)
  106. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  107. return setmetatable(t,fsmt)
  108. end
  109.  
  110. --Fake game object
  111. local g = {
  112. GetService = function(self,s)
  113. return rawget(self,s) or _rg:GetService(s)
  114. end,
  115. Players = FakeService({
  116. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  117. },"Players"),
  118. UserInputService = FakeService(UIS,"UserInputService"),
  119. ContextActionService = FakeService(CAS,"ContextActionService"),
  120. RunService = FakeService({
  121. _btrs = {},
  122. RenderStepped = _rg:GetService("RunService").Heartbeat,
  123. BindToRenderStep = function(self,name,_,fun)
  124. self._btrs[name] = self.Heartbeat:Connect(fun)
  125. end,
  126. UnbindFromRenderStep = function(self,name)
  127. self._btrs[name]:Disconnect()
  128. end,
  129. },"RunService")
  130. }
  131. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  132. g.service = g.GetService
  133. FakeService(g,game)
  134. --Changing owner to fake player object to support owner:GetMouse()
  135. game,owner = g,g.Players.LocalPlayer
  136. end
  137. --MADE BY RUFUS14
  138. mouse = game.Players.LocalPlayer:GetMouse()
  139. using = false
  140. hit = false
  141. bat = Instance.new("Part", game.Players.LocalPlayer.Character)
  142. bat.Size = Vector3.new(1, 1, 5)
  143. bat.CanCollide = false
  144. bat:BreakJoints()
  145. baseballhit = Instance.new("Sound", bat)
  146. baseballhit.Volume = 10
  147. baseballhit.SoundId = "rbxassetid://175024455"
  148. baseballhit1 = Instance.new("Sound", game.Players.LocalPlayer.Character.Head)
  149. baseballhit1.Volume = 20
  150. baseballhit1.SoundId = "rbxassetid://130944130"
  151. swinging = Instance.new("Sound", bat)
  152. swinging.Volume = 10
  153. swinging.PlaybackSpeed = 1.2
  154. swinging.SoundId = "rbxassetid://147722227"
  155. weld = Instance.new("Weld", bat)
  156. weld.Part0 = game.Players.LocalPlayer.Character["Right Arm"]
  157. weld.Part1 = bat
  158. local batcritical = Instance.new("Sound", bat)
  159. batcritical.SoundId = "rbxassetid://296102734"
  160. batcritical.Volume = 5
  161. weld.C0 = weld.C0 * CFrame.Angles(0,3.15,0) * CFrame.new(0,-0.95,1.9)
  162. print(weld.C0)
  163. mesh = Instance.new("SpecialMesh", bat)
  164. mesh.MeshId = "http://www.roblox.com/asset/?id=54983181"
  165. mesh.TextureId = "http://www.roblox.com/asset/?id=54983107"
  166. mesh.Scale = Vector3.new(2,2,2)
  167. local rhandweld = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
  168. rhandweld.Part0 = game.Players.LocalPlayer.Character.Torso
  169. rhandweld.Part1 = game.Players.LocalPlayer.Character["Right Arm"]
  170. rhandweld.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  171. rhandweld.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  172. local lhandweld = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
  173. lhandweld.Part0 = game.Players.LocalPlayer.Character.Torso
  174. lhandweld.Part1 = game.Players.LocalPlayer.Character["Left Arm"]
  175. lhandweld.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  176. lhandweld.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  177. function hit()
  178. if not using then
  179. using = true
  180. for i = 0,1 , 0.1 do
  181. wait()
  182. game.Players.LocalPlayer.Character.Torso.Neck.C0 = game.Players.LocalPlayer.Character.Torso.Neck.C0 * CFrame.new():lerp(CFrame.Angles(0,0,-0.35),i)
  183. game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 = game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 * CFrame.new():lerp(CFrame.Angles(0,0,0.35),i)
  184. rhandweld.C0 = rhandweld.C0 * CFrame.new():lerp(CFrame.Angles(0,0,0.3),i)
  185. lhandweld.C0 = lhandweld.C0 * CFrame.new():lerp(CFrame.Angles(-0.15,0,0),i)
  186. end
  187. for i = 1,2 do
  188. wait()
  189. game.Players.LocalPlayer.Character.Torso.Neck.C0 = game.Players.LocalPlayer.Character.Torso.Neck.C0 * CFrame.Angles(0,0,-0.1)
  190. game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 = game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 * CFrame.Angles(0,0,0.1)
  191. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0,0,0.1)
  192. lhandweld.C0 = lhandweld.C0 * CFrame.Angles(-0.05,0,0)
  193. end
  194. wait(0.2)
  195. swinging:Play()
  196. local se = Instance.new("Part", bat)
  197. se.Size = Vector3.new(1, 1, 3)
  198. se:BreakJoints()
  199. se.Transparency = 1
  200. se.CanCollide = false
  201. local dmgweld = Instance.new("Weld", se)
  202. dmgweld.Part0 = bat
  203. dmgweld.Part1 = se
  204. dmgweld.C0 = dmgweld.C0 * CFrame.new(0,0,1)
  205. local function dmg(part)
  206. local hum = part.Parent:findFirstChild("Humanoid")
  207. if hum ~= nil then
  208. se:destroy()
  209. baseballhit:Play()
  210. baseballhit1:Play()
  211. hum.Health = hum.Health - math.random(25,35)
  212. hum.PlatformStand = true
  213. local tor = part.Parent:findFirstChild("Torso")
  214. local dmgmat = math.random(1,4)
  215. if dmgmat == 3 then
  216. batcritical:Play()
  217. hum.Health = hum.Health - math.random(98,135)
  218. end
  219. if tor then
  220. tor.RotVelocity = game.Players.LocalPlayer.Character.Torso.CFrame.rightVector * 34
  221. tor.Velocity = game.Players.LocalPlayer.Character.Torso.CFrame.rightVector * 34
  222. end
  223. wait(2)
  224. hum.PlatformStand = false
  225. hit = false
  226. end
  227. end
  228. se.Touched:connect(dmg)
  229. for i = 0,1 , 0.2 do
  230. wait()
  231. game.Players.LocalPlayer.Character.Torso.Neck.C0 = game.Players.LocalPlayer.Character.Torso.Neck.C0 * CFrame.new():lerp(CFrame.Angles(0,0,0.7),i)
  232. game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 = game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 * CFrame.new():lerp(CFrame.Angles(0,0,-0.70),i)
  233. rhandweld.C0 = rhandweld.C0 * CFrame.new():lerp(CFrame.Angles(0,0,-0.6),i)
  234. lhandweld.C0 = lhandweld.C0 * CFrame.new():lerp(CFrame.Angles(0.30,0,0),i)
  235. end
  236. for i = 1,2 do
  237. wait()
  238. game.Players.LocalPlayer.Character.Torso.Neck.C0 = game.Players.LocalPlayer.Character.Torso.Neck.C0 * CFrame.Angles(0,0,-0.1)
  239. game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 = game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 * CFrame.Angles(0,0,-0.3)
  240. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0,0,-0.4)
  241. end
  242. for i = 1,2 do
  243. wait()
  244. game.Players.LocalPlayer.Character.Torso.Neck.C0 = game.Players.LocalPlayer.Character.Torso.Neck.C0 * CFrame.Angles(0,0,-0.05)
  245. game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 = game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 * CFrame.Angles(0,0,-0.05)
  246. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0,0,-0.2)
  247. end
  248. wait(0.2)
  249. for i = 1,2 do
  250. wait()
  251. game.Players.LocalPlayer.Character.Torso.Neck.C0 = game.Players.LocalPlayer.Character.Torso.Neck.C0 * CFrame.Angles(0,0,0.05)
  252. game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 = game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 * CFrame.Angles(0,0,-0.05)
  253. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0,0,0.2)
  254. end
  255. for i = 1,2 do
  256. wait()
  257. game.Players.LocalPlayer.Character.Torso.Neck.C0 = game.Players.LocalPlayer.Character.Torso.Neck.C0 * CFrame.Angles(0,0,0.06)
  258. game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 = game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 * CFrame.Angles(0,0,0.2)
  259. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0,0,0.2)
  260. end
  261. se:destroy()
  262. for i = 1,2 do
  263. wait()
  264. game.Players.LocalPlayer.Character.Torso.Neck.C0 = game.Players.LocalPlayer.Character.Torso.Neck.C0 * CFrame.Angles(0,0,0.1)
  265. game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 = game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 * CFrame.Angles(0,0,0.1)
  266. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0,0,0.1)
  267. end
  268. for i = 1,2 do
  269. wait()
  270. game.Players.LocalPlayer.Character.Torso.Neck.C0 = game.Players.LocalPlayer.Character.Torso.Neck.C0 * CFrame.Angles(0,0,-0.05)
  271. game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 = game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 * CFrame.Angles(0,0,0.1)
  272. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0,0,0.1)
  273. end
  274. game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 = CFrame.new(0, 0, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  275. game.Players.LocalPlayer.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  276. lhandweld.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  277. lhandweld.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  278. rhandweld.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  279. rhandweld.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  280. using = false
  281. end
  282. end
  283. function combo(key)
  284. key = key:lower()
  285. if key == "q" then
  286. if not using then
  287. using = true
  288. swinging:Play()
  289. for i = 1,2 do
  290. wait()
  291. lhandweld.C0 = lhandweld.C0 * CFrame.Angles(0,0,-0.05)
  292. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0,0,0.05)
  293. end
  294. for i = 1,3 do
  295. wait()
  296. lhandweld.C0 = lhandweld.C0 * CFrame.Angles(0,0,-0.47)
  297. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0,0,0.47)
  298. end
  299. for i = 1,2 do
  300. wait()
  301. lhandweld.C0 = lhandweld.C0 * CFrame.Angles(0,0,-0.05)
  302. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0,0,0.05)
  303. end
  304. wait(0.4)
  305. swinging:Play()
  306. for i = 1,2 do
  307. wait()
  308. weld.C0 = weld.C0 * CFrame.Angles(0.13,0,0.05) * CFrame.new(0,-0.27,0.1)
  309. lhandweld.C0 = lhandweld.C0 * CFrame.Angles(0.05,0,0)
  310. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0.05,0,00)
  311. end
  312. for i = 1,3 do
  313. wait()
  314. weld.C0 = weld.C0 * CFrame.Angles(0.33,0,0.1) * CFrame.new(0,-0.66,0.3)
  315. lhandweld.C0 = lhandweld.C0 * CFrame.Angles(0.2,0,0)
  316. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0.2,0,0)
  317. end
  318. for i = 1,2 do
  319. wait()
  320. weld.C0 = weld.C0 * CFrame.Angles(0.13,0,0.05) * CFrame.new(0,-0.27,0.1)
  321. lhandweld.C0 = lhandweld.C0 * CFrame.Angles(0.05,0,0)
  322. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0.05,0,00)
  323. end
  324. wait(0.5)
  325. for i = 1,2 do
  326. wait()
  327. game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 = game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 * CFrame.Angles(0,0,-0.05)
  328. end
  329. for i = 1,2 do
  330. wait()
  331. game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 = game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 * CFrame.Angles(0,0,-0.1)
  332. end
  333. for i = 1,2 do
  334. wait()
  335. game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 = game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 * CFrame.Angles(0,0,-0.2)
  336. end
  337. for i = 1,2 do
  338. wait()
  339. game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 = game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 * CFrame.Angles(0,0,-0.4)
  340. end
  341. swinging:Play()
  342. for i = 1,2 do
  343. wait()
  344. game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 = game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 * CFrame.Angles(0,0,-0.8)
  345. end
  346. local se = Instance.new("Part", bat)
  347. se.Size = Vector3.new(1, 1, 3)
  348. se:BreakJoints()
  349. se.Transparency = 1
  350. se.CanCollide = false
  351. local dmgweld = Instance.new("Weld", se)
  352. dmgweld.Part0 = bat
  353. dmgweld.Part1 = se
  354. dmgweld.C0 = dmgweld.C0 * CFrame.new(0,0,1)
  355. local function dmg(part)
  356. if not hit then
  357. hit = true
  358. local hum = part.Parent:findFirstChild("Humanoid")
  359. if hum ~= nil then
  360. baseballhit:Play()
  361. baseballhit1:Play()
  362. hum.Health = hum.Health - math.random(5,25)
  363. hum.PlatformStand = true
  364. local tor = part.Parent:findFirstChild("Torso")
  365. if tor then
  366. local vel = Instance.new("BodyVelocity", tor)
  367. vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  368. vel.Velocity = game.Players.LocalPlayer.Character.Torso.CFrame.rightVector * 35
  369. wait(0.1)
  370. vel:destroy()
  371. hit = false
  372. end
  373. wait(0.2)
  374. hit = false
  375. wait(1.5)
  376. hum.PlatformStand = false
  377. end
  378. end
  379. end
  380. se.Touched:connect(dmg)
  381. for i = 1,20 do
  382. swinging:Play()
  383. for i = 1,10 do
  384. wait()
  385. game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 = game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 * CFrame.Angles(0,0,-0.9)
  386. end
  387. end
  388. game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 = CFrame.new(0, 0, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  389. game.Players.LocalPlayer.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  390. for i = 1,2 do
  391. wait()
  392. lhandweld.C0 = lhandweld.C0 * CFrame.Angles(0,0,0.05)
  393. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0,0,-0.05)
  394. end
  395. for i = 1,3 do
  396. wait()
  397. lhandweld.C0 = lhandweld.C0 * CFrame.Angles(0,0,0.47)
  398. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0,0,-0.47)
  399. end
  400. for i = 1,2 do
  401. wait()
  402. lhandweld.C0 = lhandweld.C0 * CFrame.Angles(0,0,0.05)
  403. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(0,0,-0.05)
  404. end
  405. wait(0.4)
  406. swinging:Play()
  407. for i = 1,2 do
  408. wait()
  409. lhandweld.C0 = lhandweld.C0 * CFrame.Angles(-0.05,0,0)
  410. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(-0.05,0,00)
  411. end
  412. for i = 1,3 do
  413. wait()
  414. lhandweld.C0 = lhandweld.C0 * CFrame.Angles(-0.2,0,0)
  415. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(-0.2,0,0)
  416. end
  417. for i = 1,2 do
  418. wait()
  419. lhandweld.C0 = lhandweld.C0 * CFrame.Angles(-0.05,0,0)
  420. rhandweld.C0 = rhandweld.C0 * CFrame.Angles(-0.05,0,00)
  421. end
  422. for i = 1,2 do
  423. wait()
  424. weld.C0 = weld.C0 * CFrame.Angles(-0.13,0,-0.05) * CFrame.new(0,0.27,-0.1)
  425. end
  426. for i = 1,3 do
  427. wait()
  428. weld.C0 = weld.C0 * CFrame.Angles(-0.33,0,-0.1) * CFrame.new(0,0.66,-0.3)
  429. end
  430. for i = 1,2 do
  431. wait()
  432. weld.C0 = weld.C0 * CFrame.Angles(-0.13,0,-0.05) * CFrame.new(0,0.27,-0.1)
  433. end
  434. weld.C0 = CFrame.new(-0.0159739517, -0.949999988, -1.89993286, -0.999964654, 0, -0.00840734318, 0, 1, 0, 0.00840734318, 0, -0.999964654)
  435. game.Players.LocalPlayer.Character.HumanoidRootPart.RootJoint.C0 = CFrame.new(0, 0, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  436. game.Players.LocalPlayer.Character.Torso.Neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  437. lhandweld.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  438. lhandweld.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  439. rhandweld.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  440. rhandweld.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  441. using = false
  442. se:destroy()
  443. end
  444. end
  445. end
  446. mouse.KeyDown:connect(combo)
  447. mouse.Button1Down:connect(hit)
  448. --[[
  449. local vel = Instance.new("BodyVelocity", game.Players.LocalPlayer.Character.Torso)
  450. vel.Velocity = game.Players.LocalPlayer.Character.Torso.CFrame.lookVector * -5
  451. vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  452. --]]
  453. --By Rufus14 (FINALLY I KNOW HOW TO MAKE A RAGDOLL :D)
  454. --die plz
  455. mouse = game.Players.LocalPlayer:GetMouse()
  456. function ragdoll()
  457. game.Players.LocalPlayer.Character.Archivable = true
  458. clone = game.Players.LocalPlayer.Character:Clone()
  459. clone.Parent = workspace
  460. for i,v in pairs(clone:GetChildren()) do
  461. if v.ClassName == "Script" or v.ClassName == "LocalScript" then
  462. v:destroy()
  463. end
  464. for i,p in pairs(v:GetChildren()) do
  465. if p.ClassName == "Weld" or p.ClassName == "Motor6D" or p.ClassName == "BodyVelocity" then
  466. p:destroy()
  467. end
  468. end
  469. end
  470. for i,t in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
  471. if t.ClassName == "Accessory" or t.ClassName == "ForceField" then
  472. t:destroy()
  473. end
  474. end
  475. vel = Instance.new("BodyVelocity", clone.Torso)
  476. vel.Velocity = clone.Torso.CFrame.lookVector * -5
  477. vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  478. clone.Head.face.Texture = "http://www.roblox.com/asset/?id=161061608"
  479. using = false
  480. hit = Instance.new("Sound", clone.Torso)
  481. hit.SoundId = "rbxassetid://260430060"
  482. hit.Volume = 5
  483. hit1 = Instance.new("Sound", clone.Torso)
  484. hit1.SoundId = "rbxassetid://138087186"
  485. hit1.Volume = 5
  486. hit2 = Instance.new("Sound", clone.Torso)
  487. hit2.SoundId = "rbxassetid://131237241"
  488. hit2.Volume = 5
  489. hit3 = Instance.new("Sound", clone.Torso)
  490. hit3.SoundId = "rbxassetid://278062209"
  491. hit3.Volume = 5
  492. hit3.TimePosition = 0.33
  493. ded = Instance.new("Sound", clone.Torso)
  494. ded.SoundId = "rbxassetid://418892870"
  495. ded.Volume = 5
  496. local leftarm = clone:findFirstChild("Left Arm")
  497. local rightrm = clone:findFirstChild("Right Arm")
  498. local leftleg = clone:findFirstChild("Left Leg")
  499. local rightleg = clone:findFirstChild("Right Leg")
  500. local head = clone:findFirstChild("Head")
  501. local welding = Instance.new("Weld", clone.Torso)
  502. welding.Part0 = clone.Torso
  503. welding.Part1 = head
  504. welding.C0 = welding.C0 * CFrame.new(0,1.5,0)
  505. for i, g in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
  506. if g.ClassName == "Part" then
  507. g:destroy()
  508. end
  509. end
  510. for i, h in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
  511. if h.ClassName == "Accesory" then
  512. h:destroy()
  513. end
  514. end
  515. game.Workspace.CurrentCamera.CameraSubject = head
  516. if leftleg ~= nil then
  517. local glue = Instance.new("Glue", clone.Torso)
  518. glue.Part0 = clone.Torso
  519. glue.Part1 = leftleg
  520. glue.Name = "Left leg"
  521. local collider = Instance.new("Part", leftleg)
  522. collider.Position = Vector3.new(0,999,0)
  523. collider.Size = Vector3.new(1.7, 1, 1)
  524. collider.Shape = "Cylinder"
  525. local weld = Instance.new("Weld", collider)
  526. weld.Part0 = leftleg
  527. weld.Part1 = collider
  528. weld.C0 = CFrame.Angles(0, 0, 80)
  529. collider.TopSurface = "Smooth"
  530. collider.BottomSurface = "Smooth"
  531. collider.formFactor = "Symmetric"
  532. glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  533. glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  534. collider.Transparency = 1
  535. end
  536. ------------
  537. if rightleg ~= nil then
  538. local glue1 = Instance.new("Glue", clone.Torso)
  539. glue1.Part0 = clone.Torso
  540. glue1.Part1 = rightleg
  541. glue1.Name = "Right leg"
  542. local collider1 = Instance.new("Part", rightleg)
  543. collider1.Position = Vector3.new(0,999,0)
  544. collider1.Size = Vector3.new(1.7, 1, 1)
  545. collider1.Shape = "Cylinder"
  546. local weld1 = Instance.new("Weld", collider1)
  547. weld1.Part0 = rightleg
  548. weld1.Part1 = collider1
  549. weld1.C0 = CFrame.Angles(0, 0, 80)
  550. collider1.TopSurface = "Smooth"
  551. collider1.BottomSurface = "Smooth"
  552. collider1.formFactor = "Symmetric"
  553. glue1.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  554. glue1.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  555. collider1.Transparency = 1
  556. end
  557. ------------
  558. if rightrm ~= nil then
  559. local glue11 = Instance.new("Glue", clone.Torso)
  560. glue11.Part0 = clone.Torso
  561. glue11.Part1 = rightrm
  562. glue11.Name = "Right shoulder"
  563. local collider11 = Instance.new("Part", rightrm)
  564. collider11.Position = Vector3.new(0,9999,0)
  565. collider11.Size = Vector3.new(1.8,1,1)
  566. collider11.Shape = "Cylinder"
  567. local weld11 = Instance.new("Weld", collider11)
  568. weld11.Part0 = rightrm
  569. weld11.Part1 = collider11
  570. weld11.C0 = CFrame.Angles(0, 0, 80)
  571. collider11.TopSurface = "Smooth"
  572. collider11.BottomSurface = "Smooth"
  573. collider11.formFactor = "Symmetric"
  574. glue11.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  575. glue11.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  576. collider11.Transparency = 1
  577. end
  578. ------------
  579. if leftarm ~= nil then
  580. local glue111 = Instance.new("Glue", clone.Torso)
  581. glue111.Part0 = clone.Torso
  582. glue111.Part1 = leftarm
  583. glue111.Name = "Left shoulder"
  584. local collider111 = Instance.new("Part", leftarm)
  585. collider111.Position = Vector3.new(0,9999,0)
  586. collider111.Size = Vector3.new(1.8,1,1)
  587. collider111.Shape = "Cylinder"
  588. local weld111 = Instance.new("Weld", collider111)
  589. weld111.Part0 = leftarm
  590. weld111.Part1 = collider111
  591. weld111.C0 = CFrame.Angles(0, 0, 80)
  592. collider111.TopSurface = "Smooth"
  593. collider111.BottomSurface = "Smooth"
  594. collider111.formFactor = "Symmetric"
  595. glue111.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  596. glue111.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  597. collider111.Transparency = 1
  598. ----------------
  599. sensoring = Instance.new("Part", clone.Torso)
  600. sensoring.Size = Vector3.new(1.2,1.1,0.8)
  601. sensoring.CanCollide = false
  602. sensoring.Position = clone.Torso.Position
  603. local welder = Instance.new("Weld", sensoring)
  604. welder.Part0 = clone.Torso
  605. welder.Part1 = sensoring
  606. welder.C0 = welder.C0 * CFrame.new(0,0,1.05)
  607. sensoring.Transparency = 1
  608. -----------------
  609. sensoring1 = Instance.new("Part", clone.Torso)
  610. sensoring1.Size = Vector3.new(1.2,1.1,0.8)
  611. sensoring1.CanCollide = false
  612. sensoring1.Position = clone.Torso.Position
  613. local welder1 = Instance.new("Weld", sensoring)
  614. welder1.Part0 = clone.Torso
  615. welder1.Part1 = sensoring1
  616. welder1.C0 = welder1.C0 * CFrame.new(0,0,-1.05)
  617. sensoring1.Transparency = 1
  618. end
  619. clone.Name = game.Players.LocalPlayer.Character.Name.." (DEAD)"
  620. ded:Play()
  621. vel:destroy()
  622. wait(0.5)
  623. local function touch()
  624. if not using then
  625. using = true
  626. local Math = math.random(1,4)
  627. if Math == 1 then
  628. hit:Play()
  629. end
  630. if Math == 2 then
  631. hit1:Play()
  632. end
  633. if Math == 3 then
  634. hit2:Play()
  635. end
  636. if Math == 4 then
  637. hit3:Play()
  638. end
  639. wait(0.1)
  640. using = false
  641. end
  642. end
  643. sensoring.Touched:connect(touch)
  644. sensoring1.Touched:connect(touch)
  645. wait(4.47)
  646. hit1.Volume = 0
  647. hit2.Volume = 0
  648. hit3.Volume = 0
  649. hit.Volume = 0
  650. end
  651.  
  652. game.Players.LocalPlayer.Character.Humanoid.Died:connect(ragdoll)
  653.  
  654. --di ent
Add Comment
Please, Sign In to add comment