Jump to content

Help Scripting !!


waqaarali

Recommended Posts

I really want to learn to script, but I don't really understand what I do wrong and how to script, I understand how to fix scripts but I don't know how to script. I tried to make a simple spawn script but I failed to even make the GUI to work.

spawn.lua

rootElement = getRootElement() 
function showMain() 
mainwindow = guiCreateWindow(236, 197, 405, 296, "", true) 
guiWindowSetSizable(mainwindow, false) 
hospital = guiCreateButton(18, 42, 117, 43, "Hospital", true, mainwindow) 
police = guiCreateButton(18, 104, 117, 43, "Police Department", true, mainwindow) 
cityhall = guiCreateButton(18, 168, 117, 43, "City Hall", true, mainwindow) 
ammunation = guiCreateButton(18, 234, 117, 43, "Ammunation", true, mainwindow) 
memo = guiCreateMemo(143, 43, 252, 234, "Welcome to Gangsta's Paradise Roleplay Server. Before you can start playing please select one of the positions you would like to spawn. Remember once you have spawned you cannot then come back to this window unless you die. So make a wise choice before you spawn.\n\n\n\n\nSpawn Script By Gangsta v1 ", true, mainwindow) 
guiMemoSetReadOnly(memo, true) 
end 
addEventHandler("onClientPlayerJoin", rootElement, showMain) 

meta.xml

<meta> 
     <info author="Gangsta" type="script" description="Spawn" /> 
     <script src="spawn.lua" /> 
</meta> 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...