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
I'm already seeing a few problems just from line one. In your title, you say that Fireball is part of ReplicatedStorage. But what I'm seeing is that you used ServerStorage in your script, or in your explorer. If it's in ServerStorage, move it to ReplicatedStorage, and change the script up.
Change the first two lines to this:
local fireball = game.ReplicatedStorage:WaitForChild("FireBall") fireball.OnServerEvent:Connect(function(player, CFrame)
If this didn't help, and you are still receiving errors, please don't hesitate to let me know in Community Chat, or this answers comment section.