My code is this, for the client:
game.ReplicatedStorage.Classes.Say.OnClientEvent:Connect(function(msg, from, inclass) -- I hope this works... - Toby for i = 1, #inclass do if i == game.Players.LocalPlayer.Name then local gui = game.ReplicatedStorage.InClass:Clone() gui.Frame.Message.Text = msg gui.Frame.From.Text = from gui.Parent = game.Players.LocalPlayer.PlayerGui wait(3) gui:Destroy() end end end)
And to fire, from the server, we do this:
local playerTable = {player.Name} game.ReplicatedStorage.Classes.Say:FireAllClients("Secret society doesn't work!", "Server Message!", playerTable) print(player.Name) print("This place hasn't been made!")
The prints, on the server script, fires. But the Gui doesn't pop up, and worse of all, there are no errors...
Thanks for reading this, I really hope that you can help me. - Toby
uh i think these
local playerTable = {player.Name} repeat wait(0.2) game.ReplicatedStorage.Classes.Say:FireServer("Secret society doesn't work!", "Server Message!", playerTable) until game.ReplicatedStorage.Classes.Say:FireServer("Secret society doesn't work!", "Server Message!", playerTable)
I found out that "i", on the local script, is a number, not a name. And I edited LocalPlayer.PlayerGui, to something else. So my local script should look like this:
game.ReplicatedStorage.Classes.Say.OnClientEvent:Connect(function(msg, from, inclass) -- I hope this works... - Toby for i = 1, #inclass do if inclass[i] == game.Players.LocalPlayer.Name then local gui = game.ReplicatedStorage.InClass:Clone() gui.Frame.Message.Text = msg gui.Frame.From.Text = from local localplayerName = game.Players.LocalPlayer.Name gui.Parent = game.Players:FindFirstChild(localplayerName).PlayerGui wait(3) gui:Destroy() end end end)
Thanks for reading this. - Toby