Advertisement
Void_scripter0

glock

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