Jump to content

quadrinka4

Member
  • Posts

    36
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

quadrinka4's Achievements

  1. Wow thank you both ^^ those codes sure did work very well
  2. getPlayer():getInventory():AddItem(InventoryItem(Cooked.Steak) ); isn't this the correct way to do ? or this? what have I done wrong? getPlayer():getInventory():AddItem(InventoryItem(Cooked) Base.Steak ); getPlayer():getInventory():AddItem("Base.Steak.Foods.Burnt"); Thank you for your help
  3. Hello, I have another question here ^^ my question is: how do I call a method that look up items that are laying or dropped near the player?? For example, I know getPlayer():getInventory():getNumItems("name"); looks up the number of item in a player inventory. However, I want a method that looks up the number of both 'main inventory' and 'ground ' items. Maybe GetWorldItem() does the trick? Thanks in advance.
  4. Hi, I have yet another question in modding. I am trying to use the Scanner class to read a text file from the computer and print it on the player's screen. For example, Scanner keyboard = new Scanner(new File("C:\\Users\\username\\Desktop\\test.txt")); and then system.out.print(""); is there a way to do this from Lua as well?
  5. Im really really.. dumb for not trying that... T-T Thank you T--T Now, how would I remove the multiple items?
  6. So, I am trying my butt off to remove items from a player's inventory once the command is run. Although I can't figure out this simple code why it wouldn't work. I've tried so far: getPlayer():getInventory():DoRemoveItem("Apple"); getPlayer():getInventory():Remove("Base.Apple"); getPlayer():getInventory():Remove(Apple); getPlayer():getInventory():Remove(Base.Apple); getPlayer():getInventory():Remove("Base.Apple"itemType(Food)); getPlayer():getInventory():RemoveOneOf("Base.Apple"); none of them is working... Remove("Base.Apple"); runs without error but it doesn't actually remove apple from the inventory.. Help please? Thanks in advance~
  7. Thank you ^^!! is there also a way to make the function to check not the exact that spot but within 3 blocks of that spot??
  8. local player = getPlayer(); local px = getPlayer():getX(); local py = getPlayer():getY(); if (px == 10994 && py == 9647) then player:Say("here i am"); end Hello everyone, in this code I am trying to make a player say "here i am" when its function is executed at certain location. however, the console keep giving me there's an error at line 5 saying " ')' expected to be near & " . Could anyone help me to fix this problem? Thank you in advance.
  9. So i introduced above code in Hydrocraft and I still get error.... function HCFloraGather(items, result, player) local room = getPlayer():getCurrentSquare():getRoom(); local roomName = room:getName(); if roomName =~ "grocery" then player:Say("There are no flora indoors."); end Sorry for being such a pain. But I am learning alot form you about LUA right now. Thank you
  10. Thank you so much ^^ so if i want to test if my player is in grocery room, putting if not roomName: ("grocery") then player:Say("You are in wrong room."); this cause error, I am new to the Lua so i guess i am still on the learning phase by looking at other's codes.... Could someone fix what I did wrong?
  11. Hello, I am trying to make a mod that allows a player to perform an action if the player is in a certain room definition (ex: church, grocery, livingroom, etc). I've got my idea from Hydrocraft and its' code : if not player:isOutside() then player:Say("There are no flora indoors."); My question is, is there a method that I can use to check if the player is in a certain room? maybe player:isRoom(grocery) type of thing? Thanks in advance.
  12. Thanks for your reply. Although when I mentioned restarting game, I meant of exiting to Main menu. I wanted to know if it is possible to reload the /scripts like reloading .lua (through F11 debug reloading). and not having to go back to the main menu. One more question, changing texture of an item require the game to be shut down completely to get updated. The texture .png files do not get reloaded each time I load the game from main menu?
  13. Is there a way to refresh or reload the .txt files in media/scripts folder while the game is still running? So I do not have to exit and restart the game each time I include/edit a new custom item? I know we have loading the game through debug option but it only reloads .lua files. Please help me. Thank you ^^
×
×
  • Create New...