Advertisement
Dark_AJ1

glok

Jan 6th, 2019
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.24 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.  
  69. local Mouse = Player:GetMouse()
  70. local UIS = game:GetService("UserInputService")
  71. local input = function(io,a)
  72. if a then return end
  73. --Since InputObject is a client-side instance, we create and pass table instead
  74. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  75. end
  76. UIS.InputBegan:Connect(input)
  77. UIS.InputEnded:Connect(input)
  78.  
  79. local h,t
  80. --Give the server mouse data 30 times every second, but only if the values changed
  81. --If player is not moving their mouse, client won't fire events
  82. while wait(1/30) do
  83. if h~=Mouse.Hit or t~=Mouse.Target then
  84. h,t=Mouse.Hit,Mouse.Target
  85. Event:FireServer({isMouse=true,Target=t,Hit=h})
  86. end
  87. end]==],Player.Character)
  88.  
  89. ----Sandboxed game object that allows the usage of client-side methods and services
  90. --Real game object
  91. local _rg = game
  92.  
  93. --Metatable for fake service
  94. local fsmt = {
  95. __index = function(self,k)
  96. local s = rawget(self,"_RealService")
  97. if s then
  98. return typeof(s[k])=="function"
  99. and function(_,...)return s[k](s,...)end or s[k]
  100. end
  101. end,
  102. __newindex = function(self,k,v)
  103. local s = rawget(self,"_RealService")
  104. if s then s[k]=v end
  105. end
  106. }
  107. local function FakeService(t,RealService)
  108. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  109. return setmetatable(t,fsmt)
  110. end
  111.  
  112. --Fake game object
  113. local g = {
  114. GetService = function(self,s)
  115. return rawget(self,s) or _rg:GetService(s)
  116. end,
  117. Players = FakeService({
  118. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  119. },"Players"),
  120. UserInputService = FakeService(UIS,"UserInputService"),
  121. ContextActionService = FakeService(CAS,"ContextActionService"),
  122. RunService = FakeService({
  123. _btrs = {},
  124. RenderStepped = _rg:GetService("RunService").Heartbeat,
  125. BindToRenderStep = function(self,name,_,fun)
  126. self._btrs[name] = self.Heartbeat:Connect(fun)
  127. end,
  128. UnbindFromRenderStep = function(self,name)
  129. self._btrs[name]:Disconnect()
  130. end,
  131. },"RunService")
  132. }
  133. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  134. g.service = g.GetService
  135. FakeService(g,game)
  136. --Changing owner to fake player object to support owner:GetMouse()
  137. game,owner = g,g.Players.LocalPlayer
  138. end
  139. wait(1)
  140. ---------------------------[[[ VARIABLES ]]]---------------------------
  141.  
  142. local plr = game.Players.LocalPlayer
  143. local chr = plr.Character
  144. local mou = plr:GetMouse()
  145. local leftarm = false
  146. local active = false
  147. local curkey = "f"
  148. local stunneds = {}
  149.  
  150. ---------------------------[[[ PARTS ]]]---------------------------
  151.  
  152. -- 1 - Glock
  153. obj1 = Instance.new("Model")
  154. obj1.Name = "Glock"
  155. obj1.Parent = chr
  156.  
  157. -- 2 - Part
  158. obj2 = Instance.new("Part")
  159. obj2.CFrame = CFrame.new(Vector3.new(14.25, 3.51428652, 46.8584824)) * CFrame.Angles(0.69812995195389, 0, -0)
  160. obj2.TopSurface = Enum.SurfaceType.Smooth
  161. obj2.BottomSurface = Enum.SurfaceType.Smooth
  162. obj2.Material = Enum.Material.Metal
  163. obj2.Size = Vector3.new(0.300000012, 0.200000003, 0.200000003)
  164. obj2.Anchored = true
  165. obj2.BrickColor = BrickColor.new("Black")
  166. obj2.Friction = 0.30000001192093
  167. obj2.Shape = Enum.PartType.Block
  168. obj2.CanCollide = false
  169. obj2.Parent = obj1
  170.  
  171. -- 3 - Top
  172. obj3 = Instance.new("Part")
  173. obj3.CFrame = CFrame.new(Vector3.new(14.25, 3.8499999, 47.1499977)) * CFrame.Angles(-0, 0, -0)
  174. obj3.TopSurface = Enum.SurfaceType.Smooth
  175. obj3.BottomSurface = Enum.SurfaceType.Smooth
  176. obj3.Material = Enum.Material.Metal
  177. obj3.Size = Vector3.new(0.300000012, 0.300000012, 1.5)
  178. obj3.Anchored = true
  179. obj3.BrickColor = BrickColor.new("Ghost grey")
  180. obj3.Friction = 0.30000001192093
  181. obj3.Shape = Enum.PartType.Block
  182. obj3.CanCollide = false
  183. obj3.Name = "Top"
  184. obj3.Parent = obj1
  185.  
  186. -- 4 - Top
  187. obj4 = Instance.new("Part")
  188. obj4.CFrame = CFrame.new(Vector3.new(14.25, 3.8499999, 47.8999977)) * CFrame.Angles(0, 1.5707963705063, 0)
  189. obj4.TopSurface = Enum.SurfaceType.Smooth
  190. obj4.BottomSurface = Enum.SurfaceType.Smooth
  191. obj4.Material = Enum.Material.Metal
  192. obj4.Size = Vector3.new(0.200000003, 0.299999982, 0.300000012)
  193. obj4.Anchored = true
  194. obj4.BrickColor = BrickColor.new("Ghost grey")
  195. obj4.Friction = 0.30000001192093
  196. obj4.Shape = Enum.PartType.Cylinder
  197. obj4.Name = "Top"
  198. obj4.CanCollide = false
  199. obj4.Parent = obj1
  200.  
  201. -- 5 - Part
  202. obj5 = Instance.new("Part")
  203. obj5.CFrame = CFrame.new(Vector3.new(14.25, 3.35359001, 47.1499939)) * CFrame.Angles(-1.5707978010178, 0, -0)
  204. obj5.TopSurface = Enum.SurfaceType.Smooth
  205. obj5.BottomSurface = Enum.SurfaceType.Smooth
  206. obj5.Material = Enum.Material.Metal
  207. obj5.Size = Vector3.new(0.300000012, 0.200000003, 0.299999982)
  208. obj5.Anchored = true
  209. obj5.BrickColor = BrickColor.new("Black")
  210. obj5.Friction = 0.30000001192093
  211. obj5.Shape = Enum.PartType.Block
  212. obj5.CanCollide = false
  213. obj5.Parent = obj1
  214.  
  215. -- 6 - Part
  216. obj6 = Instance.new("Part")
  217. obj6.CFrame = CFrame.new(Vector3.new(14.25, 3.5999999, 47.1499977)) * CFrame.Angles(-0, 0, -0)
  218. obj6.TopSurface = Enum.SurfaceType.Smooth
  219. obj6.BottomSurface = Enum.SurfaceType.Smooth
  220. obj6.Material = Enum.Material.Metal
  221. obj6.Size = Vector3.new(0.300000012, 0.200000003, 1.5)
  222. obj6.Anchored = true
  223. obj6.BrickColor = BrickColor.new("Black")
  224. obj6.CanCollide = false
  225. obj6.Friction = 0.30000001192093
  226. obj6.Shape = Enum.PartType.Block
  227. obj6.Parent = obj1
  228.  
  229. -- 7 - Part
  230. obj7 = Instance.new("Part")
  231. obj7.CFrame = CFrame.new(Vector3.new(14.25, 3.60000014, 47.8999977)) * CFrame.Angles(0, 1.5707963705063, 0)
  232. obj7.TopSurface = Enum.SurfaceType.Smooth
  233. obj7.BottomSurface = Enum.SurfaceType.Smooth
  234. obj7.Material = Enum.Material.Metal
  235. obj7.Size = Vector3.new(0.200000003, 0.200000003, 0.300000012)
  236. obj7.Anchored = true
  237. obj7.BrickColor = BrickColor.new("Black")
  238. obj7.CanCollide = false
  239. obj7.Friction = 0.30000001192093
  240. obj7.Shape = Enum.PartType.Cylinder
  241. obj7.Parent = obj1
  242.  
  243. -- 8 - Part
  244. obj8 = Instance.new("Part")
  245. obj8.CFrame = CFrame.new(Vector3.new(14.25, 3.15358996, 46.8499985)) * CFrame.Angles(1.1920913323138e-007, 0, -0)
  246. obj8.TopSurface = Enum.SurfaceType.Smooth
  247. obj8.BottomSurface = Enum.SurfaceType.Smooth
  248. obj8.Material = Enum.Material.Metal
  249. obj8.Size = Vector3.new(0.300000012, 0.200000003, 0.699999988)
  250. obj8.Anchored = true
  251. obj8.BrickColor = BrickColor.new("Black")
  252. obj8.Friction = 0.30000001192093
  253. obj8.CanCollide = false
  254. obj8.Shape = Enum.PartType.Block
  255. obj8.Parent = obj1
  256.  
  257. -- 9 - Part
  258. obj9 = Instance.new("Part")
  259. obj9.CFrame = CFrame.new(Vector3.new(14.25, 3.27858996, 46.5067024)) * CFrame.Angles(-1.0471963882446, 0, -0)
  260. obj9.TopSurface = Enum.SurfaceType.Smooth
  261. obj9.BottomSurface = Enum.SurfaceType.Smooth
  262. obj9.Material = Enum.Material.Metal
  263. obj9.Size = Vector3.new(0.300000012, 0.300000012, 0.699999988)
  264. obj9.Anchored = true
  265. obj9.BrickColor = BrickColor.new("Black")
  266. obj9.CanCollide = false
  267. obj9.Friction = 0.30000001192093
  268. obj9.Shape = Enum.PartType.Block
  269. obj9.Parent = obj1
  270.  
  271. local previous = nil
  272. for i,v in pairs(obj1:GetChildren()) do
  273. if v:IsA('BasePart') then
  274. if previous then
  275. local weld = Instance.new('Weld',v)
  276. weld.Part0 = v
  277. weld.Part1 = previous
  278. weld.C0 = v.CFrame:inverse() * previous.CFrame
  279. previous.Anchored = false
  280. end
  281. previous = v
  282. end
  283. end
  284. previous.Anchored = false
  285.  
  286. ---------------------------[[[ FUNCTIONS ]]]---------------------------
  287.  
  288. function notify(msg,forever)
  289. local doit = coroutine.wrap(function()
  290. for i,v in pairs(plr.PlayerGui:GetChildren()) do
  291. if v.Name == "Notification" and v:IsA('ScreenGui') then
  292. v:Destroy()
  293. end
  294. end
  295. local gui = Instance.new('ScreenGui',plr.PlayerGui)
  296. gui.Name = "Notification"
  297. local frame = Instance.new('Frame',gui)
  298. frame.Position = UDim2.new(0,0,0,0)
  299. frame.Size = UDim2.new(1,0,0.2,0)
  300. frame.BackgroundTransparency = 1
  301. local txt = Instance.new('TextLabel',frame)
  302. txt.TextColor3 = Color3.new(255,255,255)
  303. txt.TextStrokeColor3 = Color3.new(0, 0, 0)
  304. txt.TextStrokeTransparency = 0
  305. txt.BackgroundTransparency = 1
  306. txt.Text = ""
  307. txt.Size = UDim2.new(1,0,0.3,0)
  308. txt.Position = UDim2.new(0,0,0.4,0)
  309. txt.TextScaled = true
  310. txt.Font = "Code"
  311. txt.TextXAlignment = "Center"
  312. local tap = Instance.new("Sound")
  313. tap.Parent = plr.Backpack
  314. tap.SoundId = "rbxassetid://147982968"
  315. tap.TimePosition = 0.1
  316. local str = msg
  317. local len = string.len(str)
  318. for i=1,len do
  319. txt.Text = string.sub(str,1,i)
  320. local pitche = math.random(2, 4)
  321. tap.PlaybackSpeed = pitche
  322. tap:Play()
  323. wait(0.05)
  324. end
  325. if forever == false then
  326. wait(1)
  327. while txt.TextTransparency < 1 do
  328. txt.TextTransparency = txt.TextTransparency + 0.1
  329. txt.TextStrokeTransparency = txt.TextStrokeTransparency + 0.1
  330. wait()
  331. end
  332. gui:Destroy()
  333. end
  334. end)
  335. doit()
  336. end
  337.  
  338.  
  339. function damage(playa,hita)
  340. local hitz = hita.Name
  341. local heyy = hitz
  342. if hitz == "Right Arm" then
  343. local Limb = playa:FindFirstChild("Right Arm")
  344. local ters = playa:FindFirstChild('Torso')
  345. if Limb and ters then
  346. if ters:FindFirstChild('Right Shoulder') then ters["Right Shoulder"]:Destroy() end
  347. for i,v in pairs(Limb:GetChildren()) do
  348. if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
  349. v:Destroy()
  350. end
  351. end
  352. Limb.CFrame = ters.CFrame * CFrame.new(1.5, 0, 0)
  353. local Joint = Instance.new("Glue")
  354. Joint.Name = "RightShoulder"
  355. Joint.Part0 = ters
  356. Joint.Part1 = Limb
  357. Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  358. Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  359. Joint.Parent = ters
  360.  
  361. local B = Instance.new("Part")
  362. B.TopSurface = 0
  363. B.BottomSurface = 0
  364. B.formFactor = "Symmetric"
  365. B.Size = Vector3.new(1, 1, 1)
  366. B.Transparency = 1
  367. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  368. B.Parent = playa
  369. local W = Instance.new("Weld")
  370. W.Part0 = Limb
  371. W.Part1 = B
  372. W.C0 = CFrame.new(0, -0.5, 0)
  373. W.Parent = Limb
  374. end
  375. elseif hitz == "Left Arm" then
  376. local Limb = playa:FindFirstChild("Left Arm")
  377. local ters = playa:FindFirstChild('Torso')
  378. if Limb and ters then
  379. if ters:FindFirstChild('Left Shoulder') then ters["Left Shoulder"]:Destroy() end
  380. for i,v in pairs(Limb:GetChildren()) do
  381. if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
  382. v:Destroy()
  383. end
  384. end
  385. Limb.CFrame = ters.CFrame * CFrame.new(-1.5, 0, 0)
  386. local Joint = Instance.new("Glue")
  387. Joint.Name = "LeftShoulder"
  388. Joint.Part0 = ters
  389. Joint.Part1 = Limb
  390. Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  391. Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  392. Joint.Parent = ters
  393. local B = Instance.new("Part")
  394. B.TopSurface = 0
  395. B.BottomSurface = 0
  396. B.formFactor = "Symmetric"
  397. B.Size = Vector3.new(1, 1, 1)
  398. B.Transparency = 1
  399. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  400. B.Parent = playa
  401. local W = Instance.new("Weld")
  402. W.Part0 = ters
  403. W.Part1 = B
  404. W.C0 = CFrame.new(0, -0.5, 0)
  405. W.Parent = Limb
  406. end
  407. elseif hitz == "Right Leg" then
  408. local Limb = playa:FindFirstChild("Right Leg")
  409. local ters = playa:FindFirstChild('Torso')
  410. if Limb and ters then
  411. if ters:FindFirstChild('Right Hip') then ters["Right Hip"]:Destroy() end
  412. for i,v in pairs(Limb:GetChildren()) do
  413. if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
  414. v:Destroy()
  415. end
  416. end
  417. Limb.CFrame = ters.CFrame * CFrame.new(0.5, -2, 0)
  418. local Joint = Instance.new("Glue")
  419. Joint.Name = "Right Hip"
  420. Joint.Part0 = ters
  421. Joint.Part1 = Limb
  422. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  423. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  424. Joint.Parent = ters
  425. local B = Instance.new("Part")
  426. B.TopSurface = 0
  427. B.BottomSurface = 0
  428. B.formFactor = "Symmetric"
  429. B.Size = Vector3.new(1, 1, 1)
  430. B.Transparency = 1
  431. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  432. B.Parent = playa
  433. local W = Instance.new("Weld")
  434. W.Part0 = Limb
  435. W.Part1 = B
  436. W.C0 = CFrame.new(0, -0.5, 0)
  437. W.Parent = Limb
  438. if playa:FindFirstChildOfClass('Humanoid') then
  439. local hum = playa:FindFirstChildOfClass('Humanoid')
  440. local target = playa
  441. if target:FindFirstChild('HumanoidRootPart') then
  442. target.HumanoidRootPart:Destroy()
  443. end
  444. local found = false
  445. for i,v in pairs(stunneds) do
  446. if v == hum then
  447. found = true
  448. end
  449. end
  450. if found == false then
  451. table.insert(stunneds,hum)
  452. end
  453. end
  454. end
  455. elseif hitz == "Left Leg" then
  456. local Limb = playa:FindFirstChild("Left Leg")
  457. local ters = playa:FindFirstChild('Torso')
  458. if Limb and ters then
  459. if ters:FindFirstChild('Left Hip') then ters["Left Hip"]:Destroy() end
  460. for i,v in pairs(Limb:GetChildren()) do
  461. if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
  462. v:Destroy()
  463. end
  464. end
  465. Limb.CFrame = ters.CFrame * CFrame.new(0.5, -2, 0)
  466. Limb.CFrame = ters.CFrame * CFrame.new(-0.5, -2, 0)
  467. local Joint = Instance.new("Glue")
  468. Joint.Name = "LeftHip"
  469. Joint.Part0 = ters
  470. Joint.Part1 = Limb
  471. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  472. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  473. Joint.Parent = ters
  474.  
  475. local B = Instance.new("Part")
  476. B.TopSurface = 0
  477. B.BottomSurface = 0
  478. B.formFactor = "Symmetric"
  479. B.Size = Vector3.new(1, 1, 1)
  480. B.Transparency = 1
  481. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  482. B.Parent = playa
  483. local W = Instance.new("Weld")
  484. W.Part0 = Limb
  485. W.Part1 = B
  486. W.C0 = CFrame.new(0, -0.5, 0)
  487. W.Parent = Limb
  488. Limb.CanCollide = false
  489. if playa:FindFirstChildOfClass('Humanoid') then
  490. local hum = playa:FindFirstChildOfClass('Humanoid')
  491. local target = playa
  492. if target:FindFirstChild('HumanoidRootPart') then
  493. target.HumanoidRootPart:Destroy()
  494. end
  495. local found = false
  496. for i,v in pairs(stunneds) do
  497. if v == hum then
  498. found = true
  499. end
  500. end
  501. if found == false then
  502. table.insert(stunneds,hum)
  503. end
  504. end
  505. end
  506. else
  507. local playa2 = playa
  508. playa.Archivable = true
  509. local playa = playa:Clone()
  510. playa.Archivable = false
  511. playa2:Destroy()
  512. playa.Parent = workspace
  513. local Gibs = game.Workspace
  514. print(playa)
  515. local Torso = playa.Torso
  516. local Head = playa:FindFirstChild("Head")
  517. local function Scan(ch)
  518. local e
  519. for e = 1,#ch do
  520. Scan(ch[e]:GetChildren())
  521. if ch[e].ClassName == "Weld" or ch[e].ClassName == "Motor6D" then
  522. ch[e]:remove()
  523. end
  524. end
  525. end
  526. Scan(playa:GetChildren())
  527. if playa:FindFirstChild('HumanoidRootPart') then
  528. playa:FindFirstChild('HumanoidRootPart'):Destroy()
  529. end
  530. local hum2 = playa:FindFirstChildOfClass("Humanoid")
  531.  
  532.  
  533. if hum2 ~= nil then
  534. hum2.Name = "Humanoid2"
  535. hum2.PlatformStand = true
  536. hum2.Health = 0
  537. end
  538. local ch = playa:GetChildren()
  539. local i
  540. for i = 1,#ch do
  541. if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then
  542. ch[i]:remove()
  543. end
  544. end
  545.  
  546. if Head then
  547. local Neck = Instance.new("Weld")
  548. Neck.Name = "Neck"
  549. Neck.Part0 = Torso
  550. Neck.Part1 = Head
  551. Neck.C0 = CFrame.new(0, 1.5, 0)
  552. Neck.C1 = CFrame.new()
  553. Neck.Parent = Torso
  554. end
  555. local Limb = playa:FindFirstChild("Right Arm")
  556. if Limb then
  557.  
  558. Limb.CFrame = Torso.CFrame * CFrame.new(1.5, 0, 0)
  559. local Joint = Instance.new("Glue")
  560. Joint.Name = "RightShoulder"
  561. Joint.Part0 = Torso
  562. Joint.Part1 = Limb
  563. Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  564. Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  565. Joint.Parent = Torso
  566.  
  567. local B = Instance.new("Part")
  568. B.TopSurface = 0
  569. B.BottomSurface = 0
  570. B.formFactor = "Symmetric"
  571. B.Size = Vector3.new(1, 1, 1)
  572. B.Transparency = 1
  573. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  574. B.Parent = playa
  575. local W = Instance.new("Weld")
  576. W.Part0 = Limb
  577. W.Part1 = B
  578. W.C0 = CFrame.new(0, -0.5, 0)
  579. W.Parent = Limb
  580. end
  581. local Limb = playa:FindFirstChild("Left Arm")
  582. if Limb then
  583.  
  584. Limb.CFrame = Torso.CFrame * CFrame.new(-1.5, 0, 0)
  585. local Joint = Instance.new("Glue")
  586. Joint.Name = "LeftShoulder"
  587. Joint.Part0 = Torso
  588. Joint.Part1 = Limb
  589. Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  590. Joint.C1 = CFrame.new(0, 0.5, 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 = playa
  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. end
  607. local Limb = playa:FindFirstChild("Right Leg")
  608. if Limb then
  609.  
  610. Limb.CFrame = Torso.CFrame * CFrame.new(0.5, -2, 0)
  611. local Joint = Instance.new("Glue")
  612. Joint.Name = "RightHip"
  613. Joint.Part0 = Torso
  614. Joint.Part1 = Limb
  615. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  616. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  617. Joint.Parent = Torso
  618.  
  619. local B = Instance.new("Part")
  620. B.TopSurface = 0
  621. B.BottomSurface = 0
  622. B.formFactor = "Symmetric"
  623. B.Size = Vector3.new(1, 1, 1)
  624. B.Transparency = 1
  625. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  626. B.Parent = playa
  627. local W = Instance.new("Weld")
  628. W.Part0 = Limb
  629. W.Part1 = B
  630. W.C0 = CFrame.new(0, -0.5, 0)
  631. W.Parent = Limb
  632. end
  633. local Limb = playa:FindFirstChild("Left Leg")
  634. if Limb then
  635.  
  636. Limb.CFrame = Torso.CFrame * CFrame.new(-0.5, -2, 0)
  637. local Joint = Instance.new("Glue")
  638. Joint.Name = "LeftHip"
  639. Joint.Part0 = Torso
  640. Joint.Part1 = Limb
  641. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  642. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  643. Joint.Parent = Torso
  644.  
  645. local B = Instance.new("Part")
  646. B.TopSurface = 0
  647. B.BottomSurface = 0
  648. B.formFactor = "Symmetric"
  649. B.Size = Vector3.new(1, 1, 1)
  650. B.Transparency = 1
  651. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  652. B.Parent = playa
  653. local W = Instance.new("Weld")
  654. W.Part0 = Limb
  655. W.Part1 = B
  656. W.C0 = CFrame.new(0, -0.5, 0)
  657. W.Parent = Limb
  658. end
  659. --[
  660. local Bar = Instance.new("Part")
  661. Bar.TopSurface = 0
  662. Bar.BottomSurface = 0
  663. Bar.formFactor = "Symmetric"
  664. Bar.Size = Vector3.new(1, 1, 1)
  665. Bar.Transparency = 1
  666. Bar.CFrame = Torso.CFrame * CFrame.new(0, 0.5, 0)
  667. Bar.Parent = playa
  668. local Weld = Instance.new("Weld")
  669. Weld.Part0 = Torso
  670. Weld.Part1 = Bar
  671. Weld.C0 = CFrame.new(0, 0.5, 0)
  672. Weld.Parent = Torso
  673. --]]
  674. playa.Parent = Gibs
  675. game.Debris:AddItem(playa, 12)
  676. end
  677. end
  678.  
  679.  
  680. function calculate()
  681. if leftarm and chr:FindFirstChild('Head') and chr:FindFirstChild('Torso') and chr.Torso:FindFirstChild("Left Shoulder") and chr:FindFirstChild('Left Arm') then
  682. local Head = plr.Character.Head
  683. local RightShoulder = plr.Character.Torso["Left Shoulder"]
  684. local RightArm = plr.Character["Left Arm"]
  685. local MousePosition = mou.Hit.p
  686. local ToMouse = (MousePosition - Head.Position).unit
  687. local Angle = math.acos(ToMouse:Dot(Vector3.new(0, 1, 0)))
  688. local FromRightArmPos = (Head.Position + Head.CFrame:vectorToWorldSpace(Vector3.new(((-Head.Size.X / 2) + (-RightArm.Size.X / 2)), ((-Head.Size.Y / 2) - (-RightArm.Size.Z / 2)), 0)))
  689. local ToMouseRightArm = ((MousePosition - FromRightArmPos) * Vector3.new(-1 ,0, -1)).unit
  690. local Look = (Head.CFrame.lookVector * Vector3.new(-1, 0, -1)).unit
  691. local LateralAngle = math.acos(ToMouseRightArm:Dot(Look))
  692. if tostring(LateralAngle) == "-1.#IND" then
  693. LateralAngle = 0
  694. end
  695. local Cross = Head.CFrame.lookVector:Cross(ToMouseRightArm)
  696. --[[
  697. if LateralAngle > (math.pi / 2) then
  698. LateralAngle = (math.pi / 2)
  699. if chr:FindFirstChild('Torso') then
  700. local Torso = chr.Torso
  701. local Point = Torso.CFrame:vectorToObjectSpace(mou.Hit.p-Torso.CFrame.p)
  702. if Point.Z > 0 then
  703. if Point.X > 0 then
  704. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(90),0)
  705. elseif Point.X < 0 then
  706. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(-90),0)
  707. end
  708. end
  709. end
  710. end
  711. ]]--
  712. print(LateralAngle)
  713. warn(math.pi / 2)
  714. if Cross.Y < 0 then
  715. LateralAngle = -LateralAngle
  716. end
  717. return(CFrame.new(RightShoulder.C0.p) * CFrame.Angles(((math.pi / 2) - Angle), ((math.pi / 2) + LateralAngle), math.pi/2))
  718. elseif chr:FindFirstChild('Head') and chr:FindFirstChild('Torso') and chr.Torso:FindFirstChild("Right Shoulder") and chr:FindFirstChild('Right Arm') then
  719. local Head = plr.Character.Head
  720. local RightShoulder = plr.Character.Torso["Right Shoulder"]
  721. local RightArm = plr.Character["Right Arm"]
  722. local MousePosition = mou.Hit.p
  723. local ToMouse = (MousePosition - Head.Position).unit
  724. local Angle = math.acos(ToMouse:Dot(Vector3.new(0, 1, 0)))
  725. local FromRightArmPos = (Head.Position + Head.CFrame:vectorToWorldSpace(Vector3.new(((Head.Size.X / 2) + (RightArm.Size.X / 2)), ((Head.Size.Y / 2) - (RightArm.Size.Z / 2)), 0)))
  726. local ToMouseRightArm = ((MousePosition - FromRightArmPos) * Vector3.new(1 ,0, 1)).unit
  727. local Look = (Head.CFrame.lookVector * Vector3.new(1, 0, 1)).unit
  728. local LateralAngle = math.acos(ToMouseRightArm:Dot(Look))
  729. if tostring(LateralAngle) == "-1.#IND" then
  730. LateralAngle = 0
  731. end
  732. local Cross = Head.CFrame.lookVector:Cross(ToMouseRightArm)
  733. if LateralAngle > (math.pi / 2) then
  734. LateralAngle = (math.pi / 2)
  735. if chr:FindFirstChild('Torso') then
  736. local Torso = chr.Torso
  737. local Point = Torso.CFrame:vectorToObjectSpace(mou.Hit.p-Torso.CFrame.p)
  738. if Point.Z > 0 then
  739. if Point.X > 0 then
  740. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(90),0)
  741. elseif Point.X < 0 then
  742. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(-90),0)
  743. end
  744. end
  745. end
  746. end
  747. if Cross.Y < 0 then
  748. LateralAngle = -LateralAngle
  749. end
  750. return(CFrame.new(RightShoulder.C0.p) * CFrame.Angles(((math.pi / 2) - Angle), ((math.pi / 2) + LateralAngle), math.pi/2))
  751. end
  752. end
  753.  
  754. function fire()
  755. if mou.Target then
  756. local humanoid = mou.Target.Parent:FindFirstChildOfClass("Humanoid")
  757. if not humanoid then
  758. humanoid = mou.Target.Parent.Parent:FindFirstChildOfClass("Humanoid")
  759. end
  760. if humanoid then
  761. local coru = coroutine.wrap(function()
  762. damage(humanoid.Parent,mou.Target)
  763. end)
  764. coru()
  765. end
  766. end
  767. local beam = Instance.new("Part", workspace)
  768. beam.BrickColor = BrickColor.new("Bright yellow")
  769. beam.FormFactor = "Custom"
  770. beam.Material = "Neon"
  771. beam.Transparency = 0.25
  772. beam.Anchored = true
  773. beam.Locked = true
  774. beam.CanCollide = false
  775. local distance = (obj4.CFrame.p - mou.Hit.p).magnitude
  776. beam.Size = Vector3.new(0.2, 0.2, distance)
  777. beam.CFrame = CFrame.new(obj4.CFrame.p, mou.Hit.p) * CFrame.new(0, 0, -distance / 2)
  778. game:GetService("Debris"):AddItem(beam, 0.05)
  779. local sound = Instance.new('Sound',obj4)
  780. sound.SoundId = 'rbxassetid://139593133'
  781. sound.Volume = 3
  782. sound.EmitterSize = 40
  783. sound.MaxDistance = 450
  784. sound:Play()
  785. game:GetService("Debris"):AddItem(beam, sound.TimeLength)
  786. end
  787.  
  788. ---------------------------[[[ SCRIPT ]]]---------------------------
  789. if chr:FindFirstChild('Left Arm') == nil or chr:FindFirstChild('Torso') == nil or chr.Torso:FindFirstChild('Left Shoulder') == nil then
  790. leftarm = false
  791. end
  792. local weldas = Instance.new('Weld',obj2)
  793. if leftarm and chr:FindFirstChild('Left Arm') then
  794. weldas.Part0 = obj2
  795. weldas.Part1 = chr["Left Arm"]
  796. weldas.C0 = CFrame.new(0,-0.85,-0.30)*CFrame.Angles(math.rad(50),math.rad(0),math.rad(180))
  797. elseif chr:FindFirstChild('Right Arm') then
  798. weldas.Part0 = obj2
  799. weldas.Part1 = chr["Right Arm"]
  800. weldas.C0 = CFrame.new(0,-0.85,-0.30)*CFrame.Angles(math.rad(50),math.rad(0),math.rad(180))
  801. end
  802.  
  803.  
  804. if leftarm and chr:FindFirstChild('Left Arm') and chr:FindFirstChild('Torso') and chr.Torso:FindFirstChild('Left Shoulder') then
  805. chr:FindFirstChild('Left Arm').AncestryChanged:connect(function(me,par)
  806. if par ~= chr and chr:FindFirstChild('Right Arm') then
  807. if obj2 and obj2:FindFirstChildOfClass('Weld') then
  808. obj2:FindFirstChildOfClass('Weld').Part1 = chr["Right Arm"]
  809. end
  810. leftarm = false
  811. end
  812. end)
  813. chr.Torso:FindFirstChild('Left Shoulder').AncestryChanged:connect(function(me,par)
  814. if par ~= chr:FindFirstChild('Torso') and chr:FindFirstChild('Right Arm') then
  815. if obj2 and obj2:FindFirstChildOfClass('Weld') then
  816. obj2:FindFirstChildOfClass('Weld').Part1 = chr["Right Arm"]
  817. end
  818. end
  819. leftarm = false
  820. end)
  821. elseif leftarm then
  822. if obj2 and obj2:FindFirstChildOfClass('Weld') and chr:FindFirstChild('Right Arm') then
  823. obj2:FindFirstChildOfClass('Weld').Part1 = chr["Right Arm"]
  824. end
  825. end
  826.  
  827. mou.KeyDown:connect(function(key)
  828. if key == string.lower(curkey) then
  829. active = not active
  830. end
  831. end)
  832.  
  833. plr.Chatted:connect(function(msg)
  834. if string.lower(string.sub(msg,1,5)) == "!bind" then
  835. curkey = string.lower(string.sub(msg,7,7))
  836. notify([[Changed key for equip/unequip to "]]..curkey..[[".]],false)
  837. end
  838. end)
  839.  
  840. game:GetService('RunService').Stepped:connect(function()
  841. if active and chr:FindFirstChild('Torso') then
  842. if leftarm then
  843. chr.Torso["Left Shoulder"].C0 = calculate()
  844. else
  845. chr.Torso["Right Shoulder"].C0 = calculate()
  846. end
  847. weldas.Part1 = chr["Right Arm"]
  848. weldas.C0 = CFrame.new(0,-0.85,-0.30)*CFrame.Angles(math.rad(50),math.rad(0),math.rad(180))
  849. elseif chr:FindFirstChild('Torso') and (chr.Torso:FindFirstChild('Left Shoulder') or chr.Torso:FindFirstChild('Right Shoulder')) then
  850. if leftarm then
  851. chr.Torso["Left Shoulder"].C0 = CFrame.new(-1,0.5,0)*CFrame.Angles(0,-math.pi/2,0)
  852. else
  853. chr.Torso["Right Shoulder"].C0 = CFrame.new(1,0.5,0)*CFrame.Angles(0,math.pi/2,0)
  854. end
  855. weldas.Part1 = chr.Torso
  856. weldas.C0 = CFrame.new(-1,0,-1)*CFrame.Angles(math.rad(-90),0,0)
  857. end
  858. for i,v in pairs(stunneds) do
  859. v.PlatformStand = true
  860. end
  861. end)
  862.  
  863. mou.Button1Down:connect(function()
  864. if active then
  865. fire()
  866. end
  867. end)
  868.  
  869. notify([[Chat "!bind [key]" to bind a different key to equip/unequip. Current key is "f".]],false)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement