i tried to invoke a remote function by typing this into a server script:
"player.PlayerGui.ScreenGui.trade.tradeCarer.traderName:InvokeClient(player)"
, and i wrote this in the right local script:
"script.traderName.OnClientInvoke:Connect(function()
return script.Parent.playerName.Text
end)"
but i got this error:
"OnClientInvoke is a callback member of RemoteFunction; you can only set the callback value, get is not available"
, does anyone know why?, i looked it up on google but i couldn't find anything
for remote functions you have to write functions instead of connecting events to functions, so your code should have been
1 | function script.traderName.OnClientInvoke() |
2 | return script.Parent.playerName.Text |
3 | end |
other than that the code looks fine as far as I can tell