generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: simple script help?

Previous Thread :: Next Thread 
Kermit_Frog is not online. Kermit_Frog
Joined: 24 Feb 2016
Total Posts: 3347
11 Apr 2016 08:28 PM
I have a script that keeps changing the text to a random weapon name. I now added this script that should change the color of the text is a certain weapon. But it stays the same color the whole time?

local Text = script.Parent.Text
while wait() do
if Text == "M1911" or Text == "Auto Glock" or Text == "K5" then
script.Parent.TextColor3 = Color3.new(255, 255, 255)
end
end


- hi add 3k to post count
Report Abuse
cgjnm is not online. cgjnm
Joined: 22 Dec 2011
Total Posts: 2347
11 Apr 2016 08:30 PM
You're only changing to one color?

And I believe Color3 is on a 0-1 scale
Report Abuse
Kermit_Frog is not online. Kermit_Frog
Joined: 24 Feb 2016
Total Posts: 3347
11 Apr 2016 08:33 PM
Yes, my textlabel's text is red, and the text changes to mutiple names (including these names). But when they come up, the text stays red, and not white.


- hi add 3k to post count
Report Abuse
cgjnm is not online. cgjnm
Joined: 22 Dec 2011
Total Posts: 2347
11 Apr 2016 08:35 PM
Color3.new(1,1,1)?
Report Abuse
TheRBLXGuy is not online. TheRBLXGuy
Joined: 29 Jun 2012
Total Posts: 179
11 Apr 2016 08:58 PM
Why is scripting so difficult? Even when we get it right it still don't work
Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
11 Apr 2016 09:20 PM
Text.Changed:connect(function()
if Text == "Write" or Text == "Code" or Text == "Here" then
script.Parent.TextColor3 = Color3.new(255/255,255/255,255/255)
end
end)


sry if I messed up somewhere wrote this on mobile
Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
11 Apr 2016 09:21 PM
Basically the same as 1 I guess
Report Abuse
Kermit_Frog is not online. Kermit_Frog
Joined: 24 Feb 2016
Total Posts: 3347
11 Apr 2016 09:23 PM
error:
attempt to index field 'Changed' (a nil value)


- hi add 3k to post count
Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
11 Apr 2016 09:25 PM
umm just use while wait() do for now
imma sleep
Report Abuse
Kermit_Frog is not online. Kermit_Frog
Joined: 24 Feb 2016
Total Posts: 3347
11 Apr 2016 09:25 PM
But it doesnt work


- hi add 3k to post count
Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
11 Apr 2016 09:28 PM
Hmm that's weird. Try's using prints everywhere and find out where it stops. Then if you still don't get it you try searching that specific part like, "Why is my text color changing roblox" or something like that . Anyway I gtg
Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
11 Apr 2016 09:28 PM
The reason why is you are physically setting the variable to the property of the Text, so if the Text was 'Hello' and it changed the variable will stay the same.

Fixed code:
local Text = script.Parent
while wait() do
if Text.Text == "M1911" or Text.Text == "Auto Glock" or Text.Text == "K5" then
script.Parent.TextColor3 = Color3.new(255, 255, 255)
end
end
Report Abuse
Kermit_Frog is not online. Kermit_Frog
Joined: 24 Feb 2016
Total Posts: 3347
11 Apr 2016 09:28 PM
Fixed the Changed error, still didnt change the colors text


- hi add 3k to post count
Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
11 Apr 2016 09:29 PM
Did you do /255?
Report Abuse
Kermit_Frog is not online. Kermit_Frog
Joined: 24 Feb 2016
Total Posts: 3347
11 Apr 2016 09:29 PM
@Ty
It worked, thank you.

@everyone else
thanks for trying


- hi add 3k to post count
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image