Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- By Dominical -- Script Builder -- Local Script -- V 5.0 --
- PlayerName = "corymegatron" -- Put your name here then run as local script
- player=game.Players[PlayerName]
- character=player
- PlayerMouse=player:GetMouse()--returns player mouse
- bullet_speed=300--constant value
- local gun=Instance.new("Tool")
- local gun_handle=Instance.new("Part")
- local handle_mesh=Instance.new("FileMesh")
- gun.Parent=player.Backpack
- gun.Name="Grenade Launcher"
- gun.TextureId="http://www.roblox.com/asset?id=73566284"
- gun_handle.Parent=gun
- gun_handle.Name="Handle"
- gun_handle.Size=Vector3.new(0.2, 1.7, 1.4)
- handle_mesh.Parent=gun_handle
- handle_mesh.MeshId="http://www.roblox.com/asset?id=19361608"
- handle_mesh.TextureId="http://www.roblox.com/asset?id=41827574"
- handle_mesh.VertexColor=Vector3.new(2,2,2)--yes this is a vector value
- handle_mesh.Scale=Vector3.new(0.5, 0.5, 0.5)
- gun.GripForward=Vector3.new(0, 1, 0)
- gun.GripPos=Vector3.new(0, -0.3, -1)
- gun.GripUp=Vector3.new(0, 0, 1)
- gun.GripRight=Vector3.new(0, 0, 0)--bug fix(done)
- gun.Activated:connect(function()
- local bullet=Instance.new("Part")
- local bullet_mesh=Instance.new("SpecialMesh")
- local shot_sound=Instance.new("Sound")
- local impact_sound=Instance.new("Sound")
- bullet_mesh.MeshType="FileMesh"
- bullet.Size=Vector3.new(2,2,2)
- bullet.Parent=workspace
- bullet.Name="Bullet"
- bullet.TopSurface="Smooth"
- bullet.BottomSurface='Smooth'
- bullet.BrickColor=BrickColor.new("Bright yellow")
- bullet_mesh.MeshId="http://www.roblox.com/asset/?id=94691640"
- bullet_mesh.TextureId="http://www.roblox.com/asset/?id=94691681"
- bullet_mesh.Scale=Vector3.new(2,2,2)
- bullet_mesh.Parent=bullet
- impact_sound.Parent=bullet
- impact_sound.SoundId="http://www.roblox.com/asset?id=157878578"
- bullet.CFrame=CFrame.new(gun_handle.CFrame.X,gun_handle.CFrame.Y+3,gun_handle.CFrame.Z)
- bullet.Velocity=PlayerMouse.Hit.lookVector*bullet_speed
- bullet.Touched:connect(function(hit)
- if hit.Parent:findFirstChild("Humanoid") and hit.Parent.Name~=PlayerName then
- local explosion=Instance.new("Explosion")
- explosion.Parent=workspace
- explosion.Position=bullet.Position
- hit.Parent:BreakJoints()
- impact_sound:Play()
- bullet:remove()
- else
- local explosion=Instance.new("Explosion")
- explosion.Parent=workspace
- explosion.Position=bullet.Position
- impact_sound:Play()
- bullet:remove()
- end
- end)
- shot_sound.Parent=gun_handle
- shot_sound.SoundId="http://www.roblox.com/asset?id=135039581"
- shot_sound:Play()
- wait(1.5)
- shot_sound:remove()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement