local tool = script.Parent
local throwable = tool.Handle -- Та часть, которая лететь будет(Да, кстати Handle не забудь в инструмент добавить)
tool.Enabled = true
tool.Activated:Connect(function()
local character = tool.Parent
local player = game.Players:GetPlayerFromCharacter(character)
if player then
local projectile = throwable:Clone()
projectile.CanCollide = true
projectile.Parent = workspace
-- Тут настройка позиции
local startPos = character.HumanoidRootPart.Position
local mouse = player:GetMouse()
projectile.CFrame = CFrame.new(startPos, Vector3.new(mouse.Hit.X, startPos.Y, mouse.Hit.Z))
-- Эт настройка запуска снаряда или че там у тебя будет
local velocity = 100 -- Скорость
local bodyVelocity = Instance.new("BodyVelocity")
bodyVelocity.Velocity = projectile.CFrame.LookVector * velocity
bodyVelocity.Parent = projectile
game.Debris:AddItem(projectile, 5)
projectile.Touched:Connect(function(hit)
if hit.Parent then
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid and hit.Parent ~= character then
-- Тут урон выбери сколько нужно
humanoid:TakeDamage(10)
projectile:Destroy()
end
end
end)
end
end)