So i've been working on a game where a player is randomyl assigned a GUI whenever they fire a RemoteEvent. I changed this RemoteEvent to RemoteFunction because I wanted to be able to save the data of whatever GUI they are assigned. Simple enough. I just don't understand how to change the script for it being a RemoteFunction rather than event.
`` game.ReplicatedStorage.RemoteFunction4.OnServerInvoke(function(player)
local Item1 = game.Lighting.ScreenGui1
local Item2 = game.Lighting.ScreenGui2
local Items = {Item1, Item2}
local SpawnItem = Items[math.random(1,2)]
SpawnItem:clone().Parent = player.PlayerGui
end) ``
I keep getting the error: OnServerInvoke is a callback member of RemoteFunction; you can only set the callback value, get is not available -

2 comments
Okay so, I put return true into my server and it still returns a callback error.
Return true is an example. Forgot to mention it.