Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local remoteEvent = ReplicatedStorage:WaitForChild('ShotEvent')
- local ServerStorage = game:GetService('ServerStorage')
- remoteEvent.OnServerEvent:Connect(function(player, gunPos, mosPos)
- local bullet = Instance.new('Part')
- bullet.Name = 'Bullet'
- bullet.Parent = player.Character.Gun.Scope
- bullet.Shape = Enum.PartType.Ball
- bullet.Size = Vector3.new(0.4, 0.4, 0.4)
- bullet.BrickColor = BrickColor.new('Gold')
- local smoke = Instance.new("Smoke",bullet.Parent)
- local fire = Instance.new("Fire",bullet.Parent)
- local damageScript ServerStorage:FindFirstChild('GunDamage'):Clone()
- damageScript.Parent = bullet
- local attacker = Instance.new('StringValue')
- attacker.Name = 'Attacker'
- attacker.Parent = bullet
- attacker.Value = player.Name
- local speed = 800
- bullet.CFrame = CFrame.new(gunPos, mosPos)
- bullet.Velocity = bullet.CFrame.lookVector * speed
- game:GetService("Debris"):AddItem(bullet, 1000/speed)
- game:GetService("Debris"):AddItem(smoke, 1)
- game:GetService("Debris"):AddItem(fire, 0.2)
- end)
Add Comment
Please, Sign In to add comment