RemoteEvent not mysteriously working?

Keeping it simple and clear. My remote event firing on the client keeps throwing an error in the output.

Capture

I won’t share all of my code since I know some people will probably steal it. But you will get the gist from this topic and down below for what I am gonna say.

  1. I indexed the player in the FireClient argument even in the client script.

  2. No typos in both the client and server script.

  3. I did everything correctly and it still errors with the specified error shown up top even printing the player’s name and folder’s name will throw the attempt to index “nil” error.

How would I fix this?

Where did the ChildAdded came from? Is that in the client script?

that is checking if something was inserted into the blood folder. And yes so that answers your question. Weird how it indexes nil even tho it isn’t suppose to do that.

If so then, like what the error message said “attempt to index nil with ‘ChildAdded’” meaning blood_folder is nil.

It isn’t nil in the server it’s created in the server and i’m getting it from the client by firing an remote event in the blood server script with the variables included in the FireClient argument.

If it’s not a nil, then it could be the OnClientEvent function. You might have included the player in the parameters.

bloodShakeFX.OnClientEvent:Connect(function(blood_folder)
    ...
end)

i did a print test earlier it printed perfectly when it fired.

I knew it, the player is included… refer to my last post.

Try adding :WaitForChild()
replicated_storage:WaitForChild(“blood_Events”):WaitForChild(“bloodShakeFX”):FireClient(player, blood_folder);
I had an issue with things showing up as nil until I added WaitForChild
worth a try

1 Like

Same error. Even with WaitForChild.

#30charrrrrrrrrrrrrrrrrrrrrrs

Try printing the value of blood_folder first, see if it’s giving any results.

That doesn’t do anything, the main issue is on the client not the server.


Also printing the player’s name will also index nil with the name. Strange enough.
(Printing the player’s name was before removing the player parameter from the client script.)

Hmm…

-- Server
-- assuming blood_folder is a type of instance
bloodShakeFX:FireClient(Player, blood_folder)
-- Client
bloodShakeFX.OnClientEvent:Connect(function(blood_folder)
    print(blood_folder) -- this should print something
end)

Trying this right now.

#30charrrrrrrrrrrrrrrrrrrrrrrs

Might sound stupid but


if blood_folder then
print(“yes”)
--put_stuff_here
else
print(“blood folder missing :(“)
local blood_foldernew = Instance.new(“Folder”)
blood_foldernew.Name = blood_folder
blood_folder.Parent = parent_path
end

or something along those lines

It just prints nil in the output.

How about on the server after firing to the client, print the blood_folder.