tommyroyall

Untitled

Nov 15th, 2012
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.19 KB | None | 0 0
  1.  
  2.  
  3. b.settings={}; -- The general table for the block. This just makes editing the variables easier and much more convenient.
  4. b.settings.id=500; -- Id.
  5. b.settings.texture_slot=0;
  6. b.settings.material=material.wood;
  7. b.settings.texture_path='/textures.png';
  8. b.settings.name="Tommy's Block";
  9. b.settings.internal_name="demo";
  10.  
  11. b=b.createBlock(b.settings.id,b.settings.texture_slot,b.settings.material,b.settings.texture_path,b.settings.name,b.settings.internal_name)
  12.  
  13. b.setLightLevel("demo",0.7)
  14.  
  15. if b then -- If the block was created succesfully, add it to the misc tab. Otherwise, log a severe warning on the server console.
  16.     b.setCreativeTab("demo", creativeTabs.misc)
  17. else
  18.     log.severe("Tommy's block has failed to initiate.")
  19. end
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.   -- About the block.setLightLevel() function.
  27. -- [19:24] <samrg472> Theres an undocumented function you know for block
  28. -- [19:24] <samrg472> block.setLightLevel(String blockname, int n)
  29. -- [19:26] <Sledger721> Ooh, cool :D
  30. -- [19:27] <samrg472> n is > 0 and <= 1 just for reference
  31. -- [19:27] <samrg472> use things like 0.1 to 1.0
  32. -- [19:27] <Sledger721> Ok
  33. -- [19:27] <samrg472> and just plain 0 for no light
  34. -- [19:27] <Sledger721> Alright. Thanks man :D
Advertisement
Add Comment
Please, Sign In to add comment