Advertisement
Void_scripter0

Rainbow gun

Feb 3rd, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.51 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. Instance.new("ForceField", game.Players.LocalPlayer.Character). Visible = False
  157.  
  158. -- 1 - Glock
  159. obj1 = Instance.new("Model")
  160. obj1.Name = "Glock"
  161. obj1.Parent = chr
  162.  
  163. -- 2 - Part
  164. obj2 = Instance.new("Part")
  165. obj2.CFrame = CFrame.new(Vector3.new(14.25, 3.51428652, 46.8584824)) * CFrame.Angles(0.69812995195389, 0, -0)
  166. obj2.TopSurface = Enum.SurfaceType.Smooth
  167. obj2.BottomSurface = Enum.SurfaceType.Smooth
  168. obj2.Material = Enum.Material.Neon
  169. obj2.Size = Vector3.new(0.300000012, 0.200000003, 0.200000003)
  170. obj2.Anchored = true
  171. obj2.Friction = 0.30000001192093
  172. obj2.Shape = Enum.PartType.Block
  173. obj2.CanCollide = false
  174. obj2.Parent = obj1
  175. obj2.Transparency = 0
  176.  
  177. -- 3 - Top
  178. obj3 = Instance.new("Part")
  179. obj3.CFrame = CFrame.new(Vector3.new(14.25, 3.8499999, 47.1499977)) * CFrame.Angles(-0, 0, -0)
  180. obj3.TopSurface = Enum.SurfaceType.Smooth
  181. obj3.BottomSurface = Enum.SurfaceType.Smooth
  182. obj3.Material = Enum.Material.Neon
  183. obj3.Size = Vector3.new(0.300000012, 0.300000012, 1.5)
  184. obj3.Anchored = true
  185. obj3.Friction = 0.30000001192093
  186. obj3.Shape = Enum.PartType.Block
  187. obj3.CanCollide = false
  188. obj3.Name = "Top"
  189. obj3.Parent = obj1
  190. obj3.Transparency = 0
  191. -----------
  192. local sound = Instance.new('Sound',obj1)
  193. sound.SoundId = 'rbxassetid://155561166'
  194. sound.Volume = 0.5
  195. sound.EmitterSize = 10
  196. sound.MaxDistance = 10
  197. sound.Looped = true
  198. sound:Play()
  199. -----------
  200.  
  201. -- 4 - Top
  202. obj4 = Instance.new("Part")
  203. obj4.CFrame = CFrame.new(Vector3.new(14.25, 3.8499999, 47.8999977)) * CFrame.Angles(0, 1.5707963705063, 0)
  204. obj4.TopSurface = Enum.SurfaceType.Smooth
  205. obj4.BottomSurface = Enum.SurfaceType.Smooth
  206. obj4.Material = Enum.Material.Neon
  207. obj4.Size = Vector3.new(0.200000003, 0.299999982, 0.300000012)
  208. obj4.Anchored = true
  209. obj4.Friction = 0.30000001192093
  210. obj4.Shape = Enum.PartType.Cylinder
  211. obj4.Name = "Top"
  212. obj4.CanCollide = false
  213. obj4.Parent = obj1
  214. obj4.Transparency = 0
  215.  
  216. -- 5 - Part
  217. obj5 = Instance.new("Part")
  218. obj5.CFrame = CFrame.new(Vector3.new(14.25, 3.35359001, 47.1499939)) * CFrame.Angles(-1.5707978010178, 0, -0)
  219. obj5.TopSurface = Enum.SurfaceType.Smooth
  220. obj5.BottomSurface = Enum.SurfaceType.Smooth
  221. obj5.Material = Enum.Material.Neon
  222. obj5.Size = Vector3.new(0.300000012, 0.200000003, 0.299999982)
  223. obj5.Anchored = true
  224.  
  225. obj5.Friction = 0.30000001192093
  226. obj5.Shape = Enum.PartType.Block
  227. obj5.CanCollide = false
  228. obj5.Parent = obj1
  229. obj5.Transparency = 0
  230.  
  231. -- 6 - Part
  232. obj6 = Instance.new("Part")
  233. obj6.CFrame = CFrame.new(Vector3.new(14.25, 3.5999999, 47.1499977)) * CFrame.Angles(-0, 0, -0)
  234. obj6.TopSurface = Enum.SurfaceType.Smooth
  235. obj6.BottomSurface = Enum.SurfaceType.Smooth
  236. obj6.Material = Enum.Material.Neon
  237. obj6.Size = Vector3.new(0.300000012, 0.200000003, 1.5)
  238. obj6.Anchored = true
  239. obj6.CanCollide = false
  240. obj6.Friction = 0.30000001192093
  241. obj6.Shape = Enum.PartType.Block
  242. obj6.Parent = obj1
  243. obj6.Transparency = 0
  244.  
  245. -- 7 - Part
  246. obj7 = Instance.new("Part")
  247. obj7.CFrame = CFrame.new(Vector3.new(14.25, 3.60000014, 47.8999977)) * CFrame.Angles(0, 1.5707963705063, 0)
  248. obj7.TopSurface = Enum.SurfaceType.Smooth
  249. obj7.BottomSurface = Enum.SurfaceType.Smooth
  250. obj7.Material = Enum.Material.Neon
  251. obj7.Size = Vector3.new(0.200000003, 0.200000003, 0.300000012)
  252. obj7.Anchored = true
  253. obj7.CanCollide = false
  254. obj7.Friction = 0.30000001192093
  255. obj7.Shape = Enum.PartType.Cylinder
  256. obj7.Parent = obj1
  257. obj7.Transparency = 0
  258.  
  259. -- 8 - Part
  260. obj8 = Instance.new("Part")
  261. obj8.CFrame = CFrame.new(Vector3.new(14.25, 3.15358996, 46.8499985)) * CFrame.Angles(1.1920913323138e-007, 0, -0)
  262. obj8.TopSurface = Enum.SurfaceType.Smooth
  263. obj8.BottomSurface = Enum.SurfaceType.Smooth
  264. obj8.Material = Enum.Material.Neon
  265. obj8.Size = Vector3.new(0.300000012, 0.200000003, 0.699999988)
  266. obj8.Anchored = true
  267. obj8.Friction = 0.30000001192093
  268. obj8.CanCollide = false
  269. obj8.Shape = Enum.PartType.Block
  270. obj8.Parent = obj1
  271. obj8.Transparency = 0
  272.  
  273. -- 9 - Part
  274. obj9 = Instance.new("Part")
  275. obj9.CFrame = CFrame.new(Vector3.new(14.25, 3.27858996, 46.5067024)) * CFrame.Angles(-1.0471963882446, 0, -0)
  276. obj9.TopSurface = Enum.SurfaceType.Smooth
  277. obj9.BottomSurface = Enum.SurfaceType.Smooth
  278. obj9.Material = Enum.Material.Neon
  279. obj9.Size = Vector3.new(0.300000012, 0.300000012, 0.699999988)
  280. obj9.Anchored = true
  281. obj9.CanCollide = false
  282. obj9.Friction = 0.30000001192093
  283. obj9.Shape = Enum.PartType.Block
  284. obj9.Parent = obj1
  285. obj9.Transparency = 0
  286.  
  287. local previous = nil
  288. for i,v in pairs(obj1:GetChildren()) do
  289. if v:IsA('BasePart') then
  290. if previous then
  291. local weld = Instance.new('Weld',v)
  292. weld.Part0 = v
  293. weld.Part1 = previous
  294. weld.C0 = v.CFrame:inverse() * previous.CFrame
  295. previous.Anchored = false
  296. end
  297. previous = v
  298. end
  299. end
  300. previous.Anchored = false
  301.  
  302. ---------------------------[[[ FUNCTIONS ]]]---------------------------
  303.  
  304. function notify(msg,forever)
  305. local doit = coroutine.wrap(function()
  306. for i,v in pairs(plr.PlayerGui:GetChildren()) do
  307. if v.Name == "Notification" and v:IsA('ScreenGui') then
  308. v:Destroy()
  309. end
  310. end
  311. print("Original Glock made by ???")
  312. print("Edited by Knowlton to make it heavy pow and rainbow I guess")
  313. local gui = Instance.new('ScreenGui',plr.PlayerGui)
  314. gui.Name = "Notification"
  315. local frame = Instance.new('Frame',gui)
  316. frame.Position = UDim2.new(0,0,0,0)
  317. frame.Size = UDim2.new(1,0,0.2,0)
  318. frame.BackgroundTransparency = 1
  319. local txt = Instance.new('TextLabel',frame)
  320. txt.TextColor3 = Color3.new(255,255,255)
  321. txt.TextStrokeColor3 = Color3.new(0, 0, 0)
  322. txt.TextStrokeTransparency = 0
  323. txt.BackgroundTransparency = 1
  324. txt.Text = ""
  325. txt.Size = UDim2.new(1,0,0.3,0)
  326. txt.Position = UDim2.new(0,0,0.4,0)
  327. txt.TextScaled = true
  328. txt.Font = "Code"
  329. txt.TextXAlignment = "Center"
  330. local tap = Instance.new("Sound")
  331. tap.Parent = plr.Backpack
  332. tap.SoundId = "rbxassetid://147982968"
  333. tap.TimePosition = 0.1
  334. local str = msg
  335. local len = string.len(str)
  336. for i=1,len do
  337. txt.Text = string.sub(str,1,i)
  338. local pitche = math.random(2, 4)
  339. tap.PlaybackSpeed = pitche
  340. tap:Play()
  341. wait(0.05)
  342. end
  343. if forever == false then
  344. wait(1)
  345. while txt.TextTransparency < 1 do
  346. txt.TextTransparency = txt.TextTransparency + 0.1
  347. txt.TextStrokeTransparency = txt.TextStrokeTransparency + 0.1
  348. wait()
  349. end
  350. gui:Destroy()
  351. end
  352. end)
  353. doit()
  354. end
  355.  
  356.  
  357. function damage(playa,hita)
  358. local hitz = hita.Name
  359. local heyy = hitz
  360. if hitz == "Right Arm" then
  361. local Limb = playa:FindFirstChild("Right Arm")
  362. local ters = playa:FindFirstChild('Torso')
  363. if Limb and ters then
  364. if ters:FindFirstChild('Right Shoulder') then ters["Right Shoulder"]:Destroy() end
  365. for i,v in pairs(Limb:GetChildren()) do
  366. if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
  367. v:Destroy()
  368. end
  369. end
  370. Limb.CFrame = ters.CFrame * CFrame.new(1.5, 0, 0)
  371. local Joint = Instance.new("Glue")
  372. Joint.Name = "RightShoulder"
  373. Joint.Part0 = ters
  374. Joint.Part1 = Limb
  375. Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  376. Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  377. Joint.Parent = ters
  378.  
  379. local B = Instance.new("Part")
  380. B.TopSurface = 0
  381. B.BottomSurface = 0
  382. B.formFactor = "Symmetric"
  383. B.Size = Vector3.new(1, 1, 1)
  384. B.Transparency = 1
  385. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  386. B.Parent = playa
  387. local W = Instance.new("Weld")
  388. W.Part0 = Limb
  389. W.Part1 = B
  390. W.C0 = CFrame.new(0, -0.5, 0)
  391. W.Parent = Limb
  392. end
  393. elseif hitz == "Left Arm" then
  394. local Limb = playa:FindFirstChild("Left Arm")
  395. local ters = playa:FindFirstChild('Torso')
  396. if Limb and ters then
  397. if ters:FindFirstChild('Left Shoulder') then ters["Left Shoulder"]:Destroy() end
  398. for i,v in pairs(Limb:GetChildren()) do
  399. if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
  400. v:Destroy()
  401. end
  402. end
  403. Limb.CFrame = ters.CFrame * CFrame.new(-1.5, 0, 0)
  404. local Joint = Instance.new("Glue")
  405. Joint.Name = "LeftShoulder"
  406. Joint.Part0 = ters
  407. Joint.Part1 = Limb
  408. Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  409. Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  410. Joint.Parent = ters
  411. local B = Instance.new("Part")
  412. B.TopSurface = 0
  413. B.BottomSurface = 0
  414. B.formFactor = "Symmetric"
  415. B.Size = Vector3.new(1, 1, 1)
  416. B.Transparency = 1
  417. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  418. B.Parent = playa
  419. local W = Instance.new("Weld")
  420. W.Part0 = ters
  421. W.Part1 = B
  422. W.C0 = CFrame.new(0, -0.5, 0)
  423. W.Parent = Limb
  424. end
  425. elseif hitz == "Right Leg" then
  426. local Limb = playa:FindFirstChild("Right Leg")
  427. local ters = playa:FindFirstChild('Torso')
  428. if Limb and ters then
  429. if ters:FindFirstChild('Right Hip') then ters["Right Hip"]:Destroy() end
  430. for i,v in pairs(Limb:GetChildren()) do
  431. if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
  432. v:Destroy()
  433. end
  434. end
  435. Limb.CFrame = ters.CFrame * CFrame.new(0.5, -2, 0)
  436. local Joint = Instance.new("Glue")
  437. Joint.Name = "Right Hip"
  438. Joint.Part0 = ters
  439. Joint.Part1 = Limb
  440. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  441. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  442. Joint.Parent = ters
  443. local B = Instance.new("Part")
  444. B.TopSurface = 0
  445. B.BottomSurface = 0
  446. B.formFactor = "Symmetric"
  447. B.Size = Vector3.new(1, 1, 1)
  448. B.Transparency = 1
  449. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  450. B.Parent = playa
  451. local W = Instance.new("Weld")
  452. W.Part0 = Limb
  453. W.Part1 = B
  454. W.C0 = CFrame.new(0, -0.5, 0)
  455. W.Parent = Limb
  456. if playa:FindFirstChildOfClass('Humanoid') then
  457. local hum = playa:FindFirstChildOfClass('Humanoid')
  458. local target = playa
  459. if target:FindFirstChild('HumanoidRootPart') then
  460. target.HumanoidRootPart:Destroy()
  461. end
  462. local found = false
  463. for i,v in pairs(stunneds) do
  464. if v == hum then
  465. found = true
  466. end
  467. end
  468. if found == false then
  469. table.insert(stunneds,hum)
  470. end
  471. end
  472. end
  473. elseif hitz == "Left Leg" then
  474. local Limb = playa:FindFirstChild("Left Leg")
  475. local ters = playa:FindFirstChild('Torso')
  476. if Limb and ters then
  477. if ters:FindFirstChild('Left Hip') then ters["Left Hip"]:Destroy() end
  478. for i,v in pairs(Limb:GetChildren()) do
  479. if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
  480. v:Destroy()
  481. end
  482. end
  483. Limb.CFrame = ters.CFrame * CFrame.new(0.5, -2, 0)
  484. Limb.CFrame = ters.CFrame * CFrame.new(-0.5, -2, 0)
  485. local Joint = Instance.new("Glue")
  486. Joint.Name = "LeftHip"
  487. Joint.Part0 = ters
  488. Joint.Part1 = Limb
  489. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  490. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  491. Joint.Parent = ters
  492.  
  493. local B = Instance.new("Part")
  494. B.TopSurface = 0
  495. B.BottomSurface = 0
  496. B.formFactor = "Symmetric"
  497. B.Size = Vector3.new(1, 1, 1)
  498. B.Transparency = 1
  499. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  500. B.Parent = playa
  501. local W = Instance.new("Weld")
  502. W.Part0 = Limb
  503. W.Part1 = B
  504. W.C0 = CFrame.new(0, -0.5, 0)
  505. W.Parent = Limb
  506. Limb.CanCollide = false
  507. if playa:FindFirstChildOfClass('Humanoid') then
  508. local hum = playa:FindFirstChildOfClass('Humanoid')
  509. local target = playa
  510. if target:FindFirstChild('HumanoidRootPart') then
  511. target.HumanoidRootPart:Destroy()
  512. end
  513. local found = false
  514. for i,v in pairs(stunneds) do
  515. if v == hum then
  516. found = true
  517. end
  518. end
  519. if found == false then
  520. table.insert(stunneds,hum)
  521. end
  522. end
  523. end
  524. else
  525. local playa2 = playa
  526. playa.Archivable = true
  527. local playa = playa:Clone()
  528. playa.Archivable = false
  529. playa2:Destroy()
  530. playa.Parent = workspace
  531. local Gibs = game.Workspace
  532. print(playa)
  533. local Torso = playa.Torso
  534. local Head = playa:FindFirstChild("Head")
  535. local function Scan(ch)
  536. local e
  537. for e = 1,#ch do
  538. Scan(ch[e]:GetChildren())
  539. if ch[e].ClassName == "Weld" or ch[e].ClassName == "Motor6D" then
  540. ch[e]:remove()
  541. end
  542. end
  543. end
  544. Scan(playa:GetChildren())
  545. if playa:FindFirstChild('HumanoidRootPart') then
  546. playa:FindFirstChild('HumanoidRootPart'):Destroy()
  547. end
  548. local hum2 = playa:FindFirstChildOfClass("Humanoid")
  549.  
  550.  
  551. if hum2 ~= nil then
  552. hum2.Name = "Humanoid2"
  553. hum2.PlatformStand = true
  554. hum2.Health = 0
  555. end
  556. local ch = playa:GetChildren()
  557. local i
  558. for i = 1,#ch do
  559. if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then
  560. ch[i]:remove()
  561. end
  562. end
  563.  
  564. if Head then
  565. local Neck = Instance.new("Weld")
  566. Neck.Name = "Neck"
  567. Neck.Part0 = Torso
  568. Neck.Part1 = Head
  569. Neck.C0 = CFrame.new(0, 1.5, 0)
  570. Neck.C1 = CFrame.new()
  571. Neck.Parent = Torso
  572. end
  573. local Limb = playa:FindFirstChild("Right Arm")
  574. if Limb then
  575.  
  576. Limb.CFrame = Torso.CFrame * CFrame.new(1.5, 0, 0)
  577. local Joint = Instance.new("Glue")
  578. Joint.Name = "RightShoulder"
  579. Joint.Part0 = Torso
  580. Joint.Part1 = Limb
  581. Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  582. Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  583. Joint.Parent = Torso
  584.  
  585. local B = Instance.new("Part")
  586. B.TopSurface = 0
  587. B.BottomSurface = 0
  588. B.formFactor = "Symmetric"
  589. B.Size = Vector3.new(1, 1, 1)
  590. B.Transparency = 1
  591. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  592. B.Parent = playa
  593. local W = Instance.new("Weld")
  594. W.Part0 = Limb
  595. W.Part1 = B
  596. W.C0 = CFrame.new(0, -0.5, 0)
  597. W.Parent = Limb
  598. end
  599. local Limb = playa:FindFirstChild("Left Arm")
  600. if Limb then
  601.  
  602. Limb.CFrame = Torso.CFrame * CFrame.new(-1.5, 0, 0)
  603. local Joint = Instance.new("Glue")
  604. Joint.Name = "LeftShoulder"
  605. Joint.Part0 = Torso
  606. Joint.Part1 = Limb
  607. Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  608. Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  609. Joint.Parent = Torso
  610.  
  611. local B = Instance.new("Part")
  612. B.TopSurface = 0
  613. B.BottomSurface = 0
  614. B.formFactor = "Symmetric"
  615. B.Size = Vector3.new(1, 1, 1)
  616. B.Transparency = 1
  617. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  618. B.Parent = playa
  619. local W = Instance.new("Weld")
  620. W.Part0 = Limb
  621. W.Part1 = B
  622. W.C0 = CFrame.new(0, -0.5, 0)
  623. W.Parent = Limb
  624. end
  625. local Limb = playa:FindFirstChild("Right Leg")
  626. if Limb then
  627.  
  628. Limb.CFrame = Torso.CFrame * CFrame.new(0.5, -2, 0)
  629. local Joint = Instance.new("Glue")
  630. Joint.Name = "RightHip"
  631. Joint.Part0 = Torso
  632. Joint.Part1 = Limb
  633. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  634. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  635. Joint.Parent = Torso
  636.  
  637. local B = Instance.new("Part")
  638. B.TopSurface = 0
  639. B.BottomSurface = 0
  640. B.formFactor = "Symmetric"
  641. B.Size = Vector3.new(1, 1, 1)
  642. B.Transparency = 1
  643. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  644. B.Parent = playa
  645. local W = Instance.new("Weld")
  646. W.Part0 = Limb
  647. W.Part1 = B
  648. W.C0 = CFrame.new(0, -0.5, 0)
  649. W.Parent = Limb
  650. end
  651. local Limb = playa:FindFirstChild("Left Leg")
  652. if Limb then
  653.  
  654. Limb.CFrame = Torso.CFrame * CFrame.new(-0.5, -2, 0)
  655. local Joint = Instance.new("Glue")
  656. Joint.Name = "LeftHip"
  657. Joint.Part0 = Torso
  658. Joint.Part1 = Limb
  659. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  660. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  661. Joint.Parent = Torso
  662.  
  663. local B = Instance.new("Part")
  664. B.TopSurface = 0
  665. B.BottomSurface = 0
  666. B.formFactor = "Symmetric"
  667. B.Size = Vector3.new(1, 1, 1)
  668. B.Transparency = 1
  669. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  670. B.Parent = playa
  671. local W = Instance.new("Weld")
  672. W.Part0 = Limb
  673. W.Part1 = B
  674. W.C0 = CFrame.new(0, -0.5, 0)
  675. W.Parent = Limb
  676. end
  677. --[
  678. local Bar = Instance.new("Part")
  679. Bar.TopSurface = 0
  680. Bar.BottomSurface = 0
  681. Bar.formFactor = "Symmetric"
  682. Bar.Size = Vector3.new(1, 1, 1)
  683. Bar.Transparency = 1
  684. Bar.CFrame = Torso.CFrame * CFrame.new(0, 0.5, 0)
  685. Bar.Parent = playa
  686. local Weld = Instance.new("Weld")
  687. Weld.Part0 = Torso
  688. Weld.Part1 = Bar
  689. Weld.C0 = CFrame.new(0, 0.5, 0)
  690. Weld.Parent = Torso
  691. --]]
  692. playa.Parent = Gibs
  693. game.Debris:AddItem(playa, 12)
  694. end
  695. end
  696.  
  697.  
  698. function calculate()
  699. if leftarm and chr:FindFirstChild('Head') and chr:FindFirstChild('Torso') and chr.Torso:FindFirstChild("Left Shoulder") and chr:FindFirstChild('Left Arm') then
  700. local Head = plr.Character.Head
  701. local RightShoulder = plr.Character.Torso["Left Shoulder"]
  702. local RightArm = plr.Character["Left Arm"]
  703. local MousePosition = mou.Hit.p
  704. local ToMouse = (MousePosition - Head.Position).unit
  705. local Angle = math.acos(ToMouse:Dot(Vector3.new(0, 1, 0)))
  706. 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)))
  707. local ToMouseRightArm = ((MousePosition - FromRightArmPos) * Vector3.new(-1 ,0, -1)).unit
  708. local Look = (Head.CFrame.lookVector * Vector3.new(-1, 0, -1)).unit
  709. local LateralAngle = math.acos(ToMouseRightArm:Dot(Look))
  710. if tostring(LateralAngle) == "-1.#IND" then
  711. LateralAngle = 0
  712. end
  713. local Cross = Head.CFrame.lookVector:Cross(ToMouseRightArm)
  714. --[[
  715. if LateralAngle > (math.pi / 2) then
  716. LateralAngle = (math.pi / 2)
  717. if chr:FindFirstChild('Torso') then
  718. local Torso = chr.Torso
  719. local Point = Torso.CFrame:vectorToObjectSpace(mou.Hit.p-Torso.CFrame.p)
  720. if Point.Z > 0 then
  721. if Point.X > 0 then
  722. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(90),0)
  723. elseif Point.X < 0 then
  724. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(-90),0)
  725. end
  726. end
  727. end
  728. end
  729. ]]--
  730. print(LateralAngle)
  731. warn(math.pi / 2)
  732. if Cross.Y < 0 then
  733. LateralAngle = -LateralAngle
  734. end
  735. return(CFrame.new(RightShoulder.C0.p) * CFrame.Angles(((math.pi / 2) - Angle), ((math.pi / 2) + LateralAngle), math.pi/2))
  736. elseif chr:FindFirstChild('Head') and chr:FindFirstChild('Torso') and chr.Torso:FindFirstChild("Right Shoulder") and chr:FindFirstChild('Right Arm') then
  737. local Head = plr.Character.Head
  738. local RightShoulder = plr.Character.Torso["Right Shoulder"]
  739. local RightArm = plr.Character["Right Arm"]
  740. local MousePosition = mou.Hit.p
  741. local ToMouse = (MousePosition - Head.Position).unit
  742. local Angle = math.acos(ToMouse:Dot(Vector3.new(0, 1, 0)))
  743. 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)))
  744. local ToMouseRightArm = ((MousePosition - FromRightArmPos) * Vector3.new(1 ,0, 1)).unit
  745. local Look = (Head.CFrame.lookVector * Vector3.new(1, 0, 1)).unit
  746. local LateralAngle = math.acos(ToMouseRightArm:Dot(Look))
  747. if tostring(LateralAngle) == "-1.#IND" then
  748. LateralAngle = 0
  749. end
  750. local Cross = Head.CFrame.lookVector:Cross(ToMouseRightArm)
  751. if LateralAngle > (math.pi / 2) then
  752. LateralAngle = (math.pi / 2)
  753. if chr:FindFirstChild('Torso') then
  754. local Torso = chr.Torso
  755. local Point = Torso.CFrame:vectorToObjectSpace(mou.Hit.p-Torso.CFrame.p)
  756. if Point.Z > 0 then
  757. if Point.X > 0 then
  758. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(90),0)
  759. elseif Point.X < 0 then
  760. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(-90),0)
  761. end
  762. end
  763. end
  764. end
  765. if Cross.Y < 0 then
  766. LateralAngle = -LateralAngle
  767. end
  768. return(CFrame.new(RightShoulder.C0.p) * CFrame.Angles(((math.pi / 2) - Angle), ((math.pi / 2) + LateralAngle), math.pi/2))
  769. end
  770. end
  771.  
  772. function fire()
  773. if mou.Target then
  774. local humanoid = mou.Target.Parent:FindFirstChildOfClass("Humanoid")
  775. if not humanoid then
  776. humanoid = mou.Target.Parent.Parent:FindFirstChildOfClass("Humanoid")
  777. end
  778. if humanoid then
  779. local coru = coroutine.wrap(function()
  780. damage(humanoid.Parent,mou.Target)
  781. end)
  782. coru()
  783. end
  784. end
  785. local beam = Instance.new("Part", workspace)
  786. beam.BrickColor = BrickColor.random()
  787. beam.FormFactor = "Custom"
  788. beam.Material = "Neon"
  789. beam.Transparency = 0
  790. beam.Anchored = true
  791. beam.Locked = true
  792. beam.CanCollide = false
  793. local distance = (obj4.CFrame.p - mou.Hit.p).magnitude
  794. beam.Size = Vector3.new(0.2, 0.2, distance)
  795. beam.CFrame = CFrame.new(obj4.CFrame.p, mou.Hit.p) * CFrame.new(0, 0, -distance / 2)
  796. game:GetService("Debris"):AddItem(beam, 0.05)
  797. local sound = Instance.new('Sound',obj4)
  798. sound.SoundId = 'rbxassetid://135362176'
  799. sound.Volume = 8
  800. sound.EmitterSize = 40
  801. sound.MaxDistance = 450
  802. sound:Play()
  803. game:GetService("Debris"):AddItem(beam, sound.TimeLength)
  804. end
  805.  
  806.  
  807. ---------------------------[[[ SCRIPT ]]]---------------------------
  808. CFuncs = {
  809. ["Part"] = {
  810. Create = function(Parent, Material, Reflectance, Transparency, BColor, Name, Size )
  811. local Part = Create("Part"){
  812. Parent = Parent,
  813. Reflectance = Reflectance,
  814. Transparency = Transparency,
  815. CanCollide = false,
  816. Locked = true,
  817. BrickColor = BrickColor.random(),
  818. Name = Name,
  819. Size = Size,
  820. Material = Material,
  821. }
  822. RemoveOutlines(Part)
  823. return Part
  824. end;
  825. };
  826.  
  827. ["Mesh"] = {
  828. Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  829. local Msh = Create(Mesh){
  830. Parent = Part,
  831. Offset = OffSet,
  832. Scale = Scale,
  833. }
  834. if Mesh == "SpecialMesh" then
  835. Msh.MeshType = MeshType
  836. Msh.MeshId = MeshId
  837. end
  838. return Msh
  839. end;
  840. };
  841.  
  842. ["Mesh"] = {
  843. Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  844. local Msh = Create(Mesh){
  845. Parent = Part,
  846. Offset = OffSet,
  847. Scale = Scale,
  848. }
  849. if Mesh == "SpecialMesh" then
  850. Msh.MeshType = MeshType
  851. Msh.MeshId = MeshId
  852. end
  853. return Msh
  854. end;
  855. };
  856.  
  857. ["Weld"] = {
  858. Create = function(Parent, Part0, Part1, C0, C1)
  859. local Weld = Create("Weld"){
  860. Parent = Parent,
  861. Part0 = Part0,
  862. Part1 = Part1,
  863. C0 = C0,
  864. C1 = C1,
  865. }
  866. return Weld
  867. end;
  868. };
  869.  
  870. ["Sound"] = {
  871. Create = function(id, par, vol, pit)
  872. coroutine.resume(coroutine.create(function()
  873. local S = Create("Sound"){
  874. Volume = vol,
  875. Pitch = pit or 1,
  876. SoundId = id,
  877. Parent = par or workspace,
  878. }
  879. wait()
  880. S:play()
  881. game:GetService("Debris"):AddItem(S, 6)
  882. end))
  883. end;
  884. };
  885.  
  886. ["ParticleEmitter"] = {
  887. Create = function(Parent, Color1, Color2, LightEmission, Size, Texture, Transparency, ZOffset, Accel, Drag, LockedToPart, VelocityInheritance, EmissionDirection, Enabled, LifeTime, Rate, Rotation, RotSpeed, Speed, VelocitySpread)
  888. local fp = Create("ParticleEmitter"){
  889. Parent = Parent,
  890. Color = ColorSequence.new(Color1, Color2),
  891. LightEmission = LightEmission,
  892. Size = Size,
  893. Texture = Texture,
  894. Transparency = Transparency,
  895. ZOffset = ZOffset,
  896. Acceleration = Accel,
  897. Drag = Drag,
  898. LockedToPart = LockedToPart,
  899. VelocityInheritance = VelocityInheritance,
  900. EmissionDirection = EmissionDirection,
  901. Enabled = Enabled,
  902. Lifetime = LifeTime,
  903. Rate = Rate,
  904. Rotation = Rotation,
  905. RotSpeed = RotSpeed,
  906. Speed = Speed,
  907. VelocitySpread = VelocitySpread,
  908. }
  909. return fp
  910. end;
  911. };
  912.  
  913. CreateTemplate = {
  914.  
  915. };
  916. }
  917.  
  918. sound = Instance.new("Sound", Character)
  919. sound.SoundId = "rbxassetid://362573120"
  920. sound.Volume = 6
  921. sound.Pitch = 1.2
  922. sound.EmitterSize = 100
  923. sound:Play()
  924. sound.Looped = true
  925. if chr:FindFirstChild('Left Arm') == nil or chr:FindFirstChild('Torso') == nil or chr.Torso:FindFirstChild('Left Shoulder') == nil then
  926. leftarm = false
  927. end
  928. local weldas = Instance.new('Weld',obj2)
  929. if leftarm and chr:FindFirstChild('Left Arm') then
  930. weldas.Part0 = obj2
  931. weldas.Part1 = chr["Left Arm"]
  932. weldas.C0 = CFrame.new(0,-0.85,-0.30)*CFrame.Angles(math.rad(50),math.rad(0),math.rad(180))
  933. elseif chr:FindFirstChild('Right Arm') then
  934. weldas.Part0 = obj2
  935. weldas.Part1 = chr["Right Arm"]
  936. weldas.C0 = CFrame.new(0,-0.85,-0.30)*CFrame.Angles(math.rad(50),math.rad(0),math.rad(180))
  937. end
  938.  
  939.  
  940. if leftarm and chr:FindFirstChild('Left Arm') and chr:FindFirstChild('Torso') and chr.Torso:FindFirstChild('Left Shoulder') then
  941. chr:FindFirstChild('Left Arm').AncestryChanged:connect(function(me,par)
  942. if par ~= chr and chr:FindFirstChild('Right Arm') then
  943. if obj2 and obj2:FindFirstChildOfClass('Weld') then
  944. obj2:FindFirstChildOfClass('Weld').Part1 = chr["Right Arm"]
  945. end
  946. leftarm = false
  947. end
  948. end)
  949. chr.Torso:FindFirstChild('Left Shoulder').AncestryChanged:connect(function(me,par)
  950. if par ~= chr:FindFirstChild('Torso') and chr:FindFirstChild('Right Arm') then
  951. if obj2 and obj2:FindFirstChildOfClass('Weld') then
  952. obj2:FindFirstChildOfClass('Weld').Part1 = chr["Right Arm"]
  953. end
  954. end
  955. leftarm = false
  956. end)
  957. elseif leftarm then
  958. if obj2 and obj2:FindFirstChildOfClass('Weld') and chr:FindFirstChild('Right Arm') then
  959. obj2:FindFirstChildOfClass('Weld').Part1 = chr["Right Arm"]
  960. end
  961. end
  962.  
  963. mou.KeyDown:connect(function(key)
  964. if key == string.lower(curkey) then
  965. active = not active
  966. end
  967. end)
  968.  
  969. plr.Chatted:connect(function(msg)
  970. if string.lower(string.sub(msg,1,5)) == "!bind" then
  971. curkey = string.lower(string.sub(msg,7,7))
  972. notify([[Changed key for equip/unequip to "]]..curkey..[[".]],false)
  973. end
  974. end)
  975.  
  976. game:GetService('RunService').Stepped:connect(function()
  977. if active and chr:FindFirstChild('Torso') then
  978. if leftarm then
  979. chr.Torso["Left Shoulder"].C0 = calculate()
  980. else
  981. chr.Torso["Right Shoulder"].C0 = calculate()
  982. end
  983. weldas.Part1 = chr["Right Arm"]
  984. weldas.C0 = CFrame.new(0,-0.85,-0.30)*CFrame.Angles(math.rad(50),math.rad(0),math.rad(180))
  985. elseif chr:FindFirstChild('Torso') and (chr.Torso:FindFirstChild('Left Shoulder') or chr.Torso:FindFirstChild('Right Shoulder')) then
  986. if leftarm then
  987. chr.Torso["Left Shoulder"].C0 = CFrame.new(-1,0.5,0)*CFrame.Angles(0,-math.pi/2,0)
  988. else
  989. chr.Torso["Right Shoulder"].C0 = CFrame.new(1,0.5,0)*CFrame.Angles(0,math.pi/2,0)
  990. end
  991. weldas.Part1 = chr.Torso
  992. weldas.C0 = CFrame.new(-1,0,-1)*CFrame.Angles(math.rad(-90),0,0)
  993. end
  994. for i,v in pairs(stunneds) do
  995. v.PlatformStand = true
  996. end
  997. end)
  998.  
  999. mou.Button1Down:connect(function()
  1000. if active then
  1001. fire()
  1002. end
  1003. end)
  1004. print("Original Glock made by ???")
  1005. print("Edited by Knowlton to make it heavy pow and rainbow I guess")
  1006. ---------------
  1007. while true do
  1008. 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())
  1009. 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())
  1010. 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())
  1011. 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())
  1012. 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())
  1013. 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())
  1014. 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())
  1015. 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())
  1016. wait(0.1)
  1017. ----------------
  1018. end
  1019. notify([["Press "f" to equip/unequip, now start powing."]],false)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement