Hi BuzzKillGT! It looks like this script could use some improvements. This question is also lacking some information, but I will do the best I can to help you out. :)
I noticed at the beginning of the script, you seem to be attempting to change a non-existent property.
local t = game.StarterGui.ChangeGUI.Text
It seems you are attempting to change a "ScreenGui's" property, although..
ScreenGui's do not have a text property. (Woops!) However, we can add a text label to the ScreenGui.
You can add the object manually, or insert the object using one of ROBLOX's built in functions called "Instance.new()"
Here is an edited version of your script with that function implemented.
local ui = game.StarterGui:WaitForChild("ChangeGUI")
local t = Instance.new("TextLabel", ui)
local weather = game.ServerStorage.zomApocalypseWeather
if t.Text "example" then weather.Parent = game.Lightning
if t.Text "example2" then weather.Parent = game.ServerStorage
end
There! Now we have some text in our gui. Although, it looks like this script still needs some improvements.
Your script has two if statements, and only 1 end. Your if statements also are a bit broken, and to be honest. You only need 1 if statement for this script. :b
Lets out this to work, i'll do my best to explain along the way, but here is a link that may help you in the future!
https://www.robloxdev.com/articles/Conditional-Statements-in-Lua
This link contains a lot of useful information, so please consider taking the time to read through it.
Now lets fix up this script.
local ui = game.StarterGui:WaitForChild("ChangeGUI")
local t = Instance.new("TextLabel", ui)
local weather = game.ServerStorage.zomApocalypseWeather
if t.Text == "example" then
weather.Parent = game.Lightning
elseif t.Text == "example2" then
weather.Parent = game.ServerStorage
end
This concludes my answer, I hope I helped! Let me know if you have anymore questions by commenting on this answer.
1 comment
You need to put 2 ends