Page 1 of 1

How do I disable and change certain player actions?

Posted: Wed Aug 10, 2022 12:43 pm
by Registered sand eater
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?

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

Posted: Wed Aug 10, 2022 1:09 pm
by deice
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.