Advertisement
Black_Magic

Untitled

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