I don't get this. Take a look:
I have a localscript named "Test" here it is:
local modules = game.Workspace["Module(s)"];
local chathandler = require(modules.ChatHandler);
local msg = ("I love icecream.");
chathandler.test(game.Players.LocalPlayer,msg);
I have a modulescript, here's how it looks in relation to that code:
function chathandler.test(player,msg)
chatAdd:FireServer(player,msg);
end
Now here's the RemoteEvent which should print the msg correctly:
chatAdd.OnServerEvent:connect(function(player,msg)
print(msg);
end)
What's going on? Why does it print the Player's name but not the msg itself? Is it not passed correctly?
EDIT (Update, just uses msg this time): Still doesn't work.
New localscript:
local modules = game.Workspace["Module(s)"];
local chathandler = require(modules.ChatHandler);
local msg = ("I love icecream.");
chathandler.test(msg);
Modulescript:
function chathandler.test(msg)
chatAdd:FireServer(msg);
end
RemoteEvent:
chatAdd.OnServerEvent:connect(function(msg)
print(msg);
end)

1 comment
Simple, concise, and easy to understand. +1 thanks to the above too.