Here it prints nil, in the server script.
game.ReplicatedStorage.getFile.OnServerEvent:Connect(function(player, fileName, code)
local fileContent = getPersonalFile(player, fileName)
print(code)
game.ReplicatedStorage.getFile:FireClient(player, fileName, fileContent, code)
end)
Here’s the local script that sends it:
local function on2Click()
game.ReplicatedStorage.removeFile:FireServer(script.Parent.Name, "Code1")
end
button.MouseButton1Click:Connect(onClick)
button.MouseButton2Click:Connect(on2Click)
game.ReplicatedStorage.getFile.OnClientEvent:Connect(function(filename, content, codeb)
print("Test1")
print(codeb)
if codeb == "Code1" then
print("test2")
script.Parent.Parent.Parent.WordProcessor.Bar.Title.Text = tostring(filename)
script.Parent.Parent.Parent.WordProcessor.TextPage.Text = tostring(content)
print("test3")
end
end)
It still returns nil when I try to print the code in the server script and the local script.
I’m not sure what’s going on.