hey, I am attempting to use remote functions, but they are not working. Here is my code:
--//SERVER CODE\\--
local DoubleConnection = game.ReplicatedStorage.DoubleConnection
DoubleConnection.OnServerInvoke = function(Plr, ParamTable)
print("h")
return true
end
--//CLIENT CODE\\--
local DoubleConnection = game.ReplicatedStorage.DoubleConnection
print("g")
local Value = DoubleConnection:InvokeServer({"j"})
the script prints “g” locally, and then does nothing else. I am unsure what I am doing wrong, please help.
My first thought was that maybe the client invokes the server before the server even has any time to hook the function to the remote function. This is specially true if you’re doing this in studio. Wait a few seconds before invoking the server, if it works after that then you need to give the server time to load.
I think this was it, now that I look back the server side of the function seems to be placed after a while loop. Im a little embarrassed I didn’t catch this sooner, but thanks anyways!