hello yall
ive made a script to shoot fireballs. The fireballs shoot though they only shoot in one direction, even though I want it to shoto whereever the player is facing. The script is located in a tool (its local), and there are no errors in the output.
local tool = script.Parent
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local root = character:WaitForChild("HumanoidRootPart")
function OnActivation()
print('Activation works')
local ball = Instance.new("Part")
ball.Shape = Enum.PartType.Ball
ball.Color = Color3.new(1, 0.333333, 0)
ball.Size = Vector3.new(.1,.1,.1)
local fire = Instance.new("Fire")
fire.Parent = ball
ball.Parent = root
local newCFrame = CFrame.new(root.Position)
ball.CFrame = newCFrame
local Velocity = Instance.new("BodyVelocity")
Velocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
Velocity.Velocity = ball.CFrame.lookVector * 30
Velocity.Parent = ball
end
tool.Activated:Connect(OnActivation)
I found the issue, set the rotation of the ball to where you want it to face, in this case, set it to the tool rotation, if you need to adjust it tell me
Nevermind, I thought you set the position, and not the rotation, but you set the cframe.
You might wanna look into remote events to make it so other players can also see the fireball
Edit: you also need a debounce because if you use an autoclicker it can lag your game pretty hard, especially because they dont travel very fast and they dont “die”