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

script wont update colors?

Asked by 3 years ago
Edited 3 years ago

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

0
found out that the problem most likly is int value detection, still cant find anything that works tho steel_apples 58 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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

0
i never knew Colore.fromRgb() existed and also, i posted here bc i couldnt find out, also what wiki are you talking about? steel_apples 58 — 3y
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. AlexanderYar 788 — 3y
Ad

Answer this question