Hello!
I am currently experiencing an issue where :InvokeServer() doesn’t work at all and I have no idea why. I am calling it to check and see whether the player can teleport to the next level or not (should return true or false) but doesn’t return anything, not even nil.
LocalScript:
local RS = game:GetService('ReplicatedStorage')
local RLU = RS.Functions:FindFirstChild('RequestLevelUpdate')
script.Parent.UpSmall.MouseButton1Click:Connect(function()
print('click') -- printed
local canUp = RLU:InvokeServer('US')
print(canUp) -- not printed
end)
ServerScript:
script.Parent.Parent.Functions.RequestLevelUpdate.OnServerInvoke = function(player, arg)
print('server rec')-- not printed
return(player:WaitForChild('CurrentLevel').Value + 1 <= player:WaitForChild('leaderstats'):WaitForChild('Level').Value)
end