Hello, I’m trying to make this script that puts a rock on top of the players head then goes down while going forward, and then adds a bodyvelocity to the rock that launches it forward; the problem with this is that when I unachor the rock and add the bodyvelocity theres a small delay that I do not want.
https://gyazo.com/86214478955cb812d801b1d3db94c365
the rock goes down and forward then pauses for a bit, then is launched forward. I’d like to get rid of the pause. What I’ve tried is making the bv before the rock goes forward and down and as soon as that ends parenting the bv to the rock, but that did not work.
local Players = game:GetService("Players")
local db = {}
Players.PlayerAdded:Connect(function(plr)
db[plr] = true
end)
Players.PlayerRemoving:Connect(function(plr)
db[plr] = nil
end)
script.Throw.OnServerEvent:Connect(function(plr)
if db[plr] == true then
db[plr] = false
ws = plr.Character.Humanoid.WalkSpeed
rock = game.ReplicatedStorage.TOOLS.Rock:Clone()
char = plr.Character
plr.Character.Humanoid.WalkSpeed = 1
wait(.5)
rock.CFrame = char.Head.CFrame * CFrame.new(0,3,0)
rock.Parent = game.Workspace
rock.CFrame = rock.CFrame * CFrame.new(0,.4,-0)
rock.Anchored = true
r = 0
bv = Instance.new("BodyVelocity")
bv.Velocity = char.Torso.CFrame.lookVector * 70
bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
repeat
print(r)
r = r + 1
wait(.03)
rock.CFrame = rock.CFrame * CFrame.new(0,-.4,-1.2)
until r == 9
rock.Anchored = false
bv.Parent = rock
wait(5)
db[plr] = true
end
end)