I was trying to Fire an Event to the local player, but it was supposed to show a GUI to the certain player, but for some reason nothing happened. So do I write it like this:
KillGui:FireClient()
or like this:
KillGui:FireClient(plr)
or another way?
I was trying to Fire an Event to the local player, but it was supposed to show a GUI to the certain player, but for some reason nothing happened. So do I write it like this:
KillGui:FireClient()
or like this:
KillGui:FireClient(plr)
or another way?
You need to pass a player instance as the first parameter of FireClient, and then afterwards any arguments the event may need
I’m sorry, but I don’t understand what any of that means. I’m still new to scripting
just use :FireAllClients() its way eaiser and you can use it in one script, just be sure when you do OnClientEvent don’t put the player in the 1st Argument
Basically do it how you did in the 2nd example, passing a plr in the FireClient
FireAllClients won’t do how OP wants, they want to show a gui to a specific player, FireAllClients would show it to everyone
Try this:
Server Script
ReplicatedStorage.RemoteEvent:FireClient(Player, "Hello")
Local Script
ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(Text)
print(Text) --Show your GUI here
end)
You can also look on here for more information: RemoteEvent | Documentation - Roblox Creator Hub
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.