-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWatcherScript.js
More file actions
42 lines (35 loc) · 1.03 KB
/
Copy pathWatcherScript.js
File metadata and controls
42 lines (35 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
NOT USED ATM!
*/
function WatcherScript(entity, comp){
this.me = entity;
frame.Updated.connect(this, this.Update);
this.players = 0;
}
WatcherScript.prototype.AddLocalComponents = function(){
var Players = scene.GetEntitiesWithComponent('EC_Script', 'Player');
if(Players.length > this.players){
for(i in Players){
if (Players[i].dynamiccomponent.GetAttribute('Team') == 'Taistelutoverit') {
print('everhere');
var nameTag = Players[i].CreateComponent("EC_HoveringText", 2, true);
nameTag.text = Players[i].Name();
var pos = nameTag.position;
pos.y = 1.3;
nameTag.position = pos;
nameTag.fontSize = 65;
var color = new Color(0, 0, 128, 0.6);
nameTag.backgroundColor = color;
var font_color = new Color(192, 192, 192, 0.6);
nameTag.fontColor = font_color;
this.players = Players.length;
frame.Updated.connect(this, this.Update);
}
}
}
}
WatcherScript.prototype.Update = function(frametime) {
if (server.IsRunning()){
this.AddLocalComponents();
}
}