Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Fireball is not a valid member of ReplicatedStorage "ReplicatedStorage"?

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

0

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

1 answer

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.

2 comments

0

I think the fireball in the server storage is the actual part and the other fireball with the capital is the remoteevent. however it wasnt really clear from him

0

My knowledge for this question is only from what I've seen from him. We weren't really given a good explanation of where things are. But, I'm at least assuming that he confused ReplicatedStorage with ServerStorage.

This discussion is preserved as it was. New answers, comments, and votes are closed.