I create a ball, i want to player hold it about 3 seconds then throw follow mouse. I use bodyvelocity but it not work when i add wait(3) in. The ball will fall down. This is my script :
game.ReplicatedStorage.Events.FireC.OnServerEvent:Connect(function(player,mousePos)
local dmg = 50
local character = player.Character
local cre = character.Name
local effects = game.ReplicatedStorage.Fire
local fireBall = effects.FireTichQuaCau:Clone()
fireBall.dmg.Value = dmg
fireBall.creator.Value = cre
fireBall.CFrame = character.HumanoidRootPart.CFrame + Vector3.new(0,50,0) --set position
fireBall.Anchored = true --anchored to wait 3 senconds
fireBall.Parent = workspace
local velocity = Instance.new("BodyVelocity", fireBall)
wait(3)
fireBall.Anchored = false -- false anchored to throw
velocity.Velocity = CFrame.new(fireBall.Position, mousePos).LookVector*100
end)

1 comment
I can do like that but when i add command wait(3). It does not work