What do you want to achieve? Keep it simple and clear!
I want to send a string and a number, in that order.
What is the issue? Include screenshots / videos if possible!
The event is firing from a local script, to a server-side module script. But everytime I fire it the first parameter (not player) always equals 1, and the second always equals nil. player still reaches it just fine, but any parameters after follow the pattern I mentioned.
Local Script
ItemDataEvent:FireServer("abc", 123);
Server-Side Module Script
local ItemDataEvent = script.ItemDataEvent.Value;
local Class = {};
Class.__index = Class;
function Class.new(player)
local self = setmetatable({}, Class);
self.ItemDataEvent = ItemDataEvent.OnServerEvent:Connect(function(player, string, number)
print(player);
print(string);
print(number);
end)
return self;
end
Output
0: DylanD319
1: 1
2: nil
I haven’t had any luck on finding cases similar, so here I am.
Maybe Module Scripts can’t connect RemoteEvent Parameters like Server Scripts? I don’t know. Any help would be greatly appreciated!
Edit: Just adding quick context for the module script if needed.
This is really weird behaviour i have never seen this before.
Could you make a rbxl (place file) that replicates this issue? It possibly could be an engine issue but probably not?.
I am not asking for the game by the way just make a blank place and try to replicate the issue and if you are not comfortable with doing so, you don’t need to.
Not sure, but shouldn’t the “string” parameter be conflicting with the built-in string library?
I’m guessing the Module is in ReplicatedStorage, right?
Was able to fix it. This did work correctly, but as I was working through recreating it I noticed that the references were using the wrong event. I named them in such a way that they are near identical at a quick glance so I must’ve missed it when I checked before posting.
It did seem like some really strange behavior cuz I swear I’ve done this in previous projects before, but ye it was just user error.