Basically, I’ve made a settings gui where I can toggle a certain setting on and off.
When the client calls the “changeSetting” function, it prints to the output and invokes the remoteFunction,
but the server is not picking up the call.
Things to note:
1- There is only 1 remoteFunction named “SetSetting”
2- It is indeed a remoteFunction
3- The server already picks up that it exists.
4- The server is not picking up the invokeServer call
5- No errors are outputted
–ClientScript
local function changeSetting(str)
print(str) --Prints to the output
local success = game.ReplicatedStorage.Remotes.Functions.SetSetting:InvokeServer(str)
end
local function init()
changeSetting("Music")
end
--Script
init()
–Server
print(game.ReplicatedStorage.Remotes.Functions.SetSetting.ClassName)
--Outputs "RemoteFunction", so I know it exists
game.ReplicatedStorage.Remotes.Functions.SetSetting.OnServerInvoke = function(player, str)
print(player, str) -- Not printing anything at all
--local settingsStore = datastore2("Settings", player)
--local mySettings = settingsStore:Get()
--if mySettings[str] == nil then return end
--if mySettings ~= "AutoDelete" and typeof(mySettings[str]) == "boolean" then
-- mySettings[str] = not mySettings[str]
--end
--settingsStore:Set(mySettings)
end