Advertisement
RoccoB

Doors Op Hot Gun Script, RocScripts

Apr 2nd, 2023
2,789
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.65 KB | None | 0 0
  1. -- Credit to PenguinManiack For Creating The Script
  2.  
  3. local Functions = loadstring(game:HttpGet("https://raw.githubusercontent.com/RegularVynixu/Utilities/main/Functions.lua"))()
  4. local CustomShop = loadstring(game:HttpGet("https://raw.githubusercontent.com/RegularVynixu/Utilities/main/Doors/Custom%20Shop%20Items/Source.lua"))()
  5. local UIS = game:GetService("UserInputService")
  6. local exampleTool = LoadCustomInstance("rbxassetid://12848567274") -- wand model
  7.  
  8. if game:GetService("Players").LocalPlayer.PlayerGui.MainUI.ItemShop.Visible == true then
  9.     -- Create custom shop item
  10.     CustomShop.CreateItem(exampleTool, {
  11.         Title = "Harry Potter Wand",
  12.         Desc = "Works on entities",
  13.         Image = "https://cdn.discordapp.com/attachments/1049016956231102465/1078727375631679688/image_2023-02-24_121721211-removebg-preview.png",
  14.         Price = "gun",
  15.         Stack = 1,
  16.     })
  17.     ----------------------------------------- parenting
  18. else
  19.     exampleTool.Parent = game.Players.LocalPlayer.Backpack
  20. end
  21. local tool = exampleTool
  22. local function Shoot()
  23.     local bullet = game:GetObjects("rbxassetid://12848374097")[1]
  24.     task.wait()
  25.     bullet.Anchored = false
  26.     bullet.Massless = false
  27.     local Sound = Instance.new("Sound", game.StarterPlayer)
  28.     Sound.Volume = 3.5
  29.     Sound.SoundId = "rbxassetid://5238024665"
  30.     Sound.PlayOnRemove = true
  31.     Sound:Destroy()
  32.     HRP = exampleTool.BulletPart.CFrame * CFrame.Angles(0,math.rad(-90),0)
  33.     local Attachment = Instance.new("Attachment", bullet)
  34.     local LV = Instance.new("LinearVelocity", Attachment) -- creating the linear velocity
  35.     LV.MaxForce = math.huge -- no need to worry about this
  36.     LV.VectorVelocity = (game:GetService("Players").LocalPlayer:GetMouse().Hit.Position - tool.BulletPart.Position).Unit * 100-- HRP.lookVector * 50 -- change 100 with how fast you want the projectile to go
  37.     LV.Attachment0 = Attachment --Required Attachment
  38.     bullet.Parent = game.Workspace
  39.     bullet.CFrame = tool.BulletPart.CFrame * CFrame.Angles(math.rad(0),math.rad(90),math.rad(90))
  40.     bullet.Touched:Connect(function(part)
  41.         local Model = part:FindFirstAncestorWhichIsA("Model")
  42.         if Model ~= nil and Model:GetAttribute("IsCustomEntity") == true then
  43.             Model:Destroy()
  44.         end
  45.     end)
  46.     task.wait(0.3)
  47.     bullet:Destroy()
  48.     end
  49. ----------------------------------------------- Shooting!
  50.    
  51. UIS.InputBegan:Connect(function(input)
  52.     if tool.Parent == game.Players.LocalPlayer.Character then
  53.         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  54.         getgenv().BulletType = "12848374097"
  55.         Shoot()
  56.        
  57.         end
  58.     end
  59. end)
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement