addEventHandler("onResourceStart", getRootElement(), trig)
Ovaj getRootElement() će ti executati ovu funkciju kada se bilo koja skripta upali, da bi to spriječio koristi resourceRoot. Također, kickPlayer ne možeš koristiti na klijentu, outputChatBox na klijentu ne treba player argument (uvijek je localPlayer). Brzinski sam preletio, probaj ovo, ako ne radi, mora bar error izbaciti
GUIEditor = {
label = {}
}
login = guiCreateWindow(0.34, 0.23, 0.40, 0.30, "Unesite vasu lozinku da biste nastavili", true)
guiSetVisible(login, false)
guiWindowSetSizable(login, false)
pw1 = guiCreateEdit(111, 136, 176, 17, "", false, login)
guiSetProperty(pw1, "MaskText", "True")
guiEditSetMasked(pw1, true)
pw = guiCreateButton(108, 195, 43, 15, "Nastavi", false, login)
pw2 = guiCreateButton(244, 195, 43, 15, "Izlaz", false, login)
GUIEditor.label[1] = guiCreateLabel(412, 245, 318, 39, "Unesite vasu lozinku da biste nastavili registraciju", false)
guiLabelSetHorizontalAlign(GUIEditor.label[1], "left", true)
addEvent("pJoin", true)
addEventHandler("pJoin", root, function()
guiSetVisible(login, true)
guiSetVisible(pw1, true)
guiSetVisible(pw2, true)
guiSetVisible(pw, true)
guiSetVisible(GUIEditor.label[1], true)
otputConsole("Pjoin pozvan")
end
)
function ClickLeftBut(button, state)
if(button == "left" and state == "up") then
if(guiGetText(pw1) == nil or guiGetText(pw1) == '') then outputChatBox("Niste uneli pw", 231, 217, 176, false)
else
spawnPlayer(spawnX, spawnY, spawnZ)
setCameraTarget(getLocalPlayer())
outputChatBox("Welcome to My Server", getLocalPlayer())
end
end
end
addEventHandler("onPlayerGUIClick", ClickLeftBut)
function ClickRightBut(button, state)
if(button == "left" and state == "up")
then
guiSetVisible(login, false)
guiSetVisible(pw1, false)
guiSetVisible(pw2, false)
guiSetVisible(pw, false)
guiSetVisible(GUIEditor.label[1], false)
kickPlayer(getRootElement(), "Iskljucili ste registraciju")
end
end
addEventHandler("onPlayerGUIClick", ClickLeftBut)