How do I disable and change certain player actions?

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

Moderator: Userbase Moderators

Registered sand eater
Bot
Bot
Posts: 55
Joined: Fri Jan 28, 2022 4:14 pm
Pronouns: he/him

How do I disable and change certain player actions?

Postby Registered sand eater » Wed Aug 10, 2022 12:43 pm

I want to disable running and change the jump of toad to one of Ninja Bomberman, but without the bomb. Is it possible and if it is, how?

deice
Rocky Wrench
Rocky Wrench
Posts: 638
Joined: Fri Jul 23, 2021 7:35 am

Re: How do I disable and change certain player actions?

Postby deice » Wed Aug 10, 2022 1:09 pm

to disable running, use:

Code: Select all

function onTick()
	for _, v in ipairs(Player.get()) do
		v:mem(0x168, FIELD_FLOAT, 1)
		if(v.speedX > 0) then
			v.speedX = math.min(v.speedX, Defines.player_walkspeed)
		elseif(v.speedX < 0) then
			v.speedX = math.max(v.speedX, -Defines.player_walkspeed)
		end
	end
end
as for the ninja bomberman jump, you could try looking at the code for the character (data/scripts/characters/ninjabomberman.lua) but it's very old and messy. i have no familiarity with it so i cannot help in that regard.


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari