Hello, I'm implementing a code system to my game but when I trigger my RemoteFunction and access it in the server it does nothing
Here are the scripts
Local script (pressing a Gui button)
local button = script.Parent
button.MouseButton1Click:Connect(function()
local event = game.ReplicatedStorage.CodeRemoteFunction
local inputCode = script.Parent.Parent.TextBox.Text
local result = event:InvokeServer(inputCode)
if result == "Accepted" then
inputCode = "Code succesfully redeemed!"
else
inputCode = "Code Invalid or already redeemed"
end
end)
Server Script
local codesModule = require(game.ServerScriptService.CodesModule)
game.ReplicatedStorage.CodeRemoteFunction.OnServerInvoke = function(player, input)
if codesModule[input] then
codesModule[input](player)
return "Accepted"
else
return "Rejected"
end
end

3 comments
Maybe try checking names of the RemoteEvents and other.
Check your module.
Put some prints in it, see where exactly it stops working. If there are any error those would help as well.