Advertisement
KrYn0MoRe

scoob gun [old]

May 28th, 2022 (edited)
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.00 KB | None | 0 0
  1. Tool0 = Instance.new("Tool")
  2. Part1 = Instance.new("Part")
  3. SpecialMesh2 = Instance.new("SpecialMesh")
  4. Script3 = Instance.new("Script")
  5. Tool0.Name = "Scoob"
  6. Tool0.Parent = owner.Backpack
  7. Part1.Name = "Handle"
  8. Part1.Parent = Tool0
  9. Part1.CFrame = CFrame.new(-0.00300200004, 1.55452394, -0.00200699992, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  10. Part1.Position = Vector3.new(-0.00300200004, 1.55452394, -0.00200699992)
  11. Part1.Size = Vector3.new(2.5, 3.10899997, 3.25900006)
  12. Part1.BottomSurface = Enum.SurfaceType.Smooth
  13. Part1.TopSurface = Enum.SurfaceType.Smooth
  14. SpecialMesh2.Parent = Part1
  15. SpecialMesh2.MeshId = "rbxassetid://1107996700"
  16. SpecialMesh2.Scale = Vector3.new(0.0500000007, 0.0500000007, 0.0500000007)
  17. SpecialMesh2.TextureId = "rbxassetid://1107996710"
  18. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  19. Script3.Parent = Tool0
  20.  
  21. plr = owner
  22. char = plr.Character
  23.  
  24. local effectfolder = Instance.new("Folder",script)
  25. effectfolder.Name = 'effectfolder'
  26.  
  27. function shoot(from,dir)
  28.     spawn(function()
  29.         local bullet = Instance.new("Part")
  30.         local mesh = Instance.new("SpecialMesh")
  31.         bullet.Name = "bullet"
  32.         bullet.Parent = effectfolder
  33.         bullet.Size = Vector3.new(10, 0.265, 0.265)
  34.         bullet.Anchored = true
  35.         bullet.BottomSurface = Enum.SurfaceType.Smooth
  36.         bullet.BrickColor = BrickColor.new("Bright yellow")
  37.         bullet.CanCollide = false
  38.         bullet.Material = Enum.Material.Neon
  39.         bullet.Reflectance = 1
  40.         bullet.Transparency = 1
  41.         bullet.TopSurface = Enum.SurfaceType.Smooth
  42.         bullet.brickColor = BrickColor.new("Bright yellow")
  43.         mesh.Parent = bullet
  44.         mesh.MeshType = Enum.MeshType.Sphere
  45.  
  46.         bullet.Touched:Connect(function(obj)
  47.             local hum = obj.Parent:FindFirstChildOfClass("Humanoid")
  48.             if hum then
  49.                 if not hum:IsDescendantOf(char) then
  50.                     obj.Parent:BreakJoints()
  51.                 end
  52.             end
  53.         end)
  54.  
  55.         game:GetService("Debris"):AddItem(bullet,5)
  56.         bullet.CFrame = CFrame.new(from,dir)*CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))
  57.         bullet.Velocity = bullet.CFrame.rightVector*1000
  58.         bullet.RotVelocity = Vector3.new(0,0,0)
  59.         bullet.Anchored = false
  60.         bullet.Massless = true
  61.         bullet.Transparency = 0
  62.  
  63.         spawn(function()
  64.             local flyy = Instance.new('BodyVelocity',bullet)
  65.             flyy.Velocity = bullet.CFrame.rightVector*1000
  66.         end)
  67.     end)
  68. end
  69. local remote = Instance.new("RemoteEvent",owner.Character)
  70. remote.Name = "Remote"
  71.  
  72. local ls = [[
  73. plr = owner
  74. mouse = plr:GetMouse()
  75. remote = plr.Character:WaitForChild("Remote")
  76. holding = false
  77.  
  78. mouse.KeyDown:Connect(function(key)
  79. end)
  80.  
  81. mouse.Button1Down:Connect(function()
  82. holding = true
  83. remote:FireServer(2,nil,true)
  84. spawn(function()
  85.     while holding do
  86.         --game:GetService("RunService").RenderStepped:wait()
  87.         wait(.1)
  88.         local dir = mouse.Hit.p
  89.         remote:FireServer(1,dir,true)
  90.     end
  91. end)
  92. end)
  93.  
  94. mouse.Button1Up:Connect(function()
  95. holding = false
  96. remote:FireServer(2,nil,false)
  97. end)
  98.  
  99. mouse.KeyUp:Connect(function(key)
  100. end)
  101. ]]
  102.  
  103. NLS(ls,owner.Character)
  104.  
  105. local holding = false
  106. local equipped = false
  107.  
  108. local scoob = Instance.new("Sound")
  109. scoob.Parent = Part1
  110. scoob.SoundId = "rbxassetid://1246537612"
  111. scoob.Volume = 3
  112.  
  113. Tool0.Equipped:Connect(function()
  114.     equipped = true
  115.     scoob:Play()
  116. end)
  117.  
  118. Tool0.Unequipped:Connect(function()
  119.     equipped = false
  120. end)
  121.  
  122. local Sound0 = Instance.new("Sound")
  123. Sound0.Parent = Part1
  124. Sound0.SoundId = "rbxassetid://991269011"
  125. Sound0.Volume = 3
  126. Sound0.Looped = true
  127.  
  128. remote.OnServerEvent:Connect(function(plr,mode,dir,hold)
  129.     if mode == 1 and equipped then
  130.         spawn(function()
  131.             shoot((char['Torso'] or char['UpperTorso']).CFrame.p,dir)
  132.         end)
  133.     elseif mode == 2 and equipped then
  134.         spawn(function()
  135.             if hold then
  136.                 holding = true
  137.                 if not Sound0 then
  138.                     Sound0 = Instance.new("Sound")
  139.                     Sound0.Name = "tyler1 gratting"
  140.                     Sound0.Parent = Part1
  141.                     Sound0.SoundId = "rbxassetid://991269011"
  142.                     Sound0.Volume = 3
  143.                     Sound0.Looped = true
  144.                 end
  145.                 Sound0:Resume()
  146.                 repeat wait() until not holding
  147.                 Sound0:Pause()
  148.             elseif not hold then
  149.                 holding = false
  150.             end
  151.         end)
  152.     end
  153. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement