For some reason when im presing the key to fire the fireball nothing happens and this error appears in the output tab
here are my scripts
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 bodyVelocity = Instance.new("BodyVelocity")
bodyVelocity.MaxForce = Vector3.new(5000,5000,5000)
bodyVelocity.Velocity = (character.HumanoidRootPart.CFrame.lookVector*250)
bodyVelocity.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:BreakJoints()
if touchConn ~= nil then touchConn:Disconnect() end
newFireball:Destroy()
end
end
end)
wait(2)
if touchConn ~= nil then touchConn:Disconnect() end
newFireball:Destroy()
end)
local UserInputService = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait(1)
local debounce = false
UserInputService.InputBegan:Connect(function(Input , IsTyping)
if not IsTyping then
if not debounce then
debounce = true
if Input.KeyCode == Enum.KeyCode.E then
game.ReplicatedStorage.FireBall:FireServer()
end
wait(1)
debounce = false
end
end
end)
Im not very experienced with coding so i would really apreciate if someona can help me with this

1 comment
um, one question: did you put fireball inside replicatedstorage?