Reply To: Mod Questions

Home Forums Wayward Mod Questions Reply To: Mod Questions

#3953
supernet2
Member

Okay thanks Vaughn


@JamesIII
so i been trying to tinker with your initial code to make item buttons. Im using the arrow as a example for now.

This is what i do and i run into errors.

$("#optionswindow").on("click", '#getarrow’', function(e) itemGet("arrow");
$("#optionswindow").append('<button type="button" id="getarrow">Get Arrow</button>');

the argument $(“#optionswindow”).append(‘<button type=”button” id=”getarrow”>Get Arrow</button>’); code is solely to point to the id which is named getarrow and then show the button icon as “Get Arrow”.

Okay so i know the button works.

The id points towards the code $(“#optionswindow”).on(“click”, ‘#getarrow’’, function(e) itemGet(“arrow”);

but it seems im running into errors, so i tried these 4 different versions of the code.
$(“#optionswindow”).on(“click”, ‘#chicken’, function(e) {itemGet(“arrow”); e.preventDefault();message(“got arrow!”);});
failed so i tried

$(“#optionswindow”).on(“click”, ‘#getarrow’’, function(e) itemGet(“arrow”);

and that failed so i tried

$(“#optionswindow”).on(“click”, ‘#chicken’, function(e) {itemGet(“arrow”); e.preventDefault();message(“got arrow!”);});

all variants failed so im unsure where im going wrong here