Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

script wont update colors?

i dont really know why it wont work, also i dont know how to make it detect if its less then 10 and not just 10. heres the script

if game.Workspace.Health == 10 then
	script.Parent.Heart.ImageColor3 = Color3.new(0.513725, 0, 0)
	wait(0.1)
end

Health is an int value that is the same as the players health, Heart is a image label

1 comment

0

found out that the problem most likly is int value detection, still cant find anything that works tho

1 answer

✓ Accepted answer

Four things. First, to check if a value is less than it's <, greater than is >, equal to is ==, greater than or equal to is >=, less than or equal to is <=. Second, why are you manually changing rgb to 0-1 scale?? Use Colore.fromRgb() it converts rgb to 0-1 for you! Like color3.fromRGB(255,255,255), which of course is converted to 1,1,1, both being white. Third, if it is a member of "ValueBase" which is basically any and every value instance including what your using, which is an invaluable, you gotta read the attribute not the instance. Workspacr.ValueName is the instance, the VALUE attribute of it is workspace.ValueName.Value. fourth of all, why did you post here? You could have found all this on the wiki, or forums, or articles. Please look through the internet thoroughly before asking here.

Anyway hope this helps :3

2 comments

0

i never knew Colore.fromRgb() existed and also, i posted here bc i couldnt find out, also what wiki are you talking about?

0

Sorry, when i said wiki, i meant just any site that has this information. My bad. Aslo llease remmebwr to accept this answer if this works for you.

This discussion is preserved as it was. New answers, comments, and votes are closed.