Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to use InvokeClient for this type of project?

Howdy,

So I am going to be making this game which I was to have FE. If I was to use Invoke client, how would i go about doing this.

I want to be able to change the text of a gui with FE enabled. Would I use InvokeClient? If so, how would I do that? Can someone please post an example.

  • I am not asking for a request but for some guidance *

Thanks

1 answer

✓ Accepted answer

You would use RemoteEvents and FireClient. Try to avoid InvokeClient as clients cannot be trusted.

On the server you would have a variable directed to the relevant RemoteEvent, not a RemoteFunction as you won't be using that for this.

local remote = game.ReplicatedStorage:WaitForChild("RemoteEvent")

then once you want to change the text of a gui of a specific player you do:

remote:FireClient(plr, "hello world!")

and receive it on the client:

local remote = game.ReplicatedStorage:WaitForChild("RemoteEvent")

remote.OnClientEvent:connect(function(txt)
	GUIObject.Text = txt 
end)

If you want to have the GUI change on all players you'd simply use FireAllClients

1 comment

0

Ahh, thank you. I recall learning about this a few months back. Thank you for refreshing me.

This discussion is preserved as it was. New answers, comments, and votes are closed.