Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local rs = game:GetService("ReplicatedStorage")
- local debris = game:GetService("Debris")
- local gun = script.Parent
- local gunsound = script.Parent["Gun Shot"]
- local damage = 20
- gun.Activated:Connect(function(hitfire)
- local bullet = game.ReplicatedStorage.Bullet:Clone()
- bullet.Parent = game.Workspace
- bullet.CFrame = script.Parent.Fire.CFrame
- bullet.Velocity = script.Parent.Fire.CFrame.LookVector * 400
- gunsound:Play()
- debris:AddItem(bullet,3)
- bullet.Touched:Connect(function(hitdamage)
- if hitdamage.Parent:FindFirstChild("Humanoid") and hitdamage.Parent ~= gun.Parent then
- local enemy = hitdamage.Parent
- local bloodsound = script.Parent["Big Blood Damage 1"]
- enemy.Humanoid.Health -= damage
- bloodsound:Play()
- bullet:Destroy()
- end
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement