Shazzimal Posted February 14, 2013 Share Posted February 14, 2013 Hey, I was just trying to make my first script. Wat I was making is: When someone joins my server, there will come up a GUI window, on that window are comming some rules commands etc. i maked this script and meta: server.lua addEventHandler("onPlayerJoin",getRootElement(), function createWelcomeMessage() local X = 0.375 local Y = 0.375 local Width = 0.25 local Height = 0.25 wdwWelcome = guiCreateWindow(X, Y, Width, Height, "Welcome to my server.", true) X = 0.0825 Y = 0.2 Width = 0.25 Height = 0.25 guiCreateLabel(X, Y, Width, Height, "Welcome to my server! etc...") guiSetVisible(wdwWelcome, false) end meta.xml <meta> <info author="Shazzimal" name="welcomeMessage" version="1.0" disc="Will create a welcome message at join."/> <script src="server.lua"/> </meta> I tried to run it on my server but my server, doesn't recognized it, why? Thanks Link to comment
Shazzimal Posted February 14, 2013 Author Share Posted February 14, 2013 Oops, hahahaha. Link to comment
iPrestege Posted February 14, 2013 Share Posted February 14, 2013 and you have some wrongs on create the label . Link to comment
Shazzimal Posted February 14, 2013 Author Share Posted February 14, 2013 What's the problem? Link to comment
Shazzimal Posted February 14, 2013 Author Share Posted February 14, 2013 What are the problems Link to comment
iPrestege Posted February 14, 2013 Share Posted February 14, 2013 wdwWelcome = { } local X = 0.375 local Y = 0.375 local Width = 0.25 local Height = 0.25 wdwWelcome = guiCreateWindow(X, Y, Width, Height, "Welcome to my server.", true) X = 0.0825 Y = 0.2 Width = 0.25 Height = 0.25 guiCreateLabel(X, Y, Width, Height, "Welcome to my server! etc..." , true , wdwWelcome) Link to comment
Anderl Posted February 14, 2013 Share Posted February 14, 2013 wdwWelcome = { } local X = 0.375 local Y = 0.375 local Width = 0.25 local Height = 0.25 wdwWelcome = guiCreateWindow(X, Y, Width, Height, "Welcome to my server.", true) X = 0.0825 Y = 0.2 Width = 0.25 Height = 0.25 guiCreateLabel(X, Y, Width, Height, "Welcome to my server! etc..." , true , wdwWelcome) There is no need for declaring a table variable with the name 'wdwWelcome'. Link to comment
iPrestege Posted February 14, 2013 Share Posted February 14, 2013 wdwWelcome = { } local X = 0.375 local Y = 0.375 local Width = 0.25 local Height = 0.25 wdwWelcome = guiCreateWindow(X, Y, Width, Height, "Welcome to my server.", true) X = 0.0825 Y = 0.2 Width = 0.25 Height = 0.25 guiCreateLabel(X, Y, Width, Height, "Welcome to my server! etc..." , true , wdwWelcome) There is no need for declaring a table variable with the name 'wdwWelcome'. Thanks . Link to comment
Shazzimal Posted February 14, 2013 Author Share Posted February 14, 2013 Thanks for your help guys, but what is the different between server- en client side. And must i add the addEventHandler, or? Link to comment
iPrestege Posted February 14, 2013 Share Posted February 14, 2013 The server side will happen to all on the server . Link to comment
Shazzimal Posted February 14, 2013 Author Share Posted February 14, 2013 (edited) To all players? And what does client side? Must i add the addEventHandler? Edited February 14, 2013 by Guest Link to comment
iPrestege Posted February 14, 2013 Share Posted February 14, 2013 For The Player Only That One Use It . Link to comment
Castillo Posted February 14, 2013 Share Posted February 14, 2013 Some functions/events are client or server side only, like all GUI/DX drawing functions are client side only, you can't use them server side. Link to comment
iPrestege Posted February 14, 2013 Share Posted February 14, 2013 This is what I mean exactly . Link to comment
Shazzimal Posted February 15, 2013 Author Share Posted February 15, 2013 Ok, thank you guys! Link to comment
Shazzimal Posted February 15, 2013 Author Share Posted February 15, 2013 But mustn't i use addEventHandler at playerjoin? Link to comment
iPrestege Posted February 15, 2013 Share Posted February 15, 2013 But mustn't i use addEventHandler at playerjoin? You do not need when the player join because it is the window will be visible. Link to comment
Shazzimal Posted February 15, 2013 Author Share Posted February 15, 2013 Oke, i am always going to add a command to open it, just add this? addCommandHandler(Welcome, function ... ) Wich function must i use? Link to comment
iPrestege Posted February 15, 2013 Share Posted February 15, 2013 addCommandHandler("open", function () guiSetVisible(wdwWelcome,true) showCursor(true) end) 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