Having problems with RemoteEvents

I was working on a project and came across this issue. I have never came across the issue before and I just think that this is just a silly mistake in one of my scripts. I will send screenshots of all the scripts and problems. Also, this is for an inventory system.

When I try to fire a remote event from a local script, the server script won’t pick it up. Is this because I put a lot of parameters?

Here is the local script which fires the remote event:
https://gyazo.com/de83375f06bf195ec68d421924066638

Here is the server script which needs to pick up the remote event:
https://gyazo.com/0fe1c12bb19f94beb71811ef4a255ca1

Here is the remote event in replicated storage:
https://gyazo.com/ebf97cb450ad412bcaf9146d25b143a9

Thanks, softdevv. If you need more of an explanation, just ask me because I know I’m a bit brief sometimes.

i just replied to someone that did this same thing. when you fire that EquipRemote, you dont need to send over the player, the remote event will already have the player as the first parameter, so the server would see it like this

game.ReplicatedStorage.EquipRemote.OnServerEvent:Connect(function(PlayerThatFiredTheRemote,PlayerSentOver,class,weapon,Equipped)

end)

understand?

So I’m guessing the code from the server should look like this?

game.ReplicatedStorage.EquipRemote.OnServerEvent:Connect(function(class, weapon, Equipped)

no, the code would be like this

game.ReplicatedStorage.EquipRemote.OnServerEvent:Connect(function(Player,class, weapon, Equipped)

because like i said the remote event will already know what player fired the remote

1 Like

I just tested and it is possible to send and receive 11 parameters of data + receiving the player on the server, of course. It would for sure be able to send or receive even more parameters of data.

As I can see, you have fewer parameters than what I tested which will most definitely work in your scenario. You sending four parameters of data is probably not a problem. The problem might be that you are sending incorrect data / receiving it incorrectly or maybe even handling the main statements/functions incorrectly.

If you are interested to see how I tested the 11 parameters which were successfully received and printed:

Client:

local Event = game.ReplicatedStorage.RemoteEvent

script.Parent.Parent.TextButton.MouseButton1Click:Connect(function()
	local One = 1
	local Two = "Test"
	local Three = 0.123
	local Four = "Roblox is an epic game for epic people!"
	local Five = "Hey, this player sent this parameter of data. LOL."
	local Six = 49
	local Seven = true
	local Eight = false
	local Nine = "Those BoolValues worked."
	local Ten = "Mhmmm."
	local Eleven = "I'd say this works perfectly fine."
	Event:FireServer(One, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Eleven)
end)

Server:

local Event = game.ReplicatedStorage.RemoteEvent

local function Test(Player, One, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Eleven)
	print(Player.Name)
	print(tostring(One))
	print(Two)
	print(tostring(Three))
	print(Four)
	print(Five)
	print(tostring(Six))
	print(Seven)
	print(Eight)
	print(Nine)
	print(Ten)
	print(Eleven)
end

Event.OnServerEvent:Connect(Test)

If you want you could use a little bit of a hack like this, it allows infinite arguments as far as I’m sure.

Event.OnServerEvent:Connect(function(...)
    local Arguments = {...}
    local Player = Arguments[1]
    table.remove(Arguments, 1)
    -- Any other code here
end)
2 Likes

Where are these two scripts?

30chars