Is possible disable the tail swipe/smacking using lua ?

Post here for help and support regarding LunaLua and SMBX2's libraries and features.

Moderator: Userbase Moderators

AirShip
Fuzzy
Fuzzy
Posts: 1085
Joined: Wed Jan 01, 2014 1:30 am
Flair: The Flying Ghost
Contact:

Is possible disable the tail swipe/smacking using lua ?

Postby AirShip » Fri Mar 25, 2022 2:08 pm

the title.

deice
Volcano Lotus
Volcano Lotus
Posts: 596
Joined: Fri Jul 23, 2021 7:35 am

Re: Is possible disable the tail swipe/smacking using lua ?

Postby deice » Fri Mar 25, 2022 7:14 pm

the following code seems to work for me:

Code: Select all

function onTick()
	if(not player.keys.down) then
		player:mem(0x164, FIELD_WORD, -1)
	else
		player:mem(0x164, FIELD_WORD, 0)
	end
end
the reason for the check is that setting the tail timer to a negative value causes the player to be unable to duck (thanks redigit), so if they are ducking you have to set it to a non-negative one.

AirShip
Fuzzy
Fuzzy
Posts: 1085
Joined: Wed Jan 01, 2014 1:30 am
Flair: The Flying Ghost
Contact:

Re: Is possible disable the tail swipe/smacking using lua ?

Postby AirShip » Fri Mar 25, 2022 10:18 pm

deice wrote:
Fri Mar 25, 2022 7:14 pm
the following code seems to work for me:

Code: Select all

function onTick()
	if(not player.keys.down) then
		player:mem(0x164, FIELD_WORD, -1)
	else
		player:mem(0x164, FIELD_WORD, 0)
	end
end
the reason for the check is that setting the tail timer to a negative value causes the player to be unable to duck (thanks redigit), so if they are ducking you have to set it to a non-negative one.
works perfectly fine, thanks!


Return to “LunaLua Help”

Who is online

Users browsing this forum: Petal [Bot] and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari