Viudes Posted July 19, 2017 Share Posted July 19, 2017 (edited) Why my script not work?? function Ikkuna(resource) Musiikki = playSound("Musiikki.mp3") setSoundVolume(sound,1.0) showCursor (true) ikkuna = guiCreateWindow(0.34, 0.20, 0.20, 0.2,"Login",true) Nimi = guiCreateEdit( 0.3, 0.3, 0.6, 0.09, "", true, ikkuna) Salasana = guiCreateEdit( 0.3, 0.4, 0.6, 0.09, "", true, ikkuna) Nimi = guiSetText( 0.3, 0.4, 0.6, 0.09, "name:", true, ikkuna) loginbutton = guiCreateButton(0.2, 0.6, 0.3, 0.1, "Login", true,ikkuna) registerbutton = guiCreateButton(0.5, 0.6, 0.3, 0.1, "Register", true, ikkuna) end addEventHandler("onClientResourceStart", getRootElement(),Ikkuna) addEventHandler("OnClientQUIClick",loginbutton, Login) function Login(button) Toimii = guiCreateWindow(0.34, 0.20, 0.20, 0.2,"Toimii!",true) end function Register() end Quote Edited July 20, 2017 by Dutchman101 removed odd tag Link to comment
Tourettes Posted July 19, 2017 Share Posted July 19, 2017 "Nimi" is used twice, you're trying to set the volume on "sound" instead of "Musiikki"... Etc? Link to comment
Viudes Posted July 19, 2017 Author Share Posted July 19, 2017 (edited) Quote 23 minutes ago, Tourettes said: "Nimi" is used twice, you're trying to set the volume on "sound" instead of "Musiikki"... Etc? I fix that. I try to make loginpanel but i don't know is that correct? And what i but serverside? This is fixed verison: function Ikkuna(resource) guiSetInputEnabled(false) Musiikki = playSound("Musiikki.mp3") setSoundVolume(Musiikki, 1.0) showCursor (true) ikkuna = guiCreateWindow(0.34, 0.20, 0.20, 0.2,"Login",true) Nimi = guiCreateEdit( 0.3, 0.3, 0.6, 0.09,"", true, ikkuna) Salasana = guiCreateEdit( 0.3, 0.4, 0.6, 0.09, "", true, ikkuna) loginbutton = guiCreateButton(0.2, 0.6, 0.3, 0.1, "Login", true,ikkuna) registerbutton = guiCreateButton(0.5, 0.6, 0.3, 0.1, "Register", true, ikkuna) Nimi1 = guiCreateLabel(0.1, 0.1, 0.6, 0.09, "name:", true, ikkuna) salasana1 = guiCreateLabel(0.3, 0.2, 0.6, 0.09, "Password:", true, ikkuna) addEventHandler("onClientGUIClick",loginbutton,Login) addEventHandler("onClientGUIClick",loginbutton,Register) end addEventHandler("onClientResourceStart", getRootElement(),Ikkuna) -- -- function Login(button, username, password) local username = guiGetText(Nimi) local password = guiGetText(Salasana) if username and password then triggerServerEvent("Login", getRootElement(), username, password) guiSetInputEnabled(false) else outputChatBox("Enter a username and password") end end Edited July 19, 2017 by Viudes Fix Link to comment
Viudes Posted July 19, 2017 Author Share Posted July 19, 2017 12 minutes ago, f8upd8 said: Any debug strings? I think clientside script work fine but I don't know what i but serverside Link to comment
f8upd8 Posted July 19, 2017 Share Posted July 19, 2017 (edited) 47 minutes ago, Viudes said: I think clientside script work fine but I don't know what i but serverside GUI Functions is meant to be used clientside. You should read scripting guide properly. And it will be nice if you start nesting your code by TAB (NOT BACKSPACES) Edited July 19, 2017 by f8upd8 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now