Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ID = 44099; //Tutaj musisz wpisać ID konkretnego NPC
- var Img = 'https://www.margonem.pl/obrazki/npc/kob/gothic_girl2.gif'; //Tutaj musisz wpisać NOWĄ grafikę NPC
- var error = false;
- function ChangeImg() {
- if ($("#npc" + ID).css("background-image") != 'url(' + Img + ')' && Img != '' && ID > 0) {
- var img = new Image();
- img.src = Img;
- img.onload = function() {
- $("#npc" + ID).css({
- 'background-image': 'url(' + Img + ')',
- 'width': (this.width) + 'px',
- 'height': (this.height) + 'px'
- });
- }
- } else {
- if (Img == '' || ID <= 0) {
- if (!error) {
- alert("Nie wypełniłeś wszystkich potrzebnych informacji, do działania tego kodu!");
- error = true;
- }
- }
- }
- };setInterval(ChangeImg, 500);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement