I have a question/problem about RemoteEvents
So I read the document for it and watched youtube tutorials but yet I couldn’t find an answer.
I want to know how I can make it so the server checks a RemoteEvent, and when it gets fired, it sends info to client and the client shows the GUI. Please help, I don’t got much experience
1 Like
What do you mean exactly? I think I could help since it sounds easy yet I can’t really tell what you mean
1 Like
Fire the remoteevent from the client, then make a script on server that detects it, then make that script fire the same event towards the client
What are you looking for?
Client → server → Same client? (If so, why do you need a remote event for this? If you are trying to do this then Bindable Events are the way to go)
or
Client → server → Different client/All Clients
1 Like
well, im talking about something like this
theres gonna be a GUI that when a remoteEvent gets fire, it will show up. but server fires the remoteEvent, not the client
Are you using FireAllClients()?
RemoteThatMakesGuiVisibleForEveryone:FireServer()
Funny remote:FireAllClients()
blah.OnClientEvent:Connect(function()
GUI.Visible = true
end)
thats the difficult part of explaining…
i need Server → Client without any other interference
no, only 1 person meant to see, not all
2 Likes
Use a second remote event, or the same one, but in a local script!
Remote Events allows for Client → Server and Server → Client Communication!
So if you use 2 different remove events, or the same one, and listen for .OnClientEvent and .OnServerEvent that should allows for both server and client communication for whatever you need!
Have you defined the player then? What player by the way lol
FireClient(player instance)
It’s called a three way handshake I believe
thats the problem… Client must not be able to fire this remoteevent, only server should be
Yes, so you would do
RemoteEvent:FireClient(Player)
--This has to be called on the server!
and in a local script do:
RemoteEvent.OnClientEvent:Connect(function()
The point I was attempting to make above is that Remote events aren’t just Client to server, they also work the other way around. Sorry if that seemed to confuse you^
I tried but it did not worked, there are no errors but GUI does not appear when I run the scripts
Where are you running the server and local script (their parents, example: server script is in ServerScriptService). What is your code in these scripts?
the server script is in the ServerScriptService, client is StarterGUI
Client
local RemoteEvent = game.ReplicatedStorage.GetCheck
RemoteEvent.OnClientEvent:Connect(function()
script.Parent.Check.Visible = true
end)
Server
local RemoteEvent = game.ReplicatedStorage.GetCheck
if script.Enabled == true then
RemoteEvent:FireClient(Player)
end
the remote events name is “GetCheck” and GUI is “Check”
You need to get a Player Instance here (Mention the client who you are firing to) do you have this? and/or more of this script? If not you need to mention the client you want to fire to, by mentioning the Player Instance (Aka. a Player founded in the Players Service where all the Player Instances live)
im not sure, its a bit complicated to understand what you said but the person that’s getting this signal from fired RemoteEvent is not a person with name, its like, it can be Anyone, but only 1 at a time
So you need to mention a player that is alive, and currently in game.
Like for example, if I wanted to fire it to myself always. My Player instance is at:
game.Players.OfficialPogCat
when I am in a server.
What excatly are you trying to do? Fire this to Everyone who is in the server one at a time? Get a random player and fire it to only them?
no so, an internal clock ticks in the server (you don’t have to worry about this part) and when it reaches to some time-point, its gonna fire a RemoteEvent to make a GUI visible to the person. its for something like a payment system
So do you have a Player Instance already (Or any Unique info to identify the person)? Or are you paying a random person? Or all People? I’m a tad confused lol