Tween.Completed:Connect(function(playbackState)
if playbackState == Enum.PlaybackState.Completed then
local character = player.Character
local hum = character:FindFirstChild("Humanoid")
fireball.Anchored = false
local bv = Instance.new("BodyVelocity", fireball)
bv.Velocity = CFrame.new(fireball.CFrame.Position, player:GetMouse().Hit.p).lookVector * 50
bv.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
hum.WalkSpeed = 16
hum.JumpPower = 50
elseif playbackState == Enum.PlaybackState.Cancelled then
local character = player.Character
local hum = character:FindFirstChild("Humanoid")
fireball.Anchored = false
local bv = Instance.new("BodyVelocity", fireball)
bv.Velocity = CFrame.new(fireball.CFrame.Position, player:GetMouse().Hit.p).lookVector * 50
bv.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
hum.WalkSpeed = 16
hum.JumpPower = 50
end
end)
what is wrong with the code, why does it let the tween be completed?
