So instead of making hair red, it makes another image red. Is there a way to customly set the id of each image? Or should I just make a separate file for each hair colour?
Forum
CS2D Scripts How to use imagecolor for same img in diff roundsHow to use imagecolor for same img in diff rounds
1 reply 1
So instead of making hair red, it makes another image red. Is there a way to customly set the id of each image? Or should I just make a separate file for each hair colour?
NEVER use fixed IDs when working with images. It will go wrong as you noticed. Multiple objects in CS2D are sharing that ID-space so depending on what happens in the game the IDs can and will be different.
WRONG - that "1" (or any other fixed number) as ID is always bad.
1
2
2
image(....) imagecolor(1,255,0,0)
RIGHT - save & use the ID that image returns!
1
2
2
local id = image(....) imagecolor(id,255,0,0)
(of course you have to insert proper parameters for image instead of just "....")
1