Jump to content

New Question :P


12p

Recommended Posts

Sorry about this, guys. How can I save all the objects I have created in a LUA file?

I mean, I want to create 1 line for each object in the map, so next time the resource start, every object will be respawned.

This is the (not ready) code I have:

addEventHandler ("onClientPlayerQuit",getRootElement(), 
function ()  
 for i,theBlock in ipairs (blocks) do --"blocks" is a table that returns all the objects I need. 
  --What to do here? 
 end 
end) 

Can anybody, at least, give me a clue?

Link to comment

well if you want to store something client-side, your only option is XML really, file functions are server-side only as i recall.

though you can export/create server-side Lua file which will create the objects, but then you'll need to figure a way for it to run.

like some separate "lua-map" resource that you will update with your lua files and restart. that's first that comes to mind :D

or something with runcode/loadstring.

imo XML is the way, why create mapping system if there already is one.

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...