Idk how to do this. I tried this:
script.Parent.MouseButton1Click:Connect(function)
game.StarterGui.ScreenGui.TextLabel.Color = "Black"
game.StarterGui.ScreenGui.TextLabel.Font = "Cartoon"
But that didn't work. Can someone please help me?
Idk how to do this. I tried this:
script.Parent.MouseButton1Click:Connect(function)
game.StarterGui.ScreenGui.TextLabel.Color = "Black"
game.StarterGui.ScreenGui.TextLabel.Font = "Cartoon"
But that didn't work. Can someone please help me?
AstronomicalDialect to change Gui's text or font by using scripts is by:
for changing the color do this:
game.StarterGui.ScreenGui.TextLabel.BackgroundColor3 = Color3.fromRGB(insert the color3 value here)
and if you want to change the font do this:
game.StarterGui.ScreenGui.TextLabel.TextFont = Enum.TextFont.Cartoon
It doesn't work like that; Also Roblox Lua will throw many errors at you
Here is the answer:
First, you need to put a BoolValue in the ServerStorage (or anywhere) Then, Place a Part containing a ClickDetector. Next, you will have to write the script in a ServerScript inside the clickable part:
local Value = game.ServerStorage.Value
local function clicked() -- The function to exectue when clicked
Value.Value = true
end
script.Parent.ClickDetector.MouseClick:connect(clicked)
After, you write this in a LocalScript that is placed inside StarterPlayerScripts:
local Value = game.ServerStorage.Value
Value.Changed:connect(function()
_G.Gui.TextColor3 = Color3.fromRGB(0, 0, 0) -- (0, 0, 0) is black
_G.Gui.Font = Enum.Font.Cartoon
end)
Lastly, because without this script it will throw an error, write this in a LocalScript inside the ScreenGui:
_G.Gui = script.Parent.TextLabel -- Global Variable
There ya have it ;)
It's a little complex because of the way Roblox Lua throws errors at you, but it's good to know how it works!
Also if the you do not click a part, but a Gui button then please comment "Wrong Click" for me to explain that side, which is way easier :D
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
This will not work because the StarterGui only changes for the new incoming players. You need to get the player variable and then find the Gui that's parent is the player...