Is it possible to make a script mod that enables you to add a shop to your world just like you can in a server? If it is this would be an amazing mod that would make survival mode more fun for myself since i cant make a server due to no computer or router to port-forward
Either one but i would like it so you tap a sign that says 'sell' and you can sell a certain item and another sign that says 'shop' or 'buy' and you can buy that certain item. But whatever is easiest will be fine
I tried but I failed. I can't seem to get Level.getSignText to work. When I do if(Level.getSignText(x,y,z,0)==Shop), BlockLauncher thinks that "Shop" is an undefined variable. I want BlockLauncher to realise that "Shop" is the text in line 1(0 is 1 in coding) of the sign that I touch. This is my script which failed. Feel free to edit and modify it if you think you can get it to work.
function useItem(x,y,z,itemId,blockId,side)
{
if(Level.getSignText(x,y,x,0)==Shop && Player.getInventorySlot(0)==264 && Player.getInventorySlotCount(0)==10)
{
addItemInventory(264,-10);
Player.setArmourSlot(0,310);
Player.setArmourSlot(1,311);
Player.setArmourSlot(2,312);
Player.setArmourSlot(3,313);
clientMessage("The trade has been successful!");
}
}
I tried but I failed. I can't seem to get Level.getSignText to work. When I do if(Level.getSignText(x,y,z,0)==Shop), BlockLauncher thinks that "Shop" is an undefined variable. I want BlockLauncher to realise that "Shop" is the text in line 1(0 is 1 in coding) of the sign that I touch. This is my script which failed. Feel free to edit and modify it if you think you can get it to work.
function useItem(x,y,z,itemId,blockId,side)
{
if(Level.getSignText(x,y,x,0)==Shop && Player.getInventorySlot(0)==264 && Player.getInventorySlotCount(0)==10)
{
addItemInventory(264,-10);
Player.setArmourSlot(0,310);
Player.setArmourSlot(1,311);
Player.setArmourSlot(2,312);
Player.setArmourSlot(3,313);
clientMessage("The trade has been successful!");
}
}
I would if i new how to java code lol but it doesnt have to be exactly what i said, you could do whatever posible to make a shop.
Want GUI Templates? Done!
https://github.com/BeATz-UnKNoWN/ModPE_Scripts/wiki/ModPE-Script-Templates
P.S. Feel free to follow me so you know when I post "awesome" content and make the MCForums a brighter place (totally).
If you need to contact me you can either shoot a Kik message to beatz_unknown or send an email to [email protected]
function useItem(x,y,z,itemId,blockId,side)
{
if(Level.getSignText(x,y,x,0)==Shop && Player.getInventorySlot(0)==264 && Player.getInventorySlotCount(0)==10)
{
addItemInventory(264,-10);
Player.setArmourSlot(0,310);
Player.setArmourSlot(1,311);
Player.setArmourSlot(2,312);
Player.setArmourSlot(3,313);
clientMessage("The trade has been successful!");
}
}
Want GUI Templates? Done!
https://github.com/BeATz-UnKNoWN/ModPE_Scripts/wiki/ModPE-Script-Templates
P.S. Feel free to follow me so you know when I post "awesome" content and make the MCForums a brighter place (totally).
If you need to contact me you can either shoot a Kik message to beatz_unknown or send an email to [email protected]
Would you be able to make it possible?
I would if i new how to java code lol but it doesnt have to be exactly what i said, you could do whatever posible to make a shop.
Want GUI Templates? Done!
https://github.com/BeATz-UnKNoWN/ModPE_Scripts/wiki/ModPE-Script-Templates
P.S. Feel free to follow me so you know when I post "awesome" content and make the MCForums a brighter place (totally).
If you need to contact me you can either shoot a Kik message to beatz_unknown or send an email to [email protected]