Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Player = game.Players.LocalPlayer
- Mouse = Player:GetMouse()
- local firing = false
- function Firing() -- call this after
- repeat wait()
- plr = game.Players.LocalPlayer --Variable
- plr.Character.Humanoid.Animator:Destroy() --Destroy anim (if idle changed)
- local t = Instance.new('Sound' ,game.Workspace) --(Variable making sound + properties if need.)
- t.SoundId = 'http://www.roblox.com/asset/?id=2248511' --(Selecting the sound from roblox/develop/library*Sounds/(ID)
- local Mouse = plr:GetMouse() --(Getmous)
- Mouse.KeyDown:connect(function(Key) --Function
- Key = Key:lower() --(getting keys)
- if Key == 'e' then --which button pressed
- plr.Character.Humanoid.WalkSpeed = 100
- local h = Instance.new('Part' ,game.Workspace) --making part
- h.Material = 'Neon' --properties from variable 'h'
- h.CanCollide = false
- h.Name = 'Bullet'
- h.BrickColor = BrickColor.new('Lime green')
- h.Size = Vector3.new(1,1,4)
- h.Anchored = true
- h.CFrame = plr.Character.Torso.CFrame * CFrame.new(0,0,-4.3)
- local function ontouch(hit) --when touched (what it hits)
- local r = Instance.new('Explosion' ,game.Workspace) --making explosion
- r.ExplosionType = 'NoCraters' --properties of variable r
- r.BlastRadius = 0
- r.Position = Vector3.new(h.Position.X,h.Position.Y,h.Position.Z)
- h:Destroy() --Destroying the variable
- hit.Parent.Humanoid.Health = 0
- hit:BreakJoints() --breaking joint
- t.Playing = true
- end
- h.Touched:connect(ontouch)
- while true do wait()
- h.CFrame = h.CFrame * CFrame.new(0,0,-3.4)
- end
- end
- end)
- until firing == false
- end
- Mouse.KeyDown:connect(function(key)
- Key = key:lower()
- if Key == "f" then
- firing = true
- Firing() -- call the function
- end
- end)
- Mouse.KeyUp:connect(function()
- firing = false
- end)
Add Comment
Please, Sign In to add comment