playerRevive.lua - bon3l

Share and discuss custom LunaLua code and content packs for SMBX2.

Moderator: Userbase Moderators

bonel_
Bob-Omb
Bob-Omb
Posts: 24
Joined: Fri May 06, 2022 7:45 pm
Flair: supah mario
Pronouns: he/him
Contact:

playerRevive.lua - bon3l

Postby bonel_ » Tue Apr 01, 2025 6:09 pm

GOOD EVENING, FRIENDS!

I made a new script that revives the player when killed. What's the use for this? If you have a semi-scripted sequence, such as a level where you don't want the player to EXPLODE AND DIE for lore reasons (which is the reason I created this script), then you can just plop the files into your level folder and voila! You can no longer DIE!!!

Tip: When creating pits, make them extend 3 blocks below the bottom of the level with a base and walls to prevent the player from falling infinitely.

Video Demo:


That should be all.
Here's your downloads:
Without player death effect: https://www.mediafire.com/file/9majji5f ... ve.7z/file
With player death effect: https://www.mediafire.com/file/157grafy ... .1.7z/file
Last edited by bonel_ on Wed Apr 02, 2025 1:39 pm, edited 1 time in total.

madman
Shy Guy
Shy Guy
Posts: 6
Joined: Wed May 01, 2024 12:50 pm

Re: playerRevive.lua - bon3l

Postby madman » Wed Apr 02, 2025 1:13 am

this is great, you could base entire levels (especially kaizo and puzzles) around having to kill yourself on purpose to get that extra boost from reviving

AlphaBlue1011
Spiny
Spiny
Posts: 27
Joined: Sun Feb 02, 2025 3:00 pm
Flair: never underestimate hyperfixations :3
Pronouns: she/her or they/them

Re: playerRevive.lua - bon3l

Postby AlphaBlue1011 » Sun Apr 20, 2025 8:53 pm

Tested this out in a level pack I'm working on, and I can confirm that it works just fine if you use an event to activate the script.
Simply put all the code in the luna.lua that comes with the revive script into an onEvent function in your level's luna.lua, which should look something like this:

Code: Select all

function onEvent(eventName)
	if eventName == "[eventnamehere]" then
		local playerRevive = require("playerRevive")
		function onPlayerKill(eventToken)
			player.deathTimer = 1
			eventToken.cancelled = true
		end
	end
end
I personally made this get triggered by an axe that I changed to look like a Totem of Undying from Minecraft, but I'm sure there's other ways to use it with an event.

Bboyfergie
Goomba
Goomba
Posts: 3
Joined: Sun Mar 27, 2022 1:54 pm
Pronouns: he/him

Re: playerRevive.lua - bon3l

Postby Bboyfergie » Mon Apr 21, 2025 5:18 pm

This is a really cool idea. Would it be possible to make it still take away a life, and maybe still get a game over if there are no lives left?


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 7 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari