I've never used Remote Function and this script isn't working script in SSS
game.Players.PlayerAdded:Connect(function() game:GetService("ReplicatedStorage").fui:InvokeClient() end)
local script in startergui
local function gi() script.Parent.Text = "AAAAAAAAAAAAAA" end game:GetService("ReplicatedStorage").fui.OnClientInvoke = gi
this probably looks terrible
client
to invoke to. The first argument to RemoteFunction:InvokeClient()
is the Player
object for the server to invoke. Without it, how will the server know which client? You also should use RemoteEvent
s for those things, as RemoteFunction
s are for two way communication and for returning things. You weren't returning anything.game:GetService("Players").PlayerAdded:Connect(function(plr) -- passes player parameter game:GetService("ReplicatedStorage").fui:FireClient(plr) -- player to fire to end)
-- I have changed from a RemoteFunction to a RemoteEvent! local function gi() script.Parent.Text = "AAAAAAAAAAAAAA" end game:GetService("ReplicatedStorage").fui.OnClientEvent:Connect(gi)