Hello, I’m trying to make a rockthrow move, and I made the script and just uploaded the animation but the rock goes UP this with the animation, but goes straight (the desired direction) without the animation
what direction it should go:
https://i.gyazo.com/86214478955cb812d801b1d3db94c365.mp4
what direction it actually goes
https://gyazo.com/18070ad10d2f09ea50fd2e0af6d1f189
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
_G.aijdsfaisd = plr.Name
ws = plr.Character.Humanoid.WalkSpeed
rock = game.ReplicatedStorage.TOOLS.Rock:Clone()
char = plr.Character
animation = char.Humanoid:LoadAnimation(script.Animation)
animation:Play()
plr.Character.Humanoid.WalkSpeed = 1
wait(.1)
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)
dmg = script.dmg:Clone()
dmg.Parent = rock
dmg.Disabled = false
repeat
print(r)
r = r + 1
wait(.03)
rock.CFrame = rock.CFrame * CFrame.new(0,-.8,-1.2)
until r == 9
rock.Anchored = false
bv.Parent = rock
wait(.2)
char.Humanoid.WalkSpeed = ws
wait(2)
rock:Destroy()
db[plr] = true
end
end)
I tried deleting the bv and tried making it so the CFRame on the rock would just update every couple of milli seconds sgoing forward