Hasli4

RBLX. BulletCreate

May 14th, 2025
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.06 KB | None | 0 0
  1. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  2. local remoteEvent = ReplicatedStorage:WaitForChild('ShotEvent')
  3. local ServerStorage = game:GetService('ServerStorage')
  4.  
  5. remoteEvent.OnServerEvent:Connect(function(player, gunPos, mosPos)
  6. local bullet = Instance.new('Part')
  7. bullet.Name = 'Bullet'
  8. bullet.Parent = player.Character.Gun.Scope
  9. bullet.Shape = Enum.PartType.Ball
  10. bullet.Size = Vector3.new(0.4, 0.4, 0.4)
  11. bullet.BrickColor = BrickColor.new('Gold')
  12.  
  13. local smoke = Instance.new("Smoke",bullet.Parent)
  14. local fire = Instance.new("Fire",bullet.Parent)
  15. local damageScript ServerStorage:FindFirstChild('GunDamage'):Clone()
  16. damageScript.Parent = bullet
  17.  
  18. local attacker = Instance.new('StringValue')
  19. attacker.Name = 'Attacker'
  20. attacker.Parent = bullet
  21. attacker.Value = player.Name
  22.  
  23. local speed = 800
  24.  
  25. bullet.CFrame = CFrame.new(gunPos, mosPos)
  26. bullet.Velocity = bullet.CFrame.lookVector * speed
  27. game:GetService("Debris"):AddItem(bullet, 1000/speed)
  28. game:GetService("Debris"):AddItem(smoke, 1)
  29. game:GetService("Debris"):AddItem(fire, 0.2)
  30. end)
  31.  
Add Comment
Please, Sign In to add comment