How the script is supposed to work: When the player presses q a part is spawned outside of their Torso/rootpart. Basically I want the parts velocity to change so it can fly upwards then downwards. The part only flys downwards and I dont know why
local fireball = game.ServerStorage:WaitForChild("Fireball")
game.ReplicatedStorage.Fireball.OnServerEvent:Connect(function(player,cframe)
local character = player.Character
local newFireball = fireball:Clone()
newFireball.CFrame = character.HumanoidRootPart.CFrame
local jump = Instance.new("BodyVelocity")
jump.Velocity = Vector3.new(0,20,0)
wait(2)
jump.Velocity = Vector3.new(0,-999,0)
jump.Parent = newFireball
newFireball.Parent = workspace
local touchconn
touchconn = newFireball.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Parent.Name ~= player.Name then
hit.Parent.Humanoid:TakeDamage(0.7)
wait(0.6)
if touchconn ~= nil then touchconn:Disconnect() end
newFireball:Destroy()
end
end
end)
wait(15)
if touchconn ~= nil then touchconn:Disconnect() end
newFireball:Destroy()
end)

1 comment
thanks!