Hi, I have this script located inside a textlabel, inside a gui.
Main = script.Parent
function FindContent(Directory,ContentName) -- helps wait for content
local Found = nil
repeat wait() Found = Directory:FindFirstChild(ContentName)
until Found
print("Found Content "..tostring(Directory))
return Found
end
local PrimaryFolder = workspace.Scripts:FindFirstChild("Secondary")
if PrimaryFolder then
local ServerMessage = FindContent(PrimaryFolder,"ClientMessage")
if ServerMessage then
ServerMessage.OnClientEvent:connect(function(TexttoDisplay)
if TexttoDisplay then
Main.Text = TexttoDisplay -- changes the text for the client.
end
end)
end
end
And is called upon by other scripts by...
Main = script.Parent
math.randomseed(os.time())
ClientMessage = (Main:FindFirstChild("ClientMessage") or Instance.new("RemoteEvent",Main));ClientMessage.Name = "ClientMessage"
ClientMessage:FireAllClients("hi")
How would I go about in turning this into a local gui rather than one everyone can see?
