ponfor.blogg.se

Rising world server
Rising world server












rising world server

One more thing to do: Make the label disappear after a given amount of time, for example 5 seconds. The "event"-object contains a reference to the player (this is true for all playerevents). To access the player, we can grab the "event"-object provided with every call of an event. To display the label on the player's screen, we have to call a playerfunction "player:addGuiElement(label) ". Now we can setup the label by changing the size or color of it. Note that x and y are relative coordinates (0-1). To create a label, we call "Gui:createLabel(text, x, y) ". To create a label, we have access to a class "Gui", which offers all required functions. Step 4: Display the server's name on the player's screen You may print a small hint, that your script is loaded now (note: all print()-calls also occurs in the java console):ĪddEvent ( "PlayerSpawn", onPlayerSpawn )

rising world server

The scriptfile itself requires an event to be present, it's called "onEnable()" (which is triggered when the script is loaded).

rising world server

lua file) and a definiton.xml, which contains all required information. Go to the "scripts" folder inside your game folder (if it does not exist, simply create it) and create a new folder named as your script (in our case we simply call it "BasicScript\").

rising world server

What we want to do: We want to display the servername on the players screen when he connects, we also want to create a simple command that gives us the current time, and finally we want to prevent the player from destroying any blocks. Here I want to show you how to set up a very simple basic script. You can also request any function or event if you think they're missing, simply create a topic in our forum: Lua scripting section There are plenty events and function available, and we're continuously extending it. The new Lua scripting functionality offers you a lot of possibilities.














Rising world server