Jump to content

.


DarkByte

Recommended Posts

Posted (edited)

.

Edited by Guest

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted (edited)

Why just don't you use the cases.

if var <= 25 then 
 color = {0, 125, 0} 
elseif var <= 50 and var > 25 then  
 color = {0, 150, 0}  
elseif var <= 75 and var > 50 then 
 color = {0, 175, 0} 
end 

Edited by Guest

"Keep making it simplex."

Posted

I want to make over 5 different values negative and positive colors, i have to write a lot of these...I know there is a simple way but i can't figure it out.

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted

Help?

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted

For every acl group there's a limit.

Player - 75

Moderator - 150

Super moderator - 300

Admin - 500

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted

Ok so whats wrong with your code?

When the points are 0, the color is white &when the points are 75 the color is fully green.

You just need to change tocolor(0,calc,0,255)

Right? Or what?

 

●●●

Rage Gaming Society

Coming Soon

●●●

Posted

This is what you're looking for:

local maxPoints = 75 
  
function onCmd(cmd, myPoints) 
    local color = (255 / maxPoints) * myPoints 
    local r,g,b = 255-color, 255, 255-color 
     
    outputChatBox("You have "..myPoints.." points.", r, g, b) 
end 
addCommandHandler("setPoints", onCmd, false) 
  

It goes from white to green. You can easily modify it and take the math to use it in your code.

I suppose it'll get a little more difficult if you want to go from say, purple to orange, but this is all I can do for you.

Why just don't you use the cases.

Because math.

Discord: its.tails

Posted
Ok so whats wrong with your code?

When the points are 0, the color is white &when the points are 75 the color is fully green.

You just need to change tocolor(0,calc,0,255)

Right? Or what?

Nope it's not what i want when it's 0 it's green and when it's 75 it's white.

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted
Ok so whats wrong with your code?

When the points are 0, the color is white &when the points are 75 the color is fully green.

You just need to change tocolor(0,calc,0,255)

Right? Or what?

Nope it's not what i want when it's 0 it's green and when it's 75 it's white.

@Tails - Thanks it's working now. :D

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted (edited)

.

Edited by Guest

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted

You're welcome. But like I said, it gets a bit more difficult with other colors than red, green and blue. It may involve different kind of maths if you want to keep everything short and simple. I can't really help you with it, because I know very little about maths. Hopefully you'll figure it out or someone is able to help you. Good luck. :)

Discord: its.tails

Posted

Admin - Purple - R,G,B - 183,0,255

Admin - White - R,G,B - 255,255,255

So at start, G should be 255 as well as R; to be white.

MaxPoints are 375;

The G should be 0 by the end and the R should be 183.

colorG = (255/maxPoints) * reputation

colorR = ((255 - 183) / maxPoints ) * reputation

tocolor(255 - colorR, 255 - colorG,255)

That would probably work.

It will start with white and end up with purple.

 

●●●

Rage Gaming Society

Coming Soon

●●●

Posted

And if that worked, you have probably understood the way you should do the rest of the colors.

 

●●●

Rage Gaming Society

Coming Soon

●●●

Posted

Thanks to all who helped me.

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...