Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local snifit = {};
- local snifitType = 1;
- local shotCount = -1;
- local projectile = 133 --Snifit bullet
- local npcconfig = API.load("npcconfig");
- function snifit.updateSnifits()
- bullets = NPC.get(133, -1);
- for k,v in pairs(NPC.get(130 + (snifitType - 1),player.section)) do
- if v.layerName.str == "Jump" then
- if v:mem(0xF0, FIELD_DFLOAT) == 120 and v.collidesBlockBottom then
- v.speedY = -6;
- end
- end
- if v.layerName.str == "Jump3" then
- if v:mem(0xF0, FIELD_DFLOAT) >= 100 and v.collidesBlockBottom and shotCount == -1 then
- v.speedY = -9;
- end
- if v:mem(0xF0, FIELD_DFLOAT) >= 120 and shotCount == -1 then
- shotCount = 0;
- end
- if v:mem(0xF0, FIELD_DFLOAT) <= 139 and v:mem(0xF0, FIELD_DFLOAT) >= 15 and shotCount > -1 and shotCount < 3 then
- v:mem(0xF0, FIELD_DFLOAT, 149);
- shotCount = shotCount + 1;
- end
- if shotCount >= 3 and v.collidesBlockBottom then
- shotCount = -1;
- v:mem(0xF0, FIELD_DFLOAT, 19);
- end
- end
- if bullets ~= nil and projectile ~= 133 then
- if (table.getn(bullets) > 0) then
- local fire = bullets[table.getn(bullets)];
- fire.id = projectile;
- fire.width = npcconfig[projectile].width;
- fire.height = npcconfig[projectile].height;
- fire.y = fire.y - npcconfig[projectile].height/7.5;
- end
- end
- end
- end
- function snifit.configureSnifits(namedArgs)
- if namedArgs.snifitType ~= nil then
- snifitType = namedArgs.snifitType;
- end
- if namedArgs.projectile ~= nil then
- projectile = namedArgs.projectile;
- end
- end
- function snifit.onInitAPI()
- registerEvent(snifit, "onTick", "updateSnifits");
- end
- return snifit;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement