[QUOTE=jrj996;30908051]I'm a bit confused, can you create an example? :S[/QUOTE]
function CommandHandler(Command)
if Command:GetCommand() == "/daytime" then
local World = GetWorld(0)
World:SetTime(0) -- The parameter is the time you want... goes from 0 to 24000
end
end
Ah, okay, thanks!
Makes me want to learn Lua, but I'm too lazy and I hate coding :V
I hope this is better then shitty Bukkit
[QUOTE=Eeshton;30908531]Makes me want to learn Lua, but I'm too lazy and I hate coding :V[/QUOTE]
You should learn, it's really easy and fun once you see your stuff in action. Once everything is compiled I think I might do a series of tutorials on this :3:
This looks neat.
I will definitely look into this once it's updated to the current version of Minecraft.
:buddy:
[QUOTE=Eeshton;30908531]Makes me want to learn Lua, but I'm too lazy and I hate coding :V[/QUOTE]
Lua is probably one of the easiest scripting languages out there!
[QUOTE=CowThing;30909079]Lua is probably one of the easiest scripting languages out there![/QUOTE]
And PAWN, but Lua is more used by games and mods.
This is awesome. This could become the next bukkit, if it keeps getting updated.
Is there some way to find the coordinates of a player?
Hello there lovely ones.
LuaServer has now been updated to 1.7.2! Rejoice!
[QUOTE=Genesis999;30929931]Hello there lovely ones.
LuaServer has now been updated to 1.7.2! Rejoice![/QUOTE]
Yes! Thank you!
[editline]6th July 2011[/editline]
Wow, I'm getting a lot more errors than I expected, I guess I don't really understand this stuff yet D:
Um, this is weird. I made an error and then when I put it back to before I got the error it was still there...
[QUOTE=jrj996;30930582]Yes! Thank you!
[editline]6th July 2011[/editline]
Wow, I'm getting a lot more errors than I expected, I guess I don't really understand this stuff yet D:
Um, this is weird. I made an error and then when I put it back to before I got the error it was still there...[/QUOTE]
What are you trying to do exactly?
Modify the chat to make it so when a table of admins is called it'll put a tag like [Admin|Owner] in it.
[lua]
Owners = {}
Owners[1] = "jrj996"
Owners[2] = "TRINIMEN"
Owners[3] = "iceman1375"
function OnPlayerChat(Chat)
local Player = GetPlayerEntity(Chat:GetName())
for k,v in pairs(Owners) do
if Chat:GetName() == v then
PrintToChat("[Admin|Owner]".. Chat:GetName() ..": ".. Chat:GetMessage(), "#all")
PrintToConsole("info","Owner|".. Chat:GetName() ..": ".. Chat:GetMessage())
Chat:SetReturn(255)
end
end
end
[/lua]
This doesn't seem to work either;
[lua]
function CommandHandler(Command)
local Player = GetPlayerEntity(Command:GetUser())
if Command:GetCommand() == "/HP" then
if Player:IsOp() then
Player:SetHealth(Command:GetArgument(1))
end
end
Command:SetReturn(255)
end
[/lua]
[QUOTE=jrj996;30932151]Modify the chat to make it so when a table of admins is called it'll put a tag like [Admin|Owner] in it.
[lua]
Owners = {}
Owners[1] = "jrj996"
Owners[2] = "TRINIMEN"
Owners[3] = "iceman1375"
function OnPlayerChat(Chat)
local Player = GetPlayerEntity(Chat:GetName())
for k,v in pairs(Owners) do
if Chat:GetName() == v then
PrintToChat("[Admin|Owner]".. Chat:GetName() ..": ".. Chat:GetMessage(), "#all")
PrintToConsole("info","Owner|".. Chat:GetName() ..": ".. Chat:GetMessage())
Chat:SetReturn(255)
end
end
end
[/lua]
This doesn't seem to work either;
[lua]
function CommandHandler(Command)
local Player = GetPlayerEntity(Command:GetUser())
if Command:GetCommand() == "/HP" then
if Player:IsOp() then
Player:SetHealth(Command:GetArgument(1))
end
end
Command:SetReturn(255)
end
[/lua][/QUOTE]
As to the top one im not sure why its not working for you. I just copypasta'd changed the names and it worked properly.
The second one is not working because in the call to Player:SetHealth your passing the first argument but itll pass it as a string not a number. To make it pass it as a number change it to this:
Player:SetHealth(Command:GetArgument(1) + 0)
Oh! Thanks man!
Also by any chance are you going to put a page on the wiki for requests? Because I'd appreciate it if some type of SQLite feature was implemented.
[QUOTE=jrj996;30932905]Oh! Thanks man!
Also by any chance are you going to put a page on the wiki for requests? Because I'd appreciate it if some type of SQLite feature was implemented.[/QUOTE]
When you say SQLite feature what do you mean?
And theres now a requests page.
I mean like to set a variable easier than SQL, see back when I had a MC server some plugins would save things without SQL and I'm guessing SQLite.
[QUOTE=jrj996;30933367]I mean like to set a variable easier than SQL, see back when I had a MC server some plugins would save things without SQL and I'm guessing SQLite.[/QUOTE]
Well seeing as the mod currently uses SQLite for its database support im guessing its not what your thinking of.
Although i am thinking of adding stuff to make saving things easier when you dont want to use SQL
Thanks, but an overall explanation of what I mean is kind of making a function like Player:Save(bool or var, name of what you're saving,value or bool) and a function to load it back
[QUOTE=ruarai;30935832]I think he means stuff like config files and perhaps editing the NBT files of players
[editline]6th July 2011[/editline]
I've started the server but it says error loading all the functions.
My code: (In main.lua)
[code] function OnPlayerChat(Chat)
PrintToChat("How dare thou chat whilst I kill you.", "#all")
end[/code]
My server.properties:
[code]#Minecraft server properties
#Wed Jul 06 18:02:15 EST 2011
level-name=world
allow-nether=true
view-distance=10
spawn-monsters=true
online-mode=true
lua-filename=main
spawn-animals=true
max-players=20
server-ip=
pvp=true
level-seed=
server-port=25565
allow-flight=false
white-list=false
[/code]
My server log:
[code][INFO] Starting minecraft server version Beta 1.7.2
[WARNING] **** NOT ENOUGH RAM!
[WARNING] To start the server with more ram, launch it as "java -Xmx1024M -Xms1024M -jar minecraft_server.jar"
[INFO] Loading properties
[INFO] Starting Minecraft server on *:25565
[INFO] Preparing level "world"
[INFO] Preparing start region for level 0
[INFO] Preparing start region for level 1
[INFO] Preparing spawn area: 16%
[INFO] Done (1612426161ns)! For help, type "help" or "?"
[WARNING] LUA: Error calling function: OnScriptStart.
[INFO] LUA: Initialising main.lua
[INFO] ruarai [/127.0.0.1:52860] logged in with entity id 114 at (135.4493923768629, 71.0, -21.40012420030225)
[WARNING] LUA: Error calling function: OnPlayerConnect.
[WARNING] LUA: Error calling function: OnPlayerChat.
[INFO] <ruarai> Hello
[/code]
I hope I supplied enough info[/QUOTE]
Make sure you havent gone and accidently changed something else in the script. The only thing i can think of is that you have accidently deleted a curvy bracket thing or something.
I don't think he even loaded all functions into his script...
Do i have to delete META-INF for this?
You really need to show this to Notch, he'll be amazed and probably give you a Lua cape in MC :v:
[editline]6th July 2011[/editline]
probably
Where are the Kick() and Ban() functions?
Is GameTick broken for anybody else or just me? It doesn't seem to be doing anything on the new version.
[QUOTE=Saccn;30946244]Is GameTick broken for anybody else or just me? It doesn't seem to be doing anything on the new version.[/QUOTE]
Yea thats my bad. Seems i accidently left the GameTick out when I updated to 1.7.2
Uploaded a new version with that fixed and some new Propertyfile stuff.
Can some one plz make a video how to set up a lua server.
I'll probably do it soon, along with some tuts. But Genesis, how do you do console commands? My shit keeps breaking, is it because I forgot the Command:SetReturn and if so where the hell do I place it? D:
[QUOTE=w0lfeh;30941379]You really need to show this to Notch, he'll be amazed and probably give you a Lua cape in MC :v:
[editline]6th July 2011[/editline]
probably[/QUOTE]
Notch was supposed to add lua support about 2 years ago but now that someone else made it he'll probably steal it and take credit just like pistons, herp.
Sorry, you need to Log In to post a reply to this thread.