function onPlayerJoin(player) {
ServerUI.Init(player);
ServerUI.Build(player, "myLabel", function() {
local screenSize = GUI.GetScreenSize();
local me = World.FindLocalPlayer();
return GUILabel(
VectorScreen(screenSize.X * 0.005, screenSize.Y * 0.96),
Colour(255, 255, 255, 255),
format("Hey, %s. Welcome to the server!", me.Name)
);
}, function(ui) {
ui.FontName = "Verdana";
ui.FontSize = 36;
ui.FontFlags = GUI_FFLAG_BOLD;
ui.TextAlignment = GUI_ALIGN_RIGHT;
ui.TextColour = Colour(50, 205, 50, 255);
});
}ServerUI <- {
table = GetRemoteValue("getroottable")()
consttable = GetRemoteValue("getconsttable")()
function Init(player) {
RemoteExec(SetRemoteValue("clientUIMap", {}), player);
}
GUI = {
table = GetRemoteValue("getroottable")()
function GetMouseEnabled() {
return table.GUI.GetMouseEnabled();
}
function SetMouseEnabled(bool) {
return table.GUI.SetMouseEnabled(bool);
}
function GetMousePos() {
return table.GUI.GetMousePos();
}
function GetScreenSize() {
return table.GUI.GetScreenSize();
}
function ScreenPosToWorld(vectorScreen) {
return table.GUI.ScreenPosToWorld(vectorScreen);
}
function WorldPosToScreen(pos) {
return table.GUI.WorldPosToScreen(pos);
}
function GetFocusedElement() {
return table.GUI.GetFocusedElement();
}
function SetFocusedElement(ui) {
return table.GUI.SetFocusedElement(ui);
}
}
World = {
table = GetRemoteValue("getroottable")()
function FindLocalPlayer() {
return table.World.FindLocalPlayer();
}
}
function VectorScreen(x, y) {
return table.VectorScreen(x, y);
}
function Colour(r, g, b, a) {
return table.Colour(r, g, b, a);
}
function GUILabel(pos, color, string) {
return table.GUILabel(pos, color, string);
}
function format(string, ...) {
local c_format = GetRemoteValueEx(table, "format");
vargv.insert(0, this);
vargv.insert(1, c_format);
vargv.insert(2, table);
vargv.insert(3, string);
return CallRemoteFuncEx.acall(vargv);
}
function Build(player, key, func, setFunc) {
func.bindenv(this);
local ui = func();
local clientUIMap = GetRemoteValue("clientUIMap");
RemoteExec(SetRemoteValueEx(clientUIMap, key, ui), player);
local uiProp = {};
uiProp.setdelegate({
data = {}
_set = function(key, value) {
data[key] <- value;
}
_get = function(key) {
if (key in data) {
return data[key];
}
return null;
}
});
setFunc.acall([this, uiProp]);
local myUI = GetRemoteValueEx(clientUIMap, key);
foreach (key, value in uiProp.data) {
RemoteExec(SetRemoteValueEx(myUI, key, value), player);
}
}
}
ServerUI.GUI_FFLAG_BOLD <- ServerUI.consttable.GUI_FFLAG_BOLD
ServerUI.GUI_ALIGN_RIGHT <- ServerUI.consttable.GUI_ALIGN_RIGHTQuote from: AdTec_224 on Mar 15, 2021, 07:18 PMHello everyone"I am writing to sincerely apologize for my actions on the Rob and Cop server. I value this community and realize I broke the rules. I promise to play fairly and follow all server protocols moving forward. Please consider giving me a final chance my username is BOSSNERON in game
Today I am pleased to announce the grand opening of our official Discord channel! This has been created in an attempt to unite the community in one place, in the hopes to help grow and improve the community as a whole. In this server users are free to chat with one another, seek help with client issues or scripting problems, share memories and funny moments in our pics and vids channel and so much more!
To join our discord server, use the link below:
https://discord.gg/mnTpR8pecJ
Please remember this discord server is a work in progress and certain channels/features are incomplete and/or subject to change.
Big thanks to PunkNoodle and everyone else who helped make this server possible!
"I am writing to sincerely apologize for my actions on the Rob and Cop server. I value this community and realize I broke the rules. I promise to play fairly and follow all server protocols moving forward. Please consider giving me a final chance
Quote from: AdTec_224 on Mar 15, 2021, 07:18 PMHello everyone
Today I am pleased to announce the grand opening of our official Discord channel! This has been created in an attempt to unite the community in one place, in the hopes to help grow and improve the community as a whole. In this server users are free to chat with one another, seek help with client issues or scripting problems, share memories and funny moments in our pics and vids channel and so much more!
To join our discord server, use the link below:
https://discord.gg/mnTpR8pecJ
Please remember this discord server is a work in progress and certain channels/features are incomplete and/or subject to change.
Big thanks to PunkNoodle and everyone else who helped make this server possible!