What remote Event do I need for these cases

Hello! So I’ve been reading about remote events and I’m a little confused on the whole server-client, client-server and so on. I need to use remote events for these 2 things I wan’t to code but I need help knowing which type of event(function or remote) and if its client-server, etc.

FYI I’m currently a beginner in scripting and am learning the more complicated concepts now.

These events both have to do with player gui*

The first thing is I need the players Gui to show an imageLabel once the player steps on a pad. This is the less important one but I would like to know for this as well.

The second(and important) one is for messaging the player. I already have a lot of the system made but now the only thing I need help with is how to use remote/function event to call the function in the message system from the workspace(and gui) as well as include 2 parameters(one is for the desc of the message, the other is for the title).

the message system is pretty straightforward. A little popup on the left side of the screen comes with a title and description text to tell the player something(like achievements and objectives). I’ve made a function in the script with the 2 parameters but I need to be able to call this function anywhere so when the player does something, it can alert them.

I don’t know if you need the message script so I won’t include it here, but please tell me if you do. It’s just that this is more me wanting to know how I would go about using events to do this.
Please feel free to ask questions to get a better idea of what I need.
Thanks!

1st: You don’t need a remote event for this since you can do client-client.
You can do a script for a Touched event and enable the gui via Playergui

local localplayer = game.Players.LocalPlayer
local gui= localplayer.PlayerGui.CHANGETHIS

2nd: Put a remote event in ReplicatedStorage and name it whatever you want. Reference it in both the gui script and the server script.

Then, in the server-script. Once the player achieved something you can use FireClient.

REMOTEEVENT:FireClient(PARAMETERS)

In your gui script, you want to fire your script whenever this remote event is fired, so do a OnClientEvent function.

REMOTEEVENT.OnClientEvent:Connect(function(PARAMETERS)
–do stuff–
end)

You can store the achievement string in the parameters.

Tell me if you have any questions.

1 Like

Oh ok. Would it be better to do remote events? Or is it ok to just to client-client. Thanks!

It is perfectly fine to do client-client.

1 Like

So it gives me the error “unable to cast to object” on the fireClient code. do you know why?

For the 1st one, you don’t need any remote events for client-client. Just get the PlayerGui and enable your gui.

Remote events can send data from client to server and vice versa.

Remote functions send data from one script to another on the same side. Aka server to server and client to client.

1 Like

Yeah this error is for the second one.

Can you send me the code and the line that this error is on.

Oh don’t worry its fixed now. Thank you for your help!(it was Player btw)