-
i’m trying to make a fireball basically where when clicked say a wall the ball will move where the mouse is aiming at basically.
-
everytime i try changing the speed of the ball it makes the ball move upwards while also affecting the speed also the mouse aiming part doesn’t work correctly?
-
i tried looking it up on youtube and even when done right it still had same issue asked gpt for help cause why not, but still pointless, gpt is really bad at lua honestly and i tried changing the vector tried changing the objectClone.CFrame = player.Character.HumanoidRootPart.CFrame + Vector3.new(-2, -2, -2) to instead of vector3 tried using the mouse but still nothing i fr tried using mouse in multiple ways and i can’t figure it out.
local event = script.Parent:WaitForChild("Event")
local object = game:GetService("ReplicatedStorage").Object:FindFirstChild("ball")
event.OnServerEvent:Connect(function(player, mouse)
local character = script.Parent.Parent
local objectClone = object:Clone()
objectClone.Parent = workspace
objectClone.CFrame = player.Character.HumanoidRootPart.CFrame + Vector3.new(-2, -2, -2)
local bodyVelocity = Instance.new("BodyVelocity")
bodyVelocity.Velocity = Vector3.new(20,20,20) -- Adjust the speed as needed
bodyVelocity.MaxForce = Vector3.new(10000, 10000, 10000) -- Adjust the force as needed
bodyVelocity.Parent = objectClone
task.wait(6)
objectClone:Destroy()
end)