-
What do you want to achieve?
For the bullet to slowly go down overtime. -
What is the issue?
It goes directly down way faster then it should even be possible. -
What solutions have you tried so far?
There isn’t documentation on how VectorForce interacts with things like this.
-- The Bulletdrop part
coroutine.wrap(function()
while Hit == false do
Gun.MusketBall.Position =- Vector3.new(0.001)
task.wait(0.05)
end
end)()
Full Code
local MainModule = {}
function MainModule.Fire(Gun)
local PlayersService = game:GetService("Players")
local ReplicatedStorageService = game:GetService("ReplicatedStorage")
local Hit = false
Gun.MusketBall.Anchored = false
Gun.MusketBall.LinearVelocity.VectorVelocity = Gun.Union.CFrame.RightVector * 5
Gun.MusketBall.LinearVelocity.Enabled = true
coroutine.wrap(function()
while Hit == false do
Gun.MusketBall.Position =- Vector3.new(0.001)
task.wait(0.05)
end
end)()
local functionCreate = Gun.MusketBall.Touched:Connect(function(otherPart)
if Hit == false then
print(otherPart)
Hit = true
Gun.MusketBall.Anchored = true
if otherPart.Parent:FindFirstChild("Humanoid") then
otherPart.Parent.Humanoid:TakeDamage(1000)
ReplicatedStorageService.MusketBallHit:FireAllClients(Gun, "HitFlesh")
task.wait(4)
if Gun:FindFirstChild("MusketBall") then
Gun.MusketBall:Destroy()
end
elseif otherPart.Material == Enum.Material.Metal then
ReplicatedStorageService.MusketBallHit:FireAllClients(Gun, "HitMetal")
task.wait(4)
if Gun:FindFirstChild("MusketBall") then
Gun.MusketBall:Destroy()
end
end
end
end)
end
function MainModule.Reload(Gun)
local Clone = Gun.Duplication.MusketBall:Clone()
Clone.Parent = Gun
Clone.CanQuery = true
Clone.CanTouch = true
Clone.Transparency = 0
end
return MainModule