FilteringEnabled is on and I'm using RemoteFunctions for this. The argument MapString is a string taken apart from what someone chatted, however when I print it in the Local Script that is waiting to get called on, it's nil for some reason, why is this so?
- Server Script
local ClientFunction = Instance.new("RemoteFunction", game.Workspace)
ClientFunction.Name = "ClientFunction"
game.Players.PlayerAdded:connect(function(Plr)
Plr.Chatted:connect(function(Msg)
if string.sub(string.lower(Msg), 0, 9) == "computer " then
if string.sub(string.lower(Msg), 10, 14) == "load " then
if game.ReplicatedStorage:FindFirstChild(string.sub(string.lower(Msg), 15)) then
local MapString = string.sub(string.lower(Msg), 15)
ClientFunction:InvokeClient(Plr, MapString)
end
end
end
end)
end)
- Local Script (Client)
local ClientFunction = game.Workspace:WaitForChild("ClientFunction")
function ClientFunction:OnClientInvoke(MapName)
print(MapName)
end
- Answer bellow
Thanks to M39a9am3R's help, he pointed out that I used a : instead of a . for function ClientFunction:OnClientInvoke(MapName)

1 comment
Already said it was answered m8