File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {
2+ "type" : " FUNCTION" ,
3+ "color" : [
4+ 200 ,
5+ 100 ,
6+ 50
7+ ],
8+ "title" : " BrickColor New" ,
9+ "inputs" : {
10+ "colorName" : {
11+ "defaultValue" : " Bright red"
12+ }
13+ },
14+ "outputs" : [
15+ " brickColor"
16+ ]
17+ }
Original file line number Diff line number Diff line change 1+ {
2+ "type" : " FUNCTION" ,
3+ "color" : [
4+ 200 ,
5+ 100 ,
6+ 50
7+ ],
8+ "title" : " BrickColor Random" ,
9+ "inputs" : {},
10+ "outputs" : [
11+ " brickColor"
12+ ]
13+ }
Original file line number Diff line number Diff line change 1+ from typing import Optional
2+ from src .Node import Node
3+
4+ class BrickColorNew (Node ):
5+ def __init__ (self ) -> None :
6+ super ().__init__ ("nodes/brickcolor/brickcolornew.json" )
7+
8+ def toLuau (self ) -> Optional [str ]:
9+ color_name = self .getInputValue ("colorName" ) or "Bright red"
10+
11+ color_name_formatted = f'"{ color_name } "'
12+
13+ r = f'BrickColor.new({ color_name_formatted } )'
14+
15+ self .setOutputValue ("brickColor" , r )
Original file line number Diff line number Diff line change 1+ from typing import Optional
2+ from src .Node import Node
3+
4+ class BrickColorRandom (Node ):
5+ def __init__ (self ) -> None :
6+ super ().__init__ ("nodes/brickcolor/brickcolorrandom.json" )
7+
8+ def toLuau (self ) -> Optional [str ]:
9+ r = 'BrickColor.random()'
10+
11+ self .setOutputValue ("brickColor" , r )
You can’t perform that action at this time.
0 commit comments