Post: Menu Random Color Every Game
02-09-2016, 01:34 AM #1
KrazyKandy
I am error
(adsbygoogle = window.adsbygoogle || []).push({}); is there a way I can set it to where, everytime a new game starts the menu will have random colors
(adsbygoogle = window.adsbygoogle || []).push({});
02-09-2016, 03:03 AM #2
HiddenHour
I defeated!
Originally posted by KrazyKandy View Post
is there a way I can set it to where, everytime a new game starts the menu will have random colors


level.menuColor = (r value, g value, b value); Use vv that guys variable instead of mine to make it different for every client.
Mess with You must login or register to view this content.. Max value for color is 1, so change it by .1 - Don't use 255 for max with colors.

self iprintln(randomIntRange(1, 6)); will print a random number between 1 and 5.
02-09-2016, 03:05 AM #3
Codez1
Save Point
im not going to just give you a code but a hint would be
red = randomInt( 255 );
blue = randomInt( 255 );
green = randomInt( 255 );
or
self.menu.background.color = (RandomIntRange(0, 255), RandomIntRange(0, 255), RandomIntRange(0, 255));
02-09-2016, 03:06 AM #4
After You Created Menu And Before You Open It

    ChangeMenuColor()
{
self.menubackground.color = ((randomint(255)/255),(randomint(255)/255),(randomint(255)/255));
self.menuborders.color = ((randomint(255)/255),(randomint(255)/255),(randomint(255)/255));
}
02-09-2016, 03:21 AM #5
KrazyKandy
I am error
Originally posted by OfficialCoolJay View Post
After You Created Menu And Before You Open It

    ChangeMenuColor()
{
self.menubackground.color = ((randomint(255)/255),(randomint(255)/255),(randomint(255)/255));
self.menuborders.color = ((randomint(255)/255),(randomint(255)/255),(randomint(255)/255));
}


Could I do this?
    ChangeMenuColor()
{
self.menu.borderLeft.color = ((randomint(255)/255),(randomint(255)/255),(randomint(255)/255));
self.menu.borderRight.color = ((randomint(255)/255),(randomint(255)/255),(randomint(255)/255));
self.menu.bar.color = ((randomint(255)/255),(randomint(255)/255),(randomint(255)/255));
}


and put that as my hud?
    self.menu.bar = self createRectangle("RIGHT","RIGHT",30,-156,191,15,ChangeMenuColor(),"white",20,0);
02-09-2016, 03:47 AM #6
HiddenHour
I defeated!
Originally posted by KrazyKandy View Post
Could I do this?
    ChangeMenuColor()
{
self.menu.borderLeft.color = ((randomint(255)/255),(randomint(255)/255),(randomint(255)/255));
self.menu.borderRight.color = ((randomint(255)/255),(randomint(255)/255),(randomint(255)/255));
self.menu.bar.color = ((randomint(255)/255),(randomint(255)/255),(randomint(255)/255));
}


and put that as my hud?
    self.menu.bar = self createRectangle("RIGHT","RIGHT",30,-156,191,15,ChangeMenuColor(),"white",20,0);


First one should be fine. Second one should probably be -
    self.menu.bar = self createRectangle("RIGHT","RIGHT",30,-156,191,15,(randomInt(255)/255, randomInt(255)/255, randomInt(255)/255),"white",20,0);


Not sure if it works but if you wanted to call a function as your color like you did before, you could try calling
    randomColor()
{
return (randomInt(255)/255, randomInt(255)/255, randomInt(255)/255);
}

The following user thanked HiddenHour for this useful post:

OfficialCoolJay
02-09-2016, 04:00 AM #7
KrazyKandy
I am error
Originally posted by TheHiddenHour View Post
First one should be fine. Second one should probably be -
    self.menu.bar = self createRectangle("RIGHT","RIGHT",30,-156,191,15,(randomInt(255)/255, randomInt(255)/255, randomInt(255)/255),"white",20,0);


Not sure if it works but if you wanted to call a function as your color like you did before, you could try calling
    randomColor()
{
return (randomInt(255)/255, randomInt(255)/255, randomInt(255)/255);
}


The One I did before with my scrollbar and menu outlines all gave me 3 different colors, which is not really what I wanted, looks gross. Looking to get all3 the same. I'm trying this, not sure if it works

    ChangeMenuColor()
{
StoreShaders.color = ((randomint(255)/255),(randomint(255)/255),(randomint(255)/255));
}


Edit: Okay yea yours seems about right compared to mine.. lol I'll give that a go
02-09-2016, 04:00 AM #8
Originally posted by KrazyKandy View Post
Could I do this?
    ChangeMenuColor()
{
self.menu.borderLeft.color = ((randomint(255)/255),(randomint(255)/255),(randomint(255)/255));
self.menu.borderRight.color = ((randomint(255)/255),(randomint(255)/255),(randomint(255)/255));
self.menu.bar.color = ((randomint(255)/255),(randomint(255)/255),(randomint(255)/255));
}


and put that as my hud?
    self.menu.bar = self createRectangle("RIGHT","RIGHT",30,-156,191,15,ChangeMenuColor(),"white",20,0);


sorry wasnt thinking haha you can just include that when you actually create the menu, the way i showed you is if you want to do it after you made the menu later on, say if you want to have a option in your menu to change the color to a random color then you do that.

so if you want it on spawn
if you using a createrectangle or createtext function like that you take this here:

    ((randomint(255)/255),(randomint(255)/255),(randomint(255)/255))


and put into here

    self.menu.bar = self createRectangle("RIGHT","RIGHT",30,-156,191,15,[B]((randomint(255)/255),(randomint(255)/255),(randomint(255)/255))[/B],"white",20,0);


hope this helps
02-09-2016, 04:04 AM #9
say if your outline shaders are named:

    [B]self.menu.outline1
self.menu.outline2
self.menu.outline3[/B]


you do this:

    [B]outlinecolor[/B] = ((randomint(255)/255),(randomint(255)/255),(randomint(255)/255));
self.menu.outline1 = self createRectangle("RIGHT","RIGHT",30,-156,191,15,[B]outlinecolor[/B],"white",20,0);
self.menu.outline2 = self createRectangle("RIGHT","RIGHT",30,-156,191,15,[B]outlinecolor[/B],"white",20,0);
self.menu.outline3 = self createRectangle("RIGHT","RIGHT",30,-156,191,15,[B]outlinecolor[/B],"white",20,0);
02-09-2016, 04:05 AM #10
KrazyKandy
I am error
Originally posted by OfficialCoolJay View Post
say if your outline shaders are named:

    [B]self.menu.outline1
self.menu.outline2
self.menu.outline3[/B]


you do this:

    [B]outlinecolor[/B] = ((randomint(255)/255),(randomint(255)/255),(randomint(255)/255));
self.menu.outline1 = self createRectangle("RIGHT","RIGHT",30,-156,191,15,[B]outlinecolor[/B],"white",20,0);
self.menu.outline2 = self createRectangle("RIGHT","RIGHT",30,-156,191,15,[B]outlinecolor[/B],"white",20,0);
self.menu.outline3 = self createRectangle("RIGHT","RIGHT",30,-156,191,15,[B]outlinecolor[/B],"white",20,0);


Ahhhhhh, Thank you so much.. =)

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo