Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Why wont this text change script work? (SOLVED)

Asked by 10 years ago

Any help? like if its supposed to be something like NewText or something?

while true do
s= game.StarterGui.rules.text.Text 
wait(2)
s = "Welcome to Bubbaman73's EBT hangout :D"
wait(2)
s= "At all times follow these rules..."
wait(2)
s= "Dont Bully,"
wait(2)
s = "Dont Be innapropriate or use innaprpriate words,"
wait(2)
s = " Dont troll,"
wait(2)
s = "Dont Exploit,"
wait(2)
s = "Get along with EVERYONE that enters,"
wait(2)
s = "Be fair"
wait(2)
s = "Dont mess up the music"
wait(2)
s = "Any violation of these rules will get you..."
wait(2)
s = "ban"
wait(2)
s = "kick"
wait(2)
s = "or 3 warnings then kick"
wait(2)
s = "But most importantly, have fun! :D"
wait(2)
s = "Also this loops so if you missed rules you can read them."
wait(2)
end

1 answer

Log in to vote
1
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

Properties are case sensitive. The Text property is capitalized.


In this snippet, you repeatedly modify the variable s.

However, that only modifies the variable s.


You must explicitly modify game.StarterGui.rules.Text -- your assignment on line two sets s to the value of the Text.

It does not some how "link" the two together. It just sets s to some string.

To shorten it, we can do something like

L = game.StarterGui.rules
-- ...
L.Text = "Blah"

However, this code will only modify the StarterGui copy of the GUI. That means that players that join in the interim will get this message, but it will not update.

In order for that to work -- search ScriptingHelpers, the question has been asked. You can either loop through each player's GUI, or have each GUI look for the message contents elsewhere (an okay place would be the StarterGui)

Ad

Answer this question