-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGani
49 lines (40 loc) · 1.5 KB
/
Gani
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
local player = game.Players.LocalPlayer
local gunName = "gani gun"
local tool = Instance.new("Tool")
tool.Name = gunName
tool.RequiresHandle = false
local function killCharacter(character)
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health = 0
humanoid:ChangeState(Enum.HumanoidStateType.Dead)
end
end
local function fireGun()
local mouse = player:GetMouse()
local bullet = Instance.new("Part")
bullet.Size = Vector3.new(0.5, 0.5, 0.5) -- زيادة حجم الرصاصة لتكون مرئية أكثر
bullet.BrickColor = BrickColor.new("Bright blue")
bullet.Material = Enum.Material.Neon
bullet.Anchored = false
bullet.CanCollide = false
local torso = player.Character:FindFirstChild("Torso") or player.Character:FindFirstChild("UpperTorso")
if torso then
bullet.CFrame = CFrame.new(torso.Position, mouse.Hit.p) -- تحديد الاتجاه بناءً على الماوس والترس
bullet.Velocity = (mouse.Hit.p - torso.Position).unit * 300 -- زيادة سرعة الرصاصة
bullet.Parent = workspace
game:GetService("RunService").Stepped:Connect(function()
bullet.CFrame = bullet.CFrame + bullet.Velocity / 60 -- حركة مستمرة للرصاصة مع تحديث موقعها
end)
bullet.Touched:Connect(function(hit)
local character = hit.Parent
if character and character:IsA("Model") and character ~= player.Character then
killCharacter(character)
bullet:Destroy()
end
end)
game.Debris:AddItem(bullet, 10)
end
end
tool.Activated:Connect(fireGun)
tool.Parent = player.Backpack